/* ====================================================================
   NAVBAR-MAIN.CSS - COMPLETE FIXED VERSION
   All navbar, footer, and layout styles
   ==================================================================== */

/* ====================================
   CSS VARIABLES
   ==================================== */
:root {
    --ubsi-primary: #0d1b40;
    --ubsi-primary-light: #1a2f5f;
    --ubsi-primary-dark: #081229;
    --ubsi-accent: #4a90e2;
    --ubsi-success: #28a745;
    --ubsi-warning: #ffc107;
    --ubsi-text: #333333;
    --ubsi-text-light: #666666;
    --ubsi-background: #ffffff;
    --ubsi-gray-light: #f8f9fa;
    --ubsi-red-accent: #c82f2f;
}

/* ====================================
   GLOBAL STYLES
   ==================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--ubsi-background);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ubsi-text);
    margin: 0;
    padding: 0;
    /* Default spacing for fixed navbar */
    padding-top: 75px;
    animation: fadeIn 0.3s ease-in forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Body adjustment when affiliate banner is active */
body.has-affiliate-banner {
    padding-top: 115px; /* 40px banner + 75px navbar */
}

main {
    flex: 1 0 auto;
    position: relative;
    z-index: 1;
}

/* ====================================
   AFFILIATE BANNER
   ==================================== */
.affiliate-banner {
    background: linear-gradient(135deg, var(--ubsi-primary-dark) 0%, var(--ubsi-primary) 100%);
    color: white;
    text-align: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 40px;
    z-index: 1032;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
}

.affiliate-banner a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
}

.affiliate-banner a:hover {
    text-decoration: underline;
}

/* ====================================
   NAVBAR STYLES
   ==================================== */
.navbar-ubsi {
    background-color: var(--ubsi-primary) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    min-height: 75px;
    /* Red accent border on top */
    border-top: 6px solid var(--ubsi-red-accent);
}

/* Fixed positioning logic */
.navbar-ubsi.fixed-top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    z-index: 1031;
}

/* Adjust navbar position if banner is present */
.navbar-ubsi.fixed-top.with-affiliate-banner {
    top: 40px;
}

.navbar-brand {
    transition: transform 0.3s ease;
    color: #ffffff !important;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

/* Navbar toggler styling */
.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.5);
    padding: 0.5rem 0.75rem;
    z-index: 1032;
    position: relative;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25);
}

.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='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Navigation buttons */
.navbar-ubsi .btn-outline-light {
    color: #ffffff !important;
    border: 2px solid rgba(255, 255, 255, 0.5) !important;
    background-color: transparent !important;
    white-space: nowrap;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
}

.navbar-ubsi .btn-outline-light:hover {
    color: var(--ubsi-primary) !important;
    background-color: #ffffff !important;
    border-color: #ffffff !important;
    transform: translateY(-2px);
}

/* ====================================
   DESKTOP NAVBAR (>= 768px)
   ==================================== */
@media (min-width: 768px) {
    .navbar-ubsi .container {
        max-width: 960px;
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
    }
    
    /* Ensure the collapse is always visible on desktop */
    .navbar-ubsi .navbar-collapse.collapse {
        display: flex !important;
    }
    
    .navbar-ubsi .navbar-nav {
        flex-direction: row;
        gap: 0.5rem;
        align-items: center;
    }
}

/* ====================================
   MOBILE NAVBAR (< 768px)
   ==================================== */
@media (max-width: 767.98px) {
    body {
        padding-top: 85px; 
    }
    
    body.has-affiliate-banner {
        padding-top: 125px;
    }
    
    .navbar-ubsi .container {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
    }
    
    .navbar-ubsi .navbar-brand { order: 1; }
    .navbar-ubsi .navbar-toggler { order: 2; }
    .navbar-ubsi .navbar-collapse {
        order: 3;
        flex-basis: 100%;
        width: 100%;
    }

    /* FIX: Removed manual display:block/none and height:0 rules here.
       Bootstrap's internal CSS handles .collapse, .collapsing, and .show classes.
    */
    
    .navbar-nav {
        padding-top: 1rem;
        padding-bottom: 0.5rem;
        width: 100%;
    }
    
    .navbar-nav .nav-item {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .navbar-nav .btn {
        width: 100%;
        text-align: center;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* ====================================
   FOOTER STYLES
   ==================================== */
.ubsi-footer {
    background-color: var(--ubsi-primary);
    margin-top: auto;
    font-size: 0.9rem;
    color: white !important;
    border-top: 6px solid var(--ubsi-red-accent);
}

@media (min-width: 768px) {
    .ubsi-footer .container {
        max-width: 960px;
    }
}

.ubsi-footer p,
.ubsi-footer .accordion-body {
    color: white !important;
}

/* Mobile accordion footer styling */
.footer-accordion .accordion-item {
    background-color: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.footer-accordion .accordion-button {
    background-color: transparent;
    color: white !important;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    padding: 1rem 0;
    box-shadow: none;
    letter-spacing: 0.5px;
}

.footer-accordion .accordion-button:not(.collapsed) {
    background-color: transparent;
    color: white !important;
}

.footer-accordion .accordion-button:focus {
    box-shadow: none;
}

.footer-accordion .accordion-button::after {
    filter: brightness(0) invert(1);
}

/* FIX: Removed manual .accordion-collapse overrides.
   This prevents the footer menu from getting "stuck" when closing.
*/

.footer-accordion .accordion-body {
    padding: 0.5rem 0 1.5rem 0;
}

/* Footer links */
.footer-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-list li {
    margin-bottom: 0.65rem;
}

.footer-list a {
    color: rgba(255, 255, 255, 0.7) !important;
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s ease;
    font-size: 0.9rem;
    display: inline-block;
}

.footer-list a:hover {
    color: #ffffff !important;
    transform: translateX(3px);
}

.ubsi-footer h6 {
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    color: white !important;
}