:root {
    /* New Color Scheme: Maroon/Gold */
    --primary-color: #8E241F;
    /* MSI Academic Maroon */
    --accent-color: #F5C48A;
    /* Creamy Gold */
    --text-color: #222222;
    /* Charcoal Black */
    --bg-color: #FFFFFF;
    /* Crisp White */
    --light-bg: #F9F9F9;
    /* Off-White */
    --dark-bg: #8E241F;
    /* Maroon for dark sections */
    --secondary-text: #555555;

    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;

    --container-width: 1200px;
    --header-height: 80px;

    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12);
}

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    box-shadow: var(--shadow-lg);
    border-radius: 4px;
    min-width: 250px;
    padding: 10px 0;
    z-index: 1000;
}

.dropdown:hover .dropdown-menu {
    display: block;
    animation: fadeIn 0.2s ease;
}

.dropdown-menu li {
    width: 100%;
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: var(--text-color);
    font-size: 0.9rem;
    transition: background 0.2s;
}

.dropdown-menu a:hover {
    background-color: var(--light-bg);
    color: var(--primary-color);
}

/* Page Header (for sub-pages) */
.page-header {
    background-color: var(--primary-color);
    color: white;
    padding: 120px 0 60px;
    /* Top padding accounts for fixed header */
    text-align: center;
}

.page-title {
    font-size: 3rem;
    margin-bottom: 10px;
    color: var(--accent-color);
}

.page-subtitle {
    font-size: 1.2rem;
    color: #e0e0e0;
}

/* Detailed Course Cards (courses.html) */
.course-detailed-card {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    margin-bottom: 40px;
    overflow: hidden;
    border: 1px solid #eee;
}

.course-header {
    background-color: var(--primary-color);
    color: white;
    padding: 20px 30px;
}

.course-header h2 {
    color: white;
    font-size: 1.5rem;
    margin: 0;
}

.course-body {
    padding: 30px;
}

.course-features-list {
    margin: 20px 0 30px;
    list-style: none;
}

.course-features-list li {
    padding-left: 25px;
    position: relative;
    margin-bottom: 10px;
}

.course-features-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography Utilities */
.section-title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--secondary-text);
    text-align: center;
    margin-bottom: 3rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 28px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    border: 2px solid transparent;
}

.btn-primary {
    background-color: var(--accent-color);
    color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #bfa130;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    border-color: var(--light-bg);
    color: var(--light-bg);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Header */
.header {
    background-color: var(--light-bg);
    box-shadow: var(--shadow-sm);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-link {
    font-weight: 500;
    color: var(--primary-color);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

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

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 5px 0;
    transition: 0.3s;
}

.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.popup-box {
  background: #fff;
  padding: 30px;
  width: 90%;
  max-width: 420px;
  border-radius: 12px;
  position: relative;
  text-align: center;
  animation: popupFade 0.3s ease;
}

@keyframes popupFade {
  from { transform: scale(0.8); opacity:0; }
  to { transform: scale(1); opacity:1; }
}

.popup-box h2 {
  margin-bottom: 15px;
  color: #8E241F;
}

.popup-box input,
.popup-box textarea {
  width: 100%;
  padding: 12px;
  margin-bottom: 12px;
  border-radius: 8px;
  border: 1px solid #ddd;
}

.popup-box button {
  width: 100%;
  padding: 12px;
  background: #8E241F;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.close-btn {
  position: absolute;
  right: 15px;
  top: 10px;
  font-size: 22px;
  cursor: pointer;
}


/* Hero Carousel */
.hero-carousel {
    height: 60vh;
    position: relative;
    background-color: var(--primary-color);
    margin-top: var(--header-height);
    overflow: hidden;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slide.active {
    opacity: 1;
}

.hero-overlay {
    background: rgba(27, 38, 49, 0.7);
    /* Dark overlay */
    padding: 20px;
    border-radius: 8px;
    /* Removed blur for clarity */
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* Carousel Controls */
.carousel-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 10;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s;
}

.carousel-dot.active {
    background-color: var(--accent-color);
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    border: none;
    font-size: 2rem;
    padding: 10px 15px;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s;
}

.carousel-btn:hover {
    background: rgba(0, 0, 0, 0.6);
}

.prev-btn {
    left: 20px;
}

.next-btn {
    right: 20px;
}


/* Reused Hero Content Styles */
.hero-content {
    max-width: 800px;
    text-align: center;
    z-index: 2;
    position: relative;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 20px;
    color: var(--accent-color);
    /* Silver text on dark overlay */
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 40px;
    color: white;
}

.hero-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #2c3e50;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-secondary:hover {
    background-color: rgba(27, 38, 49, 0.05);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: white;
    padding: 40px;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close-modal:hover {
    color: var(--text-color);
}

.modal-title {
    margin-bottom: 20px;
    text-align: center;
    color: var(--primary-color);
}

.auth-switch {
    margin-top: 20px;
    text-align: center;
    font-size: 0.9rem;
}

.auth-switch a {
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

/* Courses Section */
.courses-section {
    padding: 80px 0;
    background-color: var(--bg-color);
}

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

.course-card {
    background: var(--light-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.course-image-wrapper {
    height: 200px;
    background-color: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-weight: bold;
}

.course-placeholder-img {
    width: 100%;
    height: 100%;
    background-color: #eee;
    /* Fallback */
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    background: linear-gradient(45deg, #1c2e4a, #0a192f);
    color: rgba(255, 255, 255, 0.2);
}

.course-content {
    padding: 25px;
}

.course-title {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.course-desc {
    color: var(--secondary-text);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.course-features {
    margin-bottom: 20px;
    padding-left: 20px;
}

.course-features li {
    list-style-type: disc;
    margin-bottom: 5px;
    color: var(--text-color);
    font-size: 0.9rem;
}

.course-action {
    text-align: center;
}

/* About Section */
.about-section {
    padding: 80px 0;
    background-color: white;
}

.about-content {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.about-content p {
    font-size: 1.1rem;
    margin-bottom: 40px;
    color: var(--secondary-text);
}

.stats-grid {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 30px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-color);
    font-family: var(--font-heading);
}

.stat-label {
    font-size: 1rem;
    color: var(--primary-color);
    font-weight: 500;
}

/* Contact Section */
.contact-section {
    padding: 80px 0;
    background-color: var(--dark-bg);
    color: white;
}

.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.contact-info .section-title {
    text-align: left;
    color: var(--accent-color);
}

.contact-info p {
    color: #cfcfcf;
    margin-bottom: 30px;
}

.contact-details p {
    margin-bottom: 15px;
    color: white;
}

.contact-form-wrapper {
    background: rgba(255, 255, 255, 0.05);
    padding: 40px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #e0e0e0;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: white;
    font-family: var(--font-body);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.block-btn {
    width: 100%;
    border: none;
}

/* Footer */
.footer {
    background-color: #050d1a;
    color: #8892b0;
    padding: 40px 0;
    text-align: center;
}

.footer-logo {
    margin-bottom: 20px;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: white;
}

.footer-links {
    margin-bottom: 20px;
}

.footer-links a {
    margin: 0 15px;
    color: #8892b0;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--accent-color);
}

.copyright {
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        padding: 0 15px;
    }

    .mobile-toggle {
        display: block;
        z-index: 1001;
    }

    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background-color: var(--light-bg);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transition: 0.3s ease-in-out;
        padding-top: 100px;
    }

    .nav.active {
        right: 0;
    }

    .nav-list {
        flex-direction: column;
        align-items: center;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .contact-container {
        grid-template-columns: 1fr;
    }
}