/* ========================================
   Critical Layout Fixes
   ======================================== */

/* Fix Footer Text Visibility */
footer {
    background-color: #0a2563 !important;
    color: white !important;
}

footer h5,
footer h6,
footer p,
footer small,
footer .text-muted {
    color: white !important;
    opacity: 1 !important;
}

footer .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

footer a {
    color: rgba(255, 255, 255, 0.8) !important;
    transition: color 0.3s ease;
}

footer a:hover {
    color: white !important;
    text-decoration: underline !important;
}

footer .social-links a {
    color: white !important;
    font-size: 1.2rem;
    transition: transform 0.3s ease, color 0.3s ease;
}

footer .social-links a:hover {
    transform: translateY(-3px);
    color: #4a90e2 !important;
}

footer hr.border-secondary {
    border-color: rgba(255, 255, 255, 0.2) !important;
}

/* Fix Navbar Layout Issues - DISABLED to use brand-design-system.css styles */
/* .main-header {
    position: relative;
    z-index: 1000;
}

.navbar {
    padding: 0.5rem 0 !important;
}

.navbar-brand {
    display: flex !important;
    align-items: center !important;
    position: relative;
    z-index: 10;
    max-width: 240px;
    margin-right: 1rem !important;
}

.navbar-brand img {
    max-height: 40px;
    width: auto;
}

.navbar-brand div {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.navbar-brand strong {
    font-size: 0.95rem;
    color: #0e3182;
}

.navbar-brand small {
    font-size: 0.65rem;
    margin-top: 2px;
} */

/* Fix Navigation Items - DISABLED to use brand-design-system.css styles */
/* .navbar-nav {
    align-items: center;
    flex-wrap: nowrap !important;
}

.navbar-nav .nav-link {
    display: flex !important;
    align-items: center !important;
    padding: 0.4rem 0.6rem !important;
    white-space: nowrap;
    position: relative;
    font-size: 0.9rem !important;
}

.navbar-nav .nav-link i {
    margin-right: 0.2rem !important;
    font-size: 0.9rem;
}

.navbar-nav .dropdown-menu {
    margin-top: 0 !important;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
} */

/* Search Bar - Disabled to use brand-design-system.css styles */
/* .search-form {
    position: relative;
    z-index: 5;
    max-width: 200px;
    margin: 0 0.5rem;
}

.search-form .form-control {
    padding: 0.375rem 2rem 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.search-form .btn {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    padding: 0.375rem 0.75rem;
}

/* Fix Top Bar */
.top-bar {
    background-color: #343a40 !important;
    font-size: 0.875rem;
    padding: 0.5rem 0 !important;
}

.top-bar * {
    color: white !important;
}

.top-bar .btn-link {
    padding: 0 !important;
    color: white !important;
    opacity: 0.9;
}

.top-bar .btn-link:hover {
    opacity: 1;
    color: #4a90e2 !important;
}

/* Fix Login/Register Buttons - DISABLED to use brand-design-system.css styles */
/* .navbar .btn-primary,
.navbar .btn-outline-primary {
    background-color: #0e3182 !important;
    border-color: #0e3182 !important;
    color: white !important;
    padding: 0.3rem 0.75rem !important;
    font-size: 0.85rem !important;
    white-space: nowrap;
    min-width: 70px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

.navbar .btn-outline-primary {
    background-color: transparent !important;
    color: #0e3182 !important;
}

.navbar .btn-primary:hover {
    background-color: #0a2563 !important;
    border-color: #0a2563 !important;
}

.navbar .btn-outline-primary:hover {
    background-color: #0e3182 !important;
    color: white !important;
}

.navbar .ms-auto {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    margin-left: auto !important;
} */

/* Responsive Fixes - MODIFIED to not conflict with brand-design-system.css */
@media (max-width: 1200px) {
    /* Removed conflicting nav-link styles */
    
    /* .navbar-brand strong {
        font-size: 1rem;
    }
    
    .navbar-brand small {
        display: none !important;
    } */
}

@media (max-width: 991px) {
    /* Removed conflicting search and nav styles */
    
    /* .navbar-collapse {
        background-color: white;
        padding: 1rem;
        margin-top: 1rem;
        border-top: 1px solid #dee2e6;
    } */
}

@media (max-width: 768px) {
    footer .row > div {
        margin-bottom: 2rem;
    }
    
    footer h5,
    footer h6 {
        margin-bottom: 1rem !important;
    }
}

/* Fix Overflow Issues */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

.container {
    max-width: 100%;
    padding-right: 15px;
    padding-left: 15px;
}

/* Ensure Proper Z-Index Hierarchy */
.top-bar {
    z-index: 1100;
}

.main-header {
    z-index: 1050;
}

.navbar-collapse {
    z-index: 1040;
}

.dropdown-menu {
    z-index: 1060;
}

footer {
    z-index: 10;
    position: relative;
}

/* Fix Mobile Menu */
.offcanvas {
    z-index: 1200;
}

.offcanvas-backdrop {
    z-index: 1190;
}

/* Additional Layout Stability */
main {
    min-height: calc(100vh - 400px);
    position: relative;
    z-index: 1;
}

/* Ensure Text is Always Readable */
* {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Fix any potential button visibility issues */
.btn {
    position: relative;
    z-index: 1;
}

/* Newsletter Form in Footer */
footer .newsletter-form .form-control {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

footer .newsletter-form .form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

footer .newsletter-form .form-control:focus {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: #4a90e2;
    color: white;
}

footer .newsletter-form .btn-primary {
    background-color: #4a90e2 !important;
    border-color: #4a90e2 !important;
}

footer .newsletter-form .btn-primary:hover {
    background-color: #357abd !important;
    border-color: #357abd !important;
}