/*
    hdr-ftr.css
    Styles for the navigation bar and footer.
    
    OPTIMIZATION NOTES:
    - Ensured smooth transition for fixed/scrolled header using transform.
    - **FIXED: Offcanvas background color on all mobile/tablet resolutions (<= 992px) to prevent content overlap.**
    - Improved footer responsiveness and ensured all text aligns left.
*/

/* --- Navbar Base (Performance Optimized for Fixed Position) --- */
.navbar {
    transition: background-color .4s ease, box-shadow .4s ease;
    /* Performance hint for fixed elements */
    transform: translateZ(0); 
}

/* Navbar Brand Logo */
.navbar-brand {
    display: flex;
    align-items: center;
}

/* Base Logo Height */
.navbar-brand img {
    height: 80px;
    transition: height 0.3s ease;
}

.navbar-scrolled .navbar-brand img {
    height: 50px;
}

/* Nav Links (Smoother Hover) */
.nav-link {
    font-weight: 500;
    margin: 0 0.5rem;
    color: var(--primary-blue) !important;
    transition: color 0.3s ease;
    position: relative;
}

/* Normal nav links underline */
.nav-link {
    position: relative;
    color: var(--primary-blue);
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link:after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #e67004;
    transition: width 0.3s ease;
}

/* Hover Effects */
.nav-link:hover {
    color: #e67004 !important;
}

.nav-link:hover:after {
    width: 100%;
}

.navbar .btn {
    padding: 0.6rem 1.2rem;
    font-weight: 600;
    border-radius: 4px;
    color: white;
    font-size: 0.9rem;
}

/* Dropdown-toggle ke liye underline hamesha mat lagao */
.nav-link.dropdown-toggle:after {
    content: none !important;
}

/* ---------------- DROPDOWN ---------------- */

/* Show dropdown on hover (desktop) */
.nav-item.dropdown:hover .dropdown-menu {
    display: block;
    margin-top: 0;
    animation: fadeIn 0.3s ease-in-out;
}
@media (max-width: 992px) {
    .nav-item.dropdown:hover .dropdown-menu {
        display: block !important;
    }
}

/* Dropdown base style */
.dropdown-menu {
    display: none;
    margin-top: 0;
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    padding: 0.5rem 0;
    background-color: #fff;
}

/* Dropdown items */
.dropdown-item {
    position: relative;
    color: var(--primary-blue);
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-block;
    width: 100%;
    padding: 0.6rem 1rem;
}

/* Underline for dropdown items (kept original, but often removed for cleaner look) */
.dropdown-item:after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 0;
    width: 0;
    height: 2px;
    transition: width 0.3s ease;
}

/* Hover state */
.dropdown-item:hover {
    color: #e67004;
    background-color: rgba(230, 112, 4, 0.05);
}

.dropdown-item:hover:after {
    width: 100%;
}

/* Remove Bootstrap focus outline/box shadow */
.nav-link:focus,
.nav-link.dropdown-toggle:focus,
.dropdown-item:focus {
    outline: none !important;
    box-shadow: none !important;
}


@media (max-width: 992px) {
    /* FIX: Offcanvas (This class targets the sliding menu) */
    .offcanvas,
    .offcanvas-start {
       height: 100vh !important;
       overflow-y: auto;
        background-color: white !important; /* Ensure white background to hide content behind */
    }

    /* FIX: Offcanvas Body (Ensures scrollable content is also white) */
    .offcanvas-body {
       flex-grow: 1; 
    overflow-y: auto;
    padding-bottom: 30px;
    }

    /* Legacy Navbar Collapse (kept for completeness) */
    .navbar .navbar-collapse {
        background: white;
        padding: 20px;
        border-radius: 8px;
        margin-top: 10px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }

    .navbar .nav-link {
        padding: 10px 0;
        border-bottom: 1px solid #f1f1f1;
    }

    .navbar .nav-link:last-child {
        border-bottom: none;
    }

    .navbar .btn {
        margin-top: 15px;
        width: 100%;
    }
}


@media (max-width: 768px) {
    /* Header Fix for Phone Screen */
    .navbar {
        padding: 0.8rem 1rem;
    }
    
    /* FIX: Reduce logo size on mobile so the toggler button is visible */
    .navbar-brand img {
        height: 50px; /* Reduced to ensure toggler visibility */
    }

    .navbar-toggler {
        padding: 0.25rem 0.5rem;
        font-size: 1.25rem;
    }
}

@media (max-width: 400px) {
    .navbar-brand img {
        height: 50px; /* Kept small for very small screens */
    }

    .navbar .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}

/* --- Footer --- */

footer {
    background: var(--primary-blue);
    color: white;
    padding: 5rem 0 2rem;
    position: relative;
    overflow: hidden;
}

footer:before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 300px;
    height: 300px;
    background: var(--accent-yellow);
    opacity: 0.03;
    border-radius: 50%;
}

.footer-logo {
    max-width: 200px;
    margin-bottom: 1.8rem;
    filter: brightness(0) invert(1);
}

/* Fix for Heading Alignment across all sizes */
.footer-heading {
    font-weight: 600;
    margin-bottom: 1.8rem;
    position: relative;
    padding-bottom: 0.8rem;
    font-size: 1.2rem;
    text-align: left !important;
}

.footer-heading:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--accent-yellow);
}

.footer-link-group {
    text-align: left;
}

.footer-link {
    color: #cbd5e1;
    display: block;
    margin-bottom: 1rem;
    transition: color 0.3s, padding-left 0.3s;
    text-decoration: none;
    position: relative;
    padding-left: 0;
    text-align: left;
}

.footer-link:before {
    content: '•';
    color: var(--accent-yellow);
    margin-right: 10px;
    transition: opacity 0.3s;
    opacity: 0;
}

.footer-link:hover {
    color: var(--accent-yellow);
    padding-left: 15px;
}

.footer-link:hover:before {
    opacity: 1;
}

.social-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    transition: background 0.3s, color 0.3s, transform 0.3s;
    color: white;
    text-decoration: none;
}

.social-icon:hover {
    background: var(--accent-yellow);
    color: var(--primary-blue);
    transform: translateY(-5px);
}

.copyright {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    margin-top: 4rem;
    text-align: center;
}

.footer-contact-info {
    text-align: left;
    margin-bottom: 0.5rem;
}

@media (max-width: 992px) {
    .footer-heading,
    .footer-link,
    .footer-contact-info {
        text-align: left;
    }
}

@media (max-width: 768px) {
    .footer-logo {
        max-width: 150px;
    }
}

@media (max-width: 576px) {
    footer {
        padding: 3rem 0 1.5rem;
    }

    .footer-heading {
        font-size: 1.1rem;
        margin-bottom: 1.2rem;
    }

    .social-icon {
        width: 40px;
        height: 40px;
        margin-right: 8px;
    }
}