/* --- 1. MODERN VARIABLES --- */
:root {
    /* Brand Gradient */
    --brand-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%); /* Indigo to Purple */
    --brand-color: #6366f1;
    --accent-color: #06b6d4; /* Cyan */
    
    /* Backgrounds */
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.85);
    
    /* Text */
    --text-main: #1e293b;
    --text-muted: #64748b;
    
    /* Effects */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --hover-transform: translateY(-5px);
}

/* --- 2. GLOBAL TYPOGRAPHY --- */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    padding-top: 80px;
}

h1, h2, h3, h4, h5, h6, .navbar-brand, .btn {
    font-family: 'Poppins', sans-serif;
    color: #0f172a;
}

a { text-decoration: none; color: inherit; transition: color 0.2s; }

/* --- 3. GLASSMORPHISM NAVBAR --- */
.navbar {
    position: fixed;           /* 1. Fix it to the viewport */
    top: 0;                    /* 2. Stick to the top */
    width: 100%;               /* 3. Span full width */
    z-index: 1030;             /* 4. Ensure it sits above everything (Bootstrap standard is 1030) */
    
    background: rgba(15, 23, 42, 0.95) !important; /* 5. More transparency for better blur */
    backdrop-filter: blur(12px);                   /* 6. The Blur Effect */
    -webkit-backdrop-filter: blur(12px);           /* 7. Safari Support */
    
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.5rem;
    background: var(--brand-gradient);
    
    /* Standard property */
    background-clip: text;
    
    /* Vendor prefixes for compatibility */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    
    /* Fallback for browsers that don't support clipping */
    color: transparent; 
}

.nav-link {
    font-weight: 500;
    font-size: 0.95rem;
    color: #cbd5e1 !important;
    position: relative;
}

.nav-link:hover, .nav-link.active {
    color: #fff !important;
}

/* CHANGED FROM ::after TO ::before TO AVOID DROPDOWN CONFLICT */
.nav-link::before {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--brand-color); /* This ensures it is BLUE/INDIGO */
    transition: width 0.3s ease-in-out;
    opacity: 0; /* Hidden by default */
}

/* Hover and Active States */
.nav-link:hover::before, 
.nav-link.active::before { 
    width: 100%; 
    opacity: 1;
}

/* --- 4. HERO SECTION (Modern Gradient) --- */
#home-hero {
    background: #fff;
    border-radius: 20px;
    padding: 5rem 2rem;
    margin-bottom: 4rem;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.05);
}

/* Subtle background decoration */
#home-hero::before {
    content: '';
    position: absolute;
    top: -50px; right: -50px;
    width: 300px; height: 300px;
    background: var(--brand-gradient);
    filter: blur(80px);
    opacity: 0.15;
    border-radius: 50%;
    z-index: 0;
}

#home-hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #1e293b, #6366f1);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    z-index: 1;
}

/* --- 5. INTERACTIVE CARDS --- */
.card {
    border: none;
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Bouncy transition */
    overflow: hidden;
}

.card:hover {
    transform: var(--hover-transform);
    box-shadow: var(--shadow-lg);
}

.card-img-top {
    height: 200px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card:hover .card-img-top {
    transform: scale(1.05); /* Image Zoom Effect */
}

.card-body { padding: 1.5rem; }

.card-title { font-weight: 700; font-size: 1.15rem; }

.badge {
    padding: 0.5em 1em;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- 6. BUTTONS (Glow & Gradient) --- */
.btn-primary {
    background: var(--brand-gradient);
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4); /* Glow effect */
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
    transform: translateY(-2px);
}

.btn-outline-secondary {
    border: 2px solid #e2e8f0;
    color: var(--text-main);
    border-radius: 8px;
    font-weight: 600;
}

.btn-outline-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}

/* --- 7. LIST GROUPS (Questions/Errors) --- */
.list-group-item {
    border: 1px solid #f1f5f9;
    margin-bottom: 0.5rem;
    border-radius: 8px !important;
    transition: all 0.2s ease;
}

.list-group-item:hover {
    background-color: #f8fafc;
    border-color: var(--brand-color);
    transform: translateX(5px); /* Slide right effect */
}

/* --- 8. CODE BLOCKS --- */
pre {
    border-radius: 12px;
    margin: 1.5rem 0;
    box-shadow: var(--shadow-md);
    background: #282c34 !important; /* Atom One Dark bg */
}

/* --- 9. ANIMATIONS (Entrance) --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Class to apply via JS */
.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* --- 10. FOOTER --- */
footer {
    background: #0f172a !important;
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-top: 5rem;
}



/* courses tab hover on navbar*/
@media (min-width: 992px) {
    /* 1. Target the list item */
    .nav-item.dropdown:hover .dropdown-menu {
        display: block !important; /* Force visibility */
        margin-top: 0; /* Remove the gap that kills the hover state */
        visibility: visible;
        opacity: 1;
    }

    /* 2. Create a "bridge" so the menu doesn't disappear when moving the mouse down */
    .dropdown-menu {
        border-top: 10px solid transparent; 
        background-clip: padding-box;
    }
}


/* social links */
.social-links a {
    transition: transform 0.2s ease-in-out, color 0.2s ease-in-out;
    display: inline-block; /* Required for transform to work */
}

.social-links a:hover {
    transform: scale(1.2);
}

/* Optional: Individual brand colors on hover */
.social-links a:hover .bi-facebook { color: #428ef1; }
.social-links a:hover .bi-instagram { color: hsl(0, 81%, 61%); }
.social-links a:hover .bi-youtube { color: #f72d2d; }
.social-links a:hover .bi-github { color: #6e5494; }

/* --- Navigation Hover Fix --- */
@media (min-width: 992px) {
    #courses-hover-wrapper:hover > .dropdown-menu {
        display: block !important;
        opacity: 1;
        visibility: visible;
        margin-top: 0;
    }

    /* Bridge to prevent flickering */
    #courses-hover-wrapper .dropdown-menu::before {
        content: "";
        position: absolute;
        top: -10px;
        left: 0;
        width: 100%;
        height: 10px;
        background: transparent;
    }
}

/* Ensure parent remains blue/indigo on hover */
#courses-hover-wrapper:hover > .nav-link {
    color: var(--brand-color) !important; 
}

/* Footer Legal Links Hover Effect */
footer a.text-decoration-none {
    transition: color 0.3s ease; /* Smooth color transition */
}

footer a.text-decoration-none:hover {
    color: var(--brand-color) !important; /* Changes to Indigo/Purple on hover */
    text-shadow: 0 0 8px rgba(99, 102, 241, 0.3); /* Subtle glow effect */
}