/* SINGLE HORIZONTAL LINE - ALL ITEMS IN ONE BOX */
.modal-institution-info {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: 1.5rem 0;
  transition: all 0.3s ease;
}

.modal-institution-info:hover {
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.modal-timeline-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.modal-timeline-icon {
  width: 1.5rem;
  height: 1.5rem;
  background: white;
  border-radius: 0.25rem;
}
/* ===========================
   OPTIMIZED TEACHING PAGE CSS - COMPREHENSIVE FIX
   =========================== */

/* Color Theme Variables - PROFESSIONAL SOFT COLORS */
:root {
  --color-navy: #0f172a;
  --color-steel-blue: #475569;
  --color-slate-50: #f8fafc;
  --color-slate-100: #f1f5f9;
  --color-slate-200: #e2e8f0;
  --color-slate-300: #cbd5e1;
  --color-slate-600: #475569;
  --color-slate-700: #334155;
  --color-gray-100: #f3f4f6;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  
  /* PROFESSIONAL SOFT COLORS */
  --viz-color: #93c5fd;
  --viz-bg: #dbeafe;
  --hci-color: #86efac;
  --hci-bg: #d1fae5;
  --ai-color: #fcd34d;
  --ai-bg: #fef3c7;
  --healthcare-color: #fca5a5;
  --healthcare-bg: #fee2e2;
  --systems-color: #c4b5fd;
  --systems-bg: #e0e7ff;
  --web-color: #86efac;
  --web-bg: #d1fae5;
}

/* Global Font Settings */
body, h1, h2, h3, h4, h5, h6, p, span, div, a, button {
  font-family: "Figtree", sans-serif, "Open Sans", "Avenir Next", Arial !important;
}

/* Main Layout */
.teaching-grid-section {
  padding: 2rem 0;
  background: linear-gradient(135deg, var(--color-slate-50), #ffffff);
  min-height: 70vh;
}

.teaching-container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===========================
   FLOWING GROUPS LAYOUT - SIMPLIFIED
   =========================== */

.flowing-groups {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  margin: 2rem 0;
}

.area-group {
  position: relative;
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--color-gray-100);
  transition: all 0.3s ease;
}

.area-group:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.area-indicator {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 0 4px 4px 0;
  transition: width 0.3s ease;
}

/* SOFT PROFESSIONAL INDICATOR COLORS */
.area-group[data-area="dataScience"] .area-indicator {
  background: var(--viz-color);
}

.area-group[data-area="webDev"] .area-indicator {
  background: var(--web-color);
}

.area-group[data-area="systems"] .area-indicator {
  background: var(--systems-color);
}

.area-group[data-area="biomedical"] .area-indicator {
  background: var(--healthcare-color);
}

.area-group:hover .area-indicator {
  width: 6px;
}

/* SIMPLIFIED AREA HEADER - NO ICONS, NO SUBTITLES */
.area-header {
  margin-bottom: 2rem;
  padding-left: 1rem;
  border-bottom: 1px solid var(--color-slate-200);
  padding-bottom: 1.5rem;
}

.area-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-navy);
  margin: 0;
}

.courses-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
}

/* ===========================
   TEACHING CARDS - FIXED OVERLAYS
   =========================== */

.teaching-card {
  background: white;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: 1px solid var(--color-gray-100);
  position: relative;
}

.teaching-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.08);
}

.teaching-image-container {
  position: relative;
  height: 160px;
  background: linear-gradient(135deg, var(--color-slate-100), var(--color-slate-200));
  overflow: hidden;
}

.teaching-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.teaching-card:hover .teaching-image {
  transform: scale(1.05);
}

/* Category-specific backgrounds with soft colors */
.teaching-image-container.dataScience {
  background: linear-gradient(135deg, var(--viz-color), #60a5fa);
}

.teaching-image-container.webDev {
  background: linear-gradient(135deg, var(--web-color), #4ade80);
}

.teaching-image-container.systems {
  background: linear-gradient(135deg, var(--systems-color), #a78bfa);
}

.teaching-image-container.biomedical {
  background: linear-gradient(135deg, var(--healthcare-color), #f87171);
}

/* Gradient overlay */
.teaching-image-container::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to bottom, transparent 0%, rgba(255, 255, 255, 0.3) 30%, rgba(255, 255, 255, 0.8) 70%, white 100%);
  pointer-events: none;
}

/* FIXED OVERLAY POSITIONS - ROLE LEFT, UNIVERSITY RIGHT */
.teaching-overlay {
  position: absolute;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

/* ROLE/INSTRUCTOR ON LEFT WITH WHITE BACKGROUND */
.role-overlay {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  color: var(--color-navy);
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* UNIVERSITY ON RIGHT WITH DARK BACKGROUND */
.university-overlay {
  background: rgba(71, 85, 105, 0.9);
  backdrop-filter: blur(20px);
  color: white;
  padding: 0.4rem 0.7rem;
  border-radius: 0.5rem;
  font-size: 0.65rem;
  font-weight: 600;
}

.teaching-content {
  padding: 1rem 1.5rem 1.5rem;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.9) 50%, white 100%);
  position: relative;
  margin-top: -40px;
  z-index: 2;
}

.teaching-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-navy);
  margin-bottom: 0.75rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.teaching-description {
  font-size: 0.9rem;
  color: var(--color-gray-600);
  line-height: 1.5;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Highlights section */
.teaching-highlights {
  margin-bottom: 1rem;
}

.teaching-highlights h4 {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-gray-700);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.teaching-highlights ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.teaching-highlights li {
  font-size: 0.8rem;
  color: var(--color-gray-600);
  line-height: 1.4;
  padding: 0.2rem 0;
  padding-left: 1rem;
  position: relative;
}

.teaching-highlights li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--color-steel-blue);
  font-size: 0.7rem;
}

/* TAGS REMOVED COMPLETELY */
.teaching-tags {
  display: none;
}

.teaching-tag {
  display: none;
}

/* Interactive Minimalist Links */
.teaching-links {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.teaching-link {
  color: var(--slate);
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
}

/* The "Underline" is replaced by a subtle "Fill" effect for a cleaner look */
.teaching-link:hover {
  color: var(--navy);
  background: var(--line); /* Soft grey background on hover */
  border-color: var(--line);
  transform: translateY(-2px);
}

.teaching-link i {
  font-size: 0.8rem;
  color: var(--light-slate);
  transition: color 0.25s ease, transform 0.25s ease;
}

.teaching-link:hover i {
  color: var(--accent); /* Icon changes color to draw the eye */
  transform: scale(1.1);
}

/* Optional: Special styling for the primary "Paper" link */
.research-link[title*="PDF"], .research-link[title*="Paper"] {
  color: var(--navy);
  border-color: var(--line);
}
/* ===========================
   MODAL STYLES - REMOVE RESEARCH ALIGNMENT
   =========================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(12px);
  padding: 2rem;
}

.modal-overlay.active {
  display: flex;
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; backdrop-filter: blur(0px); }
  to { opacity: 1; backdrop-filter: blur(12px); }
}

.modal-content {
  background: white;
  border-radius: 1.5rem;
  max-width: 900px;
  max-height: 85vh;
  width: 100%;
  position: relative;
  overflow: hidden;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.2), 0 16px 32px rgba(0, 0, 0, 0.15), 0 8px 16px rgba(0, 0, 0, 0.1);
}

.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
  color: var(--color-gray-600);
  font-size: 1rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.modal-close:hover {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
  transform: scale(1.1);
}

.modal-body {
  overflow-y: auto;
  max-height: 85vh;
  scrollbar-width: thin;
  scrollbar-color: rgba(156, 163, 175, 0.3) transparent;
}

.modal-content-section {
  padding: 2.5rem;
  position: relative;
}

.modal-image {
  width: 240px;
  height: 160px;
  object-fit: cover;
  border-radius: 0.75rem;
  float: right;
  margin: 0 0 1.5rem 2rem;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--color-slate-200);
}

.modal-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: 1rem;
  line-height: 1.3;
}

.modal-meta {
  font-size: 1rem;
  color: var(--color-gray-600);
  margin-bottom: 1rem;
  font-style: italic;
}

/* SMALL BOXES ARRANGED HORIZONTALLY */
.modal-institution-info {
  display: flex;
  gap: 0.75rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.modal-timeline-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  /* background: var(--color-slate-50); */
  padding: 0.5rem 0.75rem;
  /* border-radius: 0.5rem;
  border: 1px solid var(--color-slate-200); */
  transition: all 0.3s ease;
  flex: 1;
  min-width: 0;
}

.modal-timeline-item:hover {
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.modal-timeline-icon {
  width: 1.25rem;
  height: 1.25rem;
  background: white;
  border-radius: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  border: 1px solid var(--color-slate-200);
  flex-shrink: 0;
}

.modal-timeline-content {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex: 1;
}

.modal-timeline-label {
  font-size: 0.6rem;
  color: var(--color-gray-600);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 500;
  line-height: 1;
}

.modal-timeline-value {
  font-size: 0.75rem;
  color: var(--color-navy);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Different icon background colors for each type */
/* .modal-timeline-item:nth-child(1) .modal-timeline-icon {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
}

.modal-timeline-item:nth-child(2) .modal-timeline-icon {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
}

.modal-timeline-item:nth-child(3) .modal-timeline-icon {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
} */

/* Responsive for timeline */
@media (max-width: 768px) {
  .modal-institution-info {
    flex-direction: column;
    gap: 0.5rem;
  }

  .modal-timeline-item {
    flex: none;
    width: 100%;
  }

  .modal-timeline-value {
    white-space: normal;
  }
}

.modal-section {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--color-slate-200);
  padding-bottom: 1.5rem;
}

.modal-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.modal-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: #3b82f6;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
  border-left: 3px solid #3b82f6;
  padding-left: 0.75rem;
}

/* MODAL TAGS ALSO HIDDEN */
.modal-tags {
  display: none;
}

.modal-tags .teaching-tag {
  display: none;
}

/* MODAL DESCRIPTION - NO RESEARCH ALIGNMENT */
.modal-description {
  color: var(--color-gray-700);
  line-height: 1.7;
  font-size: 0.95rem;
}

.modal-description p {
  margin-bottom: 1rem;
}

.modal-description p:last-child {
  margin-bottom: 0;
}

.modal-responsibilities {
  color: var(--color-gray-700);
  line-height: 1.6;
  font-size: 0.95rem;
}

.modal-responsibilities ul {
  list-style: none;
  padding-left: 0;
}

.modal-responsibilities li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
  line-height: 1.6;
}

.modal-responsibilities li::before {
  content: '▶';
  position: absolute;
  left: 0;
  color: var(--color-steel-blue);
  font-size: 0.8rem;
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */

@media (max-width: 768px) {
  .flowing-groups {
    gap: 2rem;
  }
  
  .area-group {
    padding: 1.5rem;
  }
  
  .area-header {
    padding-left: 0.5rem;
    margin-bottom: 1.5rem;
  }
  
  .area-title {
    font-size: 1.3rem;
  }
  
  .courses-flow {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .teaching-image-container {
    height: 140px;
  }
  
  .modal-overlay {
    padding: 1rem;
  }
  
  .modal-content-section {
    padding: 2rem;
  }
  
  .modal-image {
    width: 100%;
    height: 200px;
    float: none;
    margin: 0 0 1.5rem 0;
  }
  
  .modal-title {
    font-size: 1.4rem;
  }
}

