/* ===== CSS VARIABLES & THEME ===== */
:root {
  --primary-color: #164863;
  --secondary-color: #427D9D;
  --accent-color: #9B5DE5;
  --light-bg: #f9f9f9;
  --dark-bg: #1a1a1a;
  --text-dark: #333;
  --text-light: #fff;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ===== GLOBAL STYLES ===== */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--light-bg);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ===== PRELOADER ===== */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#preloader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.preloader-content {
  text-align: center;
  color: white;
}

.preloader-logo {
  width: 80px;
  height: 80px;
  animation: pulse 1.5s infinite ease-in-out;
  margin-bottom: 20px;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== NAVBAR GLASSMORPHISM ===== */
.navbar {
  transition: all var(--transition-normal);
  backdrop-filter: blur(0px);
  background: rgba(33, 37, 41, 0.95) !important;
}

.navbar.scrolled {
  backdrop-filter: blur(10px);
  background: rgba(33, 37, 41, 0.85) !important;
  box-shadow: var(--shadow-md);
  padding: 0.5rem 0;
}

.navbar-brand img {
  transition: transform var(--transition-fast);
}

.navbar-brand:hover img {
  transform: scale(1.1) rotate(5deg);
}

.nav-link {
  position: relative;
  transition: color var(--transition-fast);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-color), var(--secondary-color));
  transition: all var(--transition-normal);
  transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 80%;
}

/* ===== HERO CAROUSEL ===== */
#heroCarousel {
  background-color: rgba(0, 0, 0, 0.5);
}

.carousel-item {
  height: 70vh;
  position: relative;
  overflow: hidden;
}

.carousel-item img {
  height: 100%;
  object-fit: cover;
  width: 100%;
  transition: transform 6s ease;
}

/* Ken Burns effect - subtle zoom */
.carousel-item.active img {
  animation: kenBurns 6s ease-in-out forwards;
}

@keyframes kenBurns {
  0% { transform: scale(1); }
  100% { transform: scale(1.1); }
}

.carousel-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.5) 40%, rgba(0,0,0,0.9) 100%);
  z-index: 1;
  pointer-events: none;
}

.carousel-caption {
  position: absolute;
  z-index: 2;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(5px);
  padding: 30px 40px;
  border-radius: 15px;
  bottom: 20%;
  left: 50%;
  transform: translateX(-50%);
  max-width: 85%;
  text-align: center;
  opacity: 0;
  transform: translateX(-50%) translateY(30px);
  transition: all 0.8s ease;
}

.carousel-item.active .carousel-caption {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.carousel-caption h1 {
  font-weight: 700;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
  background: linear-gradient(90deg, #fff, #e0e0e0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.carousel-caption p {
  font-size: 1.2rem;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5);
}

/* Carousel progress bar */
.carousel-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-color), var(--secondary-color));
  z-index: 3;
  transition: width 0.1s linear;
}

/* ===== BUTTONS ===== */
.btn {
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
  border-radius: 50px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:active::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border: none;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--shadow-md);
  background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
}

.btn-outline-light:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
}

.btn-lg {
  padding: 12px 30px;
}

/* ===== CARDS ===== */
.card {
  border: none;
  border-radius: 16px;
  overflow: hidden;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.card:hover {
  transform: translateY(-12px);
  box-shadow: var(--shadow-lg);
}

.card-img-top {
  height: 250px;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.card:hover .card-img-top {
  transform: scale(1.1);
}

.card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.7) 100%);
  opacity: 0;
  transition: opacity var(--transition-normal);
  pointer-events: none;
}

.card:hover::after {
  opacity: 1;
}

.card-body {
  position: relative;
  z-index: 1;
}

.program-card {
  cursor: pointer;
  position: relative;
}

.program-card .card-body::before {
  content: 'Learn More';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: var(--accent-color);
  color: white;
  padding: 10px 20px;
  border-radius: 25px;
  font-weight: 600;
  opacity: 0;
  transition: all var(--transition-normal);
  z-index: 10;
  white-space: nowrap;
}

.program-card:hover .card-body::before {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

/* ===== SECTIONS ===== */
section {
  position: relative;
}

.py-5 {
  padding-top: 5rem !important;
  padding-bottom: 5rem !important;
}

/* ===== CTA SECTION WITH PARALLAX ===== */
section[style*="background-image"] {
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  position: relative;
}

section[style*="background-image"]::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(22, 72, 99, 0.9), rgba(66, 125, 157, 0.8));
  z-index: 0;
}

section[style*="background-image"] .container {
  position: relative;
  z-index: 1;
}

/* ===== TYPOGRAPHY ENHANCEMENTS ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: -0.5px;
}

.lead {
  font-size: 1.2rem;
  line-height: 1.8;
  color: #555;
}

/* Gradient text effect */
.gradient-text {
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== AOS ANIMATION ENHANCEMENTS ===== */
[data-aos] {
  transition-duration: 0.8s;
}

[data-aos="fade-up"] {
  opacity: 0;
  transform: translateY(30px);
  transition-property: opacity, transform;
}

[data-aos="fade-up"].aos-animate {
  opacity: 1;
  transform: translateY(0);
}

[data-aos="fade-right"] {
  opacity: 0;
  transform: translateX(-30px);
}

[data-aos="fade-right"].aos-animate {
  opacity: 1;
  transform: translateX(0);
}

/* ===== FOOTER ===== */
footer {
  background: linear-gradient(135deg, var(--dark-bg), #2d2d2d) !important;
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 768px) {
  .carousel-caption {
    padding: 15px 20px;
    bottom: 15%;
    max-width: 90%;
  }
  
  .carousel-caption h1 {
    font-size: 1.5rem !important;
  }
  
  .carousel-caption p {
    font-size: 1rem !important;
  }
  
  .card-img-top {
    height: 200px;
  }
  
  .btn {
    padding: 8px 20px !important;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .carousel-caption {
    padding: 10px 15px;
    bottom: 12%;
  }
  
  .carousel-caption h1 {
    font-size: 1.2rem !important;
  }
  
  .carousel-caption .btn {
    font-size: 0.8rem !important;
    padding: 6px 12px !important;
  }
}

/* ===== SCROLLBAR STYLING ===== */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--light-bg);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}

/* ===== SELECTION HIGHLIGHT ===== */
::selection {
  background: var(--accent-color);
  color: white;
}

/* ===== FOCUS STATES FOR ACCESSIBILITY ===== */
.btn:focus,
.nav-link:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* ===== UTILITY CLASSES ===== */
.shadow-hover {
  transition: box-shadow var(--transition-normal);
}

.shadow-hover:hover {
  box-shadow: var(--shadow-lg);
}
