/* Header CSS for Examinex - Modern Refinements */

/* CSS Variables */
:root {
    --primary-color: #2563eb; /* Tailwind blue-600 */
    --secondary-color: #1e40af; /* Tailwind blue-800 */
    --accent-color: #3b82f6; /* Tailwind blue-500 */
    --text-color: #1f2937; /* Tailwind gray-900 */
    --light-bg: #f3f4f6; /* Tailwind gray-100 */
    --gradient: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Base Styles */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif; /* Example: Use a modern font */
    color: var(--text-color);
}

/* Loading Screen Styles */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%); /* Lighter, subtle gradient */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.7s ease-out, visibility 0.7s ease-out; /* Slightly longer transition */
}

#loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader {
    text-align: center;
}

.loading-logo {
    width: 180px; /* Slightly smaller */
    height: auto;
    animation: logoAnimation 2.2s ease-in-out infinite; /* Slower animation */
    filter: drop-shadow(0 4px 10px rgba(37, 99, 235, 0.3)); /* More prominent shadow */
}

@keyframes logoAnimation {
    0% { 
        transform: scale(0.95); /* Start slightly smaller */
        opacity: 0.8;
    }
    50% { 
        transform: scale(1.05); /* Go slightly larger */
        opacity: 1;
    }
    100% { 
        transform: scale(0.95);
        opacity: 0.8;
    }
}

/* Navigation Styles */
.navbar {
    background: #fff;
    padding: 0.8rem 0; /* Slightly reduced padding */
    position: fixed; /* Changed to fixed-top in HTML */
    top: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.02);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.03); /* Lighter shadow by default */
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98); /* Near opaque */
    backdrop-filter: blur(12px); /* Stronger blur */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08); /* More pronounced shadow on scroll */
    padding: 0.6rem 0; /* Shrink on scroll */
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px; /* Adjust as needed for your design */
    padding-top: 0;
    padding-bottom: 0;
}

.navbar-brand,
.d-flex.order-lg-2.align-items-center {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* space between button and toggler */
    height: 100%;
}

.logo {
    display: block;
    height: 48px; /* Match the height of the button/toggler for perfect centering */
    margin-right: 0.5rem;
}

.navbar .btn-primary,
.navbar-toggler {
    height: 40px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
    box-sizing: border-box;
}

.navbar-brand {
    font-weight: 600; /* Bolder font */
    font-size: 1.4rem;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.02); /* Subtle hover effect */
}

.nav-link {
    font-weight: 500; /* Medium weight */
    color: #4b5563 !important; /* Slightly darker gray */
    padding: 0.6rem 1rem; /* Adjusted padding */
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden; /* For the new hover effect */
}

/* New, subtle active and hover effect */
.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0; /* Start with zero width */
    height: 3px; /* Thicker underline */
    background: var(--primary-color);
    border-radius: 1.5px;
    transition: width 0.3s ease;
}

.nav-link:hover::before, 
.nav-link.active::before {
    width: 70%; /* Expand on hover and active */
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

.nav-link.active {
    color: var(--primary-color) !important;
}

.navbar.scrolled .logo {
    height: 48px; /* Shrink logo on scroll */
}

/* Navbar Toggle Button */
.navbar-toggler {
    border: none;
    padding: 0.35rem 0.6rem; /* Slightly more padding */
    transition: all 0.3s ease;
    border-radius: 6px;
    background-color: var(--light-bg); /* Subtle background */
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.25rem rgba(37, 99, 235, 0.25); /* Primary color focus ring */
    outline: none;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgb%2837, 99, 235%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e"); /* Primary color lines */
}

/* Sign In Button */
.navbar .btn-primary {
    background: var(--primary-color);
    border: none;
    border-radius: 0.375rem; /* Standard rounded corners */
    transition: all 0.3s ease;
    font-weight: 600; /* Bolder text */
    padding: 0.4rem 1.2rem; /* Adjusted padding */
}

.navbar .btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-1px); /* More subtle lift */
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35); /* Stronger shadow on hover */
}

/* Responsive Navigation */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15); /* More pronounced shadow */
        margin-top: 1rem;
        padding: 1.5rem; /* More internal padding */
        position: absolute;
        top: 100%; /* Position below navbar */
        left: 0;
        width: 100%;
    }
    
    .navbar-nav {
        text-align: center;
        margin-bottom: 1rem; /* Space before button */
    }
    
    .nav-item {
        margin: 0.75rem 0; /* More spacing between items */
    }
    
    /* Remove underline for mobile items */
    .nav-link::before {
        display: none;
    }

    /* Active state for mobile links can be a background color or bolder text */
    .nav-link.active {
        background-color: var(--light-bg);
        border-radius: 4px;
    }

    .navbar .btn-primary {
        margin-right: 0;
        margin-left: 0;
    }

    /* Show sign-in button and toggle on smaller screens, hide desktop sign-in */
    .d-block.d-lg-none {
        display: block !important;
    }
    .d-none.d-lg-block {
        display: none !important;
    }
}

@media (max-width: 767.98px) {
    .navbar-collapse {
        margin-top: 0.75rem;
        padding: 1rem;
    }
    .nav-item {
        margin: 0.6rem 0;
    }
    .logo {
        height: 40px; /* Match button/toggler height for mobile */
    }
    .navbar-brand {
        font-size: 1.2rem;
    }
    .navbar .btn-primary,
    .navbar-toggler {
        height: 36px;
    }
}

@media (max-width: 575.98px) {
    .logo {
        height: 36px;
    }
    .navbar-brand {
        font-size: 1.1rem;
    }
    .navbar-toggler {
        padding: 0.2rem 0.4rem;
    }
    .navbar .btn-primary,
    .navbar-toggler {
        height: 32px;
    }
}