/* =========================================
   Global Variables (The Unified Theme)
   ========================================= */
:root {
    --primary-blue: #0067f6;
    --primary-hover: #0056b3;
    --dark-bg: #1e1e1e;
    --light-bg: #f8f9fa;
    --text-dark: #333333;
    --text-light: #ffffff;
    --border-color: #dddddd;
    --card-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* =========================================
   Global Reset & Base Styles
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--light-bg);
    color: var(--text-dark);
    line-height: 1.6;
}

/* =========================================
   Unified Navigation Bar (Used on ALL pages)
   ========================================= */
.navbar {
    background-color: var(--text-light);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 10px 30px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar img {
    height: 40px;
    margin-right: 10px;
}

/* The E-Learn Logo Text */
#logo-name1 { color: var(--text-dark); font-size: 1.5rem; font-weight: bold; }
#logo-name2 { color: var(--primary-blue); font-size: 1.5rem; font-weight: bold; margin-right: auto; }

/* Navbar Links */
.navbar a {
    color: var(--text-dark);
    text-decoration: none;
    margin: 0 15px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: var(--primary-blue);
}

/* Unified Buttons */
 .navbar button, input[type="submit"] {
    background-color: var(--primary-blue);
    color: var(--text-light);
    border: none;
    padding: 8px 20px;
    border-radius: 5%;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.btn:hover, .navbar button:hover, input[type="submit"]:hover {
    background-color: var(--primary-hover);
}

/* Red Logout Button override */
.logout-btn { background-color: #ff4d4d !important; }
.logout-btn:hover { background-color: #cc0000 !important; }
/* =========================================
   Profile Dropdown Menu
   ========================================= */
.nav-profile {
    position: relative;
    display: inline-block;
}

.profile-btn {
    font-size: 2.2rem;
    color: var(--primary-color, #0067f6);
    cursor: pointer;
    transition: transform 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
}


.profile-btn:hover {
    transform: scale(1.05);
    color: #0056b3;
}

.profile-dropdown {
    display: none; /* Hidden by default */
    position: absolute;
    right: 0;
    top: 120%; /* Pushes it just below the navbar */
    background-color: white;
    min-width: 220px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-radius: 8px;
    border: 1px solid #eee;
    z-index: 2000;
    overflow: hidden;
    animation: dropFadeIn 0.2s ease;
}

/* This class is added via JavaScript to show the menu */
.profile-dropdown.show {
    display: block; 
}

.dropdown-header {
    padding: 15px;
    background-color: #f8f9fa;
    text-align: left;
}

.dropdown-header strong {
    display: block;
    color: #333;
    font-size: 1rem;
}

.dropdown-header span {
    display: block;
    color: #777;
    font-size: 0.8rem;
    margin-top: 3px;
}

.profile-dropdown a {
    padding: 12px 15px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #444;
    font-size: 0.95rem;
    transition: background-color 0.2s;
}

.profile-dropdown a:hover {
    background-color: #f1f3f5;
    color: var(--primary-color, #0067f6);
}

.profile-dropdown hr {
    margin: 0;
    border: 0;
    border-top: 1px solid #eee;
}

.logout-link {
    color: #dc3545 !important; /* Red for destructive action */
}

.logout-link:hover {
    background-color: #fff5f5 !important;
}

/* Hide protected content by default (JS will show it if logged in) */
.protected-link {
    display: none;
}
@keyframes dropFadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.btn{
    background-color:greenyellow; 
    color: white;
    padding: 8px 20px;
    border-radius: 5px;
text-decoration: none;
}
/* ==========================================
   Hero Section Styles
   ========================================== */
.hero-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 80px 10%;
    min-height: calc(100vh - 70px); /* Adjusts height to fill screen below navbar */
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    gap: 40px;
}

.hero-content {
    flex: 1;
    max-width: 600px;
}

.hero-content h1 {
    font-size: 3.5rem;
    color: #2c3e50;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 35px;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 15px;
}

.hero-buttons .btn {
    padding: 14px 30px;
    font-size: 1.1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-btn {
    background-color: #4CAF50; /* A nice "success/go" green */
    color: white;
    border: none;
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(76, 175, 80, 0.4);
}

.secondary-btn {
    background-color: transparent;
    color: #2c3e50;
    border: 2px solid #2c3e50;
}

.secondary-btn:hover {
    background-color: #2c3e50;
    color: white;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

/* Make it responsive for smaller screens (like mobile phones) */
@media (max-width: 850px) {
    .hero-section {
        flex-direction: column;
        text-align: center;
        padding: 40px 5%;
        margin-top: 60px;
    }
    .hero-buttons {
        justify-content: center;
    }
    .hero-content h1 {
        font-size: 2.5rem;
    }
    .navbar {
        padding: 10px 15px;
    }
}
@media (max-width: 480px) {
    .navbar a {
        margin: 5px 10px;
        font-size: 0.9rem;
    }
    .hero-content h1 {
        font-size: 2rem;
    }
    .hero-buttons {
        flex-direction: column;
    }
    }

/* =============================================
   SPLASH SCREEN INTRO ANIMATION
   ============================================= */
.splash-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: transform 1s cubic-bezier(0.77, 0, 0.175, 1), opacity 0.6s ease;
}

.splash-overlay.splash-hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.splash-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.splash-logo {
  width: 120px;
  height: 120px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 103, 246, 0.15);
  opacity: 0;
  transform: scale(0.5);
  animation: splashLogoIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes splashLogoIn {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.splash-brand {
  font-size: 2.5rem;
  font-weight: 700;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 0;
  animation: splashFadeIn 0.6s ease 0.5s forwards;
}

.splash-brand-dark { color: #333; }
.splash-brand-blue { color: #0067f6; }

.splash-cursor {
  color: #0067f6;
  font-weight: 300;
  animation: cursorBlink 0.8s step-end infinite;
  margin-left: 4px;
}

@keyframes cursorBlink {
  50% { opacity: 0; }
}

.splash-tagline {
  font-size: 1rem;
  color: #777;
  letter-spacing: 3px;
  text-transform: uppercase;
  opacity: 0;
  animation: splashFadeIn 0.6s ease 0.8s forwards;
}

@keyframes splashFadeIn {
  to { opacity: 1; }
}

/* Splash exit animations */
.splash-overlay.splash-exit .splash-logo,
.splash-overlay.splash-exit .splash-brand,
.splash-overlay.splash-exit .splash-tagline {
  animation: splashFadeOut 0.8s ease forwards;
}

@keyframes splashFadeOut {
  to { opacity: 0; transform: scale(0.95); }
}

/* =============================================
   HERO ENTRANCE ANIMATION (Post-Splash)
   ============================================= */
.hero-content.hero-animate,
.hero-image.hero-animate {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.hero-content.hero-animate.hero-visible,
.hero-image.hero-animate.hero-visible {
  opacity: 1;
  transform: translateY(0);
}

.hero-image.hero-animate {
  transition-delay: 0.2s;
}

/* =============================================
   FEATURES SECTION
   ============================================= */
.features-section {
  padding: 100px 10%;
  background-color: #ffffff;
}

.features-container {
  max-width: 1200px;
  margin: 0 auto;
}

.features-header {
  text-align: center;
  margin-bottom: 60px;
}

.features-header h2 {
  font-size: 2.8rem;
  color: #2c3e50;
  margin-bottom: 15px;
  font-weight: 700;
}

.features-header h2 .highlight {
  color: #0067f6;
  position: relative;
}

.features-header h2 .highlight::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #0067f6, #4CAF50);
  border-radius: 2px;
  transform: scaleX(0.8);
}

.features-header p {
  font-size: 1.15rem;
  color: #666;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
}

.feature-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 16px;
  padding: 40px 30px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #0067f6, #4CAF50);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 103, 246, 0.08);
  border-color: #0067f6;
}

.feature-card:hover::before {
  transform: scaleX(1);
}

.feature-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #0067f6 0%, #4CAF50 100%);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  font-size: 1.5rem;
  color: white;
  box-shadow: 0 8px 20px rgba(0, 103, 246, 0.2);
}

.feature-card h3 {
  font-size: 1.3rem;
  color: #2c3e50;
  margin-bottom: 12px;
  font-weight: 600;
}

.feature-card p {
  font-size: 0.95rem;
  color: #666;
  line-height: 1.6;
}

/* =============================================
   SCROLL REVEAL ANIMATION SYSTEM
   ============================================= */
.scroll-reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children within grid */
.features-grid .feature-card.scroll-reveal:nth-child(1) { transition-delay: 0ms; }
.features-grid .feature-card.scroll-reveal:nth-child(2) { transition-delay: 100ms; }
.features-grid .feature-card.scroll-reveal:nth-child(3) { transition-delay: 200ms; }
.features-grid .feature-card.scroll-reveal:nth-child(4) { transition-delay: 0ms; }
.features-grid .feature-card.scroll-reveal:nth-child(5) { transition-delay: 100ms; }
.features-grid .feature-card.scroll-reveal:nth-child(6) { transition-delay: 200ms; }

/* Responsive */
@media (max-width: 850px) {
  .features-section {
    padding: 60px 5%;
  }
  .features-header h2 {
    font-size: 2rem;
  }
  .features-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .features-grid .feature-card.scroll-reveal {
    transition-delay: 0ms !important; /* No stagger on mobile */
  }
}

@media (prefers-reduced-motion: reduce) {
  .splash-overlay { display: none !important; }
  .hero-content.hero-animate,
  .hero-image.hero-animate,
  .scroll-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}