/* ================================================
   MODERN UNIVERSITIES SECTION - PROFESSIONAL DESIGN
   ================================================ */

.modern-universities-section {
  padding: 100px 0;
  background: #ffffff !important; /* Light mode: solid white background */
  position: relative;
  overflow: hidden;
}

.modern-universities-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(206, 17, 38, 0.3), transparent);
}

/* Section Header */
.section-header-modern {
  margin-bottom: 60px;
  position: relative;
}

.section-tag {
  display: inline-block;
  padding: 8px 24px;
  background: linear-gradient(135deg, rgba(206, 17, 38, 0.15), rgba(206, 17, 38, 0.08));
  color: #000000;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: 50px;
  border: 2px solid rgba(206, 17, 38, 0.3);
  margin-bottom: 20px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.section-tag::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(206, 17, 38, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.section-tag:hover::before {
  width: 200px;
  height: 200px;
}

.section-tag:hover {
  background: rgba(206, 17, 38, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(206, 17, 38, 0.2);
}

.section-title-modern {
  font-size: 2.5rem;
  font-weight: 800;
  color: #000000 !important; /* Light mode: black text */
  margin: 0 0 15px;
  line-height: 1.2;
  position: relative;
  display: inline-block;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.section-title-modern::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, transparent, #ce1126, transparent);
  border-radius: 2px;
  animation: title-underline 3s ease-in-out infinite;
}

@keyframes title-underline {
  0%, 100% { width: 80px; opacity: 0.8; }
  50% { width: 120px; opacity: 1; }
}

.section-subtitle-modern {
  font-size: 1.1rem;
  color: #000000;
  font-weight: 500;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
  animation: subtitle-fade 1s ease-in-out;
}

@keyframes subtitle-fade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Universities Container */
.universities-modern-container {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 0;
}

/* Carousel Layout */
.universities-grid {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  padding: 0 20px;
  min-height: 500px;
  position: relative;
}

/* University Card */
.uni-card {
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: absolute;
  width: 400px;
  opacity: 0;
  pointer-events: none;
}

/* Center Card - Main Focus */
.uni-card.center {
  opacity: 1;
  transform: translateX(0) scale(1);
  z-index: 10;
  pointer-events: auto;
  box-shadow: 0 20px 60px rgba(206, 17, 38, 0.2);
}

/* Left Card - Blurred */
.uni-card.left {
  opacity: 0.6;
  transform: translateX(-450px) scale(0.85);
  filter: blur(2px);
  z-index: 5;
}

/* Right Card - Blurred */
.uni-card.right {
  opacity: 0.6;
  transform: translateX(450px) scale(0.85);
  filter: blur(2px);
  z-index: 5;
}

/* Far Left - Hidden */
.uni-card.far-left {
  opacity: 0;
  transform: translateX(-900px) scale(0.7);
  filter: blur(4px);
  z-index: 1;
}

/* Far Right - Hidden */
.uni-card.far-right {
  opacity: 0;
  transform: translateX(900px) scale(0.7);
  filter: blur(4px);
  z-index: 1;
}

.uni-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(206, 17, 38, 0.1), transparent 70%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  z-index: 1;
}

.uni-card:hover::before {
  opacity: 1;
  animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.2); opacity: 0.8; }
}

.uni-card:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 
    0 20px 60px rgba(206, 17, 38, 0.2),
    0 0 0 1px rgba(206, 17, 38, 0.1);
}

.uni-card:hover .uni-card-image img {
  transform: scale(1.15);
  filter: brightness(1.1);
}

.uni-card:hover .uni-card-image::before {
  opacity: 1;
}

/* Card Image */
.uni-card-image {
  position: relative;
  height: 240px;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.uni-card-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(206, 17, 38, 0.3), rgba(102, 126, 234, 0.3));
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 1;
  mix-blend-mode: multiply;
}

.uni-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  filter: blur(0px) brightness(1);
}

.uni-card:hover .uni-card-image img {
  filter: blur(0px) brightness(1.1);
}

.uni-card-image::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
  pointer-events: none;
  z-index: 2;
  transition: height 0.5s ease;
}

.uni-card:hover .uni-card-image::after {
  height: 100px;
  background: linear-gradient(to top, rgba(206, 17, 38, 0.4), transparent);
}

/* Card Badge */
.uni-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(206, 17, 38, 0.95);
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  backdrop-filter: blur(10px);
  z-index: 3;
  box-shadow: 0 4px 12px rgba(206, 17, 38, 0.4);
  animation: badge-float 3s ease-in-out infinite;
}

@keyframes badge-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* Card Content */
.uni-card-content {
  padding: 24px;
  position: relative;
  z-index: 2;
  transition: all 0.4s ease;
}

.uni-card:hover .uni-card-content {
  transform: translateY(-5px);
}

.uni-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 12px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.3s ease;
}

.uni-card:hover .uni-card-title {
  color: #ce1126;
}

.uni-card-desc {
  font-size: 0.95rem;
  color: #6b7280;
  margin: 0 0 20px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.3s ease;
}

.uni-card:hover .uni-card-desc {
  color: #4b5563;
}

/* Card Footer */
.uni-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
  transition: border-color 0.3s ease;
}

.uni-card:hover .uni-card-footer {
  border-top-color: rgba(206, 17, 38, 0.2);
}

.uni-link {
  color: #ce1126;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
  position: relative;
}

.uni-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #ce1126;
  transition: width 0.3s ease;
}

.uni-link:hover {
  color: #a00d1e;
  gap: 10px;
}

.uni-link:hover::after {
  width: 100%;
}

.uni-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #f59e0b;
  font-size: 0.85rem;
  font-weight: 600;
  transition: transform 0.3s ease;
}

.uni-card:hover .uni-rating {
  transform: scale(1.1);
}

.uni-rating i {
  filter: drop-shadow(0 0 4px #f59e0b);
  animation: star-twinkle 2s ease-in-out infinite;
}

@keyframes star-twinkle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Navigation Buttons */
.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: white;
  border: 2px solid #e5e7eb;
  color: #1a1a2e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.nav-btn:hover {
  background: #ce1126;
  color: white;
  border-color: #ce1126;
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 6px 20px rgba(206, 17, 38, 0.3);
}

.nav-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.nav-prev {
  right: 10px;
}

.nav-next {
  left: 10px;
}

/* Navigation Dots */
.nav-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 40px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d1d5db;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.dot:hover {
  background: #9ca3af;
  transform: scale(1.2);
}

.dot.active {
  width: 32px;
  border-radius: 5px;
  background: #ce1126;
}

.dot.active::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 8px;
  border: 2px solid rgba(206, 17, 38, 0.3);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .universities-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 60px;
    gap: 24px;
  }

  .section-title-modern {
    font-size: 2rem;
  }

  .uni-card-image {
    height: 200px;
  }
}

@media (max-width: 768px) {
  .modern-universities-section {
    padding: 60px 0;
  }

  .universities-grid {
    grid-template-columns: 1fr;
    padding: 0 20px;
    gap: 20px;
  }

  .section-title-modern {
    font-size: 1.75rem;
  }

  .section-subtitle-modern {
    font-size: 1rem;
  }

  .nav-btn {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .nav-prev {
    right: 5px;
  }

  .nav-next {
    left: 5px;
  }

  .uni-card-image {
    height: 180px;
  }
}

/* Smooth Animations */
.universities-grid.transitioning {
  opacity: 0.7;
  pointer-events: none;
}

/* Loading State */
.uni-card.loading {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Light mode (default) - Explicit styles */
html:not([data-theme="dark"]) .section-tag {
  color: #000000 !important;
  background: linear-gradient(135deg, rgba(206, 17, 38, 0.15), rgba(206, 17, 38, 0.08));
  border-color: rgba(206, 17, 38, 0.3);
}

html:not([data-theme="dark"]) .section-title-modern {
  color: #000000 !important;
}

html:not([data-theme="dark"]) .section-subtitle-modern {
  color: #000000 !important;
}

html:not([data-theme="dark"]) .uni-card {
  background: #ffffff !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

html:not([data-theme="dark"]) .uni-card.center {
  box-shadow: 0 20px 60px rgba(206, 17, 38, 0.2);
}

html:not([data-theme="dark"]) .uni-card-title {
  color: #1a1a2e !important;
}

html:not([data-theme="dark"]) .uni-card-desc {
  color: #6b7280 !important;
}

html:not([data-theme="dark"]) .uni-card-footer {
  border-top-color: #e5e7eb;
}

html:not([data-theme="dark"]) .uni-link {
  color: #ce1126;
}

html:not([data-theme="dark"]) .nav-btn {
  background: white;
  border-color: #e5e7eb;
  color: #1a1a2e;
}

html:not([data-theme="dark"]) .nav-btn:hover {
  background: #ce1126;
  color: white;
  border-color: #ce1126;
}

/* Dark mode support */
html[data-theme="dark"] .modern-universities-section {
  background: linear-gradient(180deg, #1a1a2e 0%, #0f172a 50%, #1a1a2e 100%) !important;
}

html[data-theme="dark"] .section-tag {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(206, 17, 38, 0.3), rgba(206, 17, 38, 0.15));
  border-color: rgba(206, 17, 38, 0.5);
}

html[data-theme="dark"] .section-title-modern {
  color: #ffffff !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .section-subtitle-modern {
  color: #e5e7eb;
}

html[data-theme="dark"] .uni-card {
  background: #1e293b !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .uni-card-title {
  color: #ffffff !important;
}

html[data-theme="dark"] .uni-card-desc {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .uni-card-footer {
  border-top-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .uni-link {
  color: #fca5a5;
}

html[data-theme="dark"] .nav-btn {
  background: #1e293b;
  border-color: #334155;
  color: #ffffff;
}

html[data-theme="dark"] .nav-btn:hover {
  background: #ce1126;
  border-color: #ce1126;
}

html[data-theme="dark"] .dot {
  background: #475569;
}

html[data-theme="dark"] .dot:hover {
  background: #64748b;
}

html[data-theme="dark"] .dot.active {
  background: #ce1126;
}

/* Dark mode support (optional, OS preference) */
@media (prefers-color-scheme: dark) {
  .modern-universities-section {
    background: linear-gradient(180deg, #1a1a2e 0%, #0f172a 50%, #1a1a2e 100%);
  }
  
  .section-tag {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(206, 17, 38, 0.3), rgba(206, 17, 38, 0.15));
    border-color: rgba(206, 17, 38, 0.5);
  }
  
  .section-title-modern {
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  }

  .section-subtitle-modern {
    color: #e5e7eb;
  }

  .uni-card {
    background: #1e293b;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  }

  .uni-card-title {
    color: #ffffff;
  }

  .uni-card-desc {
    color: #9ca3af;
  }

  .nav-btn {
    background: #1e293b;
    border-color: #334155;
    color: #ffffff;
  }
}
