:root {
    --primary-color: #0A1E40;
    /* Navy Blue */
    --secondary-color: #3E8BFF;
    /* Sky Blue */
    --text-color: #333;
    --bg-color: #FFFFFF;
    --light-bg: #f4f7f6;
    --white: #FFFFFF;
    --font-main: 'Montserrat', sans-serif;
    --font-heading: 'Poppins', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border_box;
}

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

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

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

ul {
    list-style: none;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

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

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

.btn-outline {
    border: 2px solid var(--white);
    color: var(--white);
    background: transparent;
}

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

/* Header */
header {
    background-color: rgba(10, 30, 64, 0.95);
    /* Semi-transparent Primary Color */
    backdrop-filter: blur(10px);
    /* Glassmorphism */
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100000;
    /* Ensure header is above EVERYTHING including chatbot */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    /* Softer shadow */
    transition: all 0.3s ease;
}

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

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--white);
    letter-spacing: -0.5px;
    text-transform: uppercase;
}

.logo span {
    color: var(--secondary-color);
}

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

nav a {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding: 5px 0;
}

nav a:hover,
nav a.active {
    color: var(--white);
}

/* User Avatar Styles */
.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--secondary-color);
    color: var(--white);
    font-weight: 700;
    text-transform: uppercase;
    font-family: var(--font-heading);
}

.user-avatar.desktop {
    width: 25px;
    height: 25px;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-avatar.mobile {
    width: 35px;
    height: 35px;
    font-size: 1.2rem;
    background-color: var(--white);
    color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Nav Link Underline Animation */
nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--secondary-color);
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

/* Button override for nav */
nav .btn {
    padding: 10px 25px;
    font-size: 0.9rem;
    border-radius: 50px;
    /* Pillow shape */
}

/* Specific style for Outline Button in darker header */
header .btn-outline {
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
    font-weight: 600;
}

header .btn-outline:hover {
    background-color: var(--secondary-color);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(62, 139, 255, 0.4);
    /* Glow effect */
}

/* Remove underline animation for buttons */
nav a.btn::after {
    display: none;
}

.mobile-menu-btn,
.mobile-user-icon {
    display: none;
}

.mobile-menu-btn {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--white);
}

/* Desktop User Dropdown Styles (MUST be outside mobile media query) */
.user-dropdown-container {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 160px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    z-index: 100002;
    border: 1px solid #f0f0f0;
}

.dropdown-menu.active {
    display: block;
    animation: fadeInDropdown 0.2s ease;
}

.dropdown-menu a {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    color: var(--text-color) !important;
    text-decoration: none;
    font-size: 0.9rem;
    border-bottom: 1px solid #f9f9f9;
    transition: background 0.2s;
    justify-content: flex-start !important;
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown-menu a:hover {
    background-color: #f4f7f6;
    color: var(--secondary-color) !important;
}

.dropdown-menu i {
    width: 20px;
    text-align: center;
    color: var(--secondary-color);
}

.desktop-dropdown {
    top: 120%;
    right: 0;
}

/* Desktop Hover Support */
@media (min-width: 769px) {

    .desktop-user-menu:hover .desktop-dropdown,
    .desktop-dropdown:hover {
        display: block !important;
        animation: fadeInDropdown 0.2s ease;
    }
}

@keyframes fadeInDropdown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

/* Footer */
footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 50px 0 20px;
    margin-top: 50px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3 {
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    font-size: 0.9rem;
}

/* =========================================
   RESPONSIVE DESIGN & MOBILE OPTIMIZATION
   ========================================= */

/* Global Responsive Fixes */
img {
    max-width: 100%;
    height: auto;
    display: block;
    /* Removes bottom spacing */
}

.container {
    width: 92%;
    /* Slightly wider on mobile */
    padding: 0 15px;
}

/* Tablet & Mobile Breakpoint */
@media (max-width: 768px) {

    /* Typography */
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    p {
        font-size: 0.95rem;
    }

    /* Header & Navigation */
    header {
        padding: 10px 0;
    }

    /* Mobile Header Layout: Menu - Logo - User */
    header .container {
        display: grid;
        grid-template-columns: 40px 1fr 40px;
        /* Left - Center - Right */
        align-items: center;
    }

    .mobile-menu-btn {
        display: block;
        font-size: 1.5rem;
        grid-column: 1;
        justify-self: start;
    }

    .logo {
        grid-column: 2;
        justify-self: center;
        font-size: 1.5rem;
        text-align: center;
    }

    .mobile-user-icon {
        display: block;
        grid-column: 3;
        justify-self: end;
        color: var(--white);
    }

    .mobile-user-icon a {
        color: var(--white);
    }

    nav {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        z-index: 10001;
        /* Ensure menu is above chatbot (z-index 9999) */
    }

    nav ul {
        display: none;
        /* Hidden by default */
        flex-direction: column;
        width: 100%;
        background-color: var(--primary-color);
        padding: 20px 0;
        text-align: center;
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        animation: slideDown 0.3s ease forwards;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

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

    nav ul.active {
        display: flex;
    }

    nav ul li {
        margin: 10px 0;
        width: 100%;
    }

    nav a {
        display: block;
        padding: 10px;
        font-size: 1.1rem;
    }

    nav .btn {
        display: inline-block;
        /* Keep buttons looking like buttons */
        width: auto;
        margin-top: 10px;
    }

    /* Hide User/Login in Mobile Menu since it's in header now */
    nav ul li:last-child {
        display: none;
    }

    /* Layout Adjustments */
    .row {
        flex-direction: column !important;
        /* Force stack */
        gap: 30px;
    }

    .col {
        width: 100%;
        min-width: 100%;
    }

    /* Flex Direction Reversals (e.g. Text then Image on mobile) */
    .row[style*="row-reverse"] {
        flex-direction: column-reverse !important;
    }

    /* Filters (Courses Page): Mobile Dropdown */
    .mobile-filter-wrapper {
        display: block;
        /* Show on mobile */
        position: relative;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .mobile-filter-select {
        width: 100%;
        padding: 12px 15px;
        font-size: 1rem;
        border: 1px solid #ddd;
        border-radius: 8px;
        background-color: white;
        appearance: none;
        /* Remove default arrow */
        -webkit-appearance: none;
        color: var(--text-color);
        font-family: var(--font-main);
        cursor: pointer;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    }

    .mobile-filter-wrapper .filter-icon {
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        pointer-events: none;
        color: var(--primary-color);
    }

    /* Hide Desktop Filters on Mobile */
    .filters.desktop-filters {
        display: none !important;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        /* Stack footer columns */
        text-align: center;
    }

    .social-icons {
        justify-content: center;
    }

    /* Chatbot - Force Overide of JS Styles */
    #zup-chatbot {
        bottom: 100px !important;
        /* Force above 65px Nav */
        right: 20px !important;
        z-index: 9998 !important;
        /* Slightly below Bottom Nav (9999) if they overlap */
    }

    .chat-window {
        width: 90%;
        /* Fullish width */
        right: 5%;
        bottom: 110px;
        height: 60vh;
    }
}

/* Small Mobile Breakpoint */
@media (max-width: 480px) {
    h1 {
        font-size: 1.75rem;
    }

    .hero {
        padding: 100px 0 60px;
    }

    .hero-btns {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    /* Hero Buttons Fix */
    .hero-btns {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .hero-btns .btn {
        margin: 5px !important;
        flex: 1 1 auto;
        /* Grow to fill */
        min-width: 120px;
        /* Reducing min-width slightly to allow 2 per row */
        text-align: center;
        padding: 12px 10px;
        font-size: 0.85rem;
        width: auto;
        /* Let flex handle width */
    }

    /* Fixed Logo Size */
    .logo {
        font-size: 1.5rem;
    }

    /* Services: 2 Cards per Row */
    .services-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }

    .service-card {
        padding: 20px !important;
    }

    .service-card i {
        font-size: 2rem !important;
    }

    .service-card h3 {
        font-size: 1rem !important;
    }

    .service-card p {
        font-size: 0.8rem !important;
    }

    /* Why Choose Us: Horizontal Auto-Scroll */
    .features-grid {
        display: flex !important;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 15px !important;
        padding-bottom: 20px;
        -webkit-overflow-scrolling: touch;
        /* Hide scrollbar for cleaner look */
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .features-grid::-webkit-scrollbar {
        display: none;
    }

    .features-grid .feature-item {
        min-width: 160px;
        /* Consistent width */
        scroll-snap-align: center;
        /* Center snap */
        background: #f9f9f9;
        padding: 20px;
        border-radius: 10px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
        flex-shrink: 0;
        /* Prevent shrinking */
    }

    /* Testimonials: Horizontal Snap Scroll */
    .testimonials-grid {
        display: flex !important;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 20px !important;
        padding-bottom: 20px;
        -webkit-overflow-scrolling: touch;
        /* Smooth scroll iOS */
    }

    /* Hide scrollbar but keep functionality */
    .testimonials-grid::-webkit-scrollbar {
        height: 6px;
    }

    .testimonials-grid::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.1);
        border-radius: 10px;
    }

    .testimonial-card {
        min-width: 85vw;
        /* Almost full width */
        scroll-snap-align: center;
        margin-right: 0;
    }

    /* Footer Fixes */
    .footer-content {
        display: flex;
        flex-direction: column;
        gap: 30px;
        text-align: center;
    }

    .footer-bottom {
        padding-bottom: 80px;
        /* Extra space for bottom nav */
    }
}

/* =========================================
   BOTTOM NAVIGATION (Mobile/Tablet Only)
   ========================================= */
.bottom-nav {
    display: none;
    /* Hidden on Desktop */
}

@media (max-width: 768px) {
    body {
        padding-bottom: 80px;
        /* Prevent content from hiding behind nav */
    }

    .bottom-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 65px;
        background-color: var(--white);
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        z-index: 9999;
        /* Ensure on top */
        border-top: 1px solid #f0f0f0;
        /* Safe Area for iPhone X+ */
        padding-bottom: env(safe-area-inset-bottom);
        height: calc(65px + env(safe-area-inset-bottom));
    }

    .bottom-nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: #888;
        font-size: 0.75rem;
        flex: 1;
        height: 100%;
        transition: all 0.3s ease;
    }

    .bottom-nav a i {
        font-size: 1.4rem;
        margin-bottom: 4px;
        transition: transform 0.2s;
    }

    .bottom-nav a.active,
    .bottom-nav a:hover {
        color: var(--secondary-color);
    }

    .bottom-nav a.active i {
        transform: translateY(-2px);
    }

    /* Mobile User Dropdown Positioning */
    .mobile-dropdown {
        top: 45px;
        right: 0;
        min-width: 150px;
    }

    .user-icon-toggle {
        cursor: pointer;
    }
}