/* Header Styles for Consistent Appearance Across All Pages */

/* Top Bar */
.top-bar {
    background: #FFFFFF;
    font-size: 0.85rem;
    padding: 16px 20px;
}

.top-bar a {
    text-decoration: none;
    transition: opacity 0.3s;
}

.top-bar a:hover {
    opacity: 0.8;
}

.top-bar .social-icons {
    margin-left: 20px;
}

.top-bar .social-icons i {
    font-size: 1rem;
    max-height: 32px;
}

/* Main Header */
.main-header {
    background: linear-gradient(135deg, #0a58ca 0%, #0b4cba 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 16px 20px;
}

.navbar-brand {
    transition: transform 0.3s;
}

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

.nav-link {
    color: white !important;
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
    margin: 0 5px;
}

.nav-link:hover {
    color: #e6f0ff !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: white;
    transition: width 0.3s;
}

.nav-link:hover::after {
    width: 100%;
}

.btn-light {
    background-color: white;
    color: #0a58ca !important;
    border: none;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    border-radius: 50px;
}

.btn-light:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.dropdown-menu {
    border: none;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    padding: 10px 0;
}

.dropdown-item {
    padding: 10px 20px;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #0a58ca;
}

.navbar-toggler {
    border: none;
    padding: 5px;
}

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

/* For activity pages, we want a black icon on mobile */
.activity-page .navbar-toggler {
    border-color: rgba(0, 0, 0, 0.1);
}

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

/* Mega Menu Styles */
.mega-menu {
    border: none;
    border-radius: 15px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    padding: 30px;
    width: 1000px;
    max-width: 90vw;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
    z-index: 1000;
    position: fixed;
    top: 80px; /* Default position, will be updated by JS */
}

.dropdown:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%);
}

.mega-menu-category {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0a58ca;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
    position: relative;
}

.mega-menu-category i {
    font-size: 1.2rem;
}

.mega-menu .dropdown-item {
    padding: 12px 20px;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin-bottom: 8px;
    color: #333333;
    font-weight: 500;
}

.mega-menu .dropdown-item:hover {
    background-color: #e6f0ff;
    color: #0a58ca;
    transform: translateX(8px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Mega menu responsive behavior */
@media (max-width: 991px) {
    .mega-menu {
        position: absolute;
        width: 100vw;
        max-width: 100vw;
        left: 0;
        transform: none;
        padding: 20px 0;
        border-radius: 0;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        top: 100%;
        background: white;
        color: #333;
        display: none;
    }
    
    .mega-menu .container {
        padding: 0;
        max-width: 100%;
        display: flex;
        justify-content: center;
    }
    
    .mega-menu .row {
        display: block;
        margin: 0;
        padding: 0 20px;
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
    }
    
    .mega-menu .col-md-4 {
        padding: 0;
        width: 100%;
        max-width: 100%;
        margin-bottom: 0;
        border-bottom: none;
    }
    
    .mega-menu-category {
        display: none;
    }
    
    .mega-menu .dropdown-item {
        padding: 14px 20px;
        margin-bottom: 10px;
        color: #333;
        text-align: center;
        border-radius: 8px;
        display: block;
        width: 100%;
        background-color: #f8f9fa;
        border: 1px solid #e9ecef;
        font-weight: 500;
        transition: all 0.3s ease;
        font-size: 1rem;
    }
    
    .mega-menu .dropdown-item:hover {
        background-color: #0a58ca;
        color: white;
        transform: none;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }
    
    .mega-menu-category i {
        display: none;
    }
}

/* Mobile Menu Styles */
.mobile-menu {
    display: none;
}

@media (max-width: 991px) {
    .mobile-menu {
        display: block;
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        background: #0a58ca;
        z-index: 10000;
        transition: left 0.3s ease;
        overflow-y: auto;
        padding: 20px;
        box-sizing: border-box;
    }
    
    .mobile-menu.active {
        left: 0;
    }
    
    .mobile-menu-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-bottom: 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        margin-bottom: 20px;
    }
    
    .mobile-menu-close {
        background: none;
        border: none;
        color: white;
        font-size: 1.5rem;
        cursor: pointer;
    }
    
    .mobile-menu-item {
        color: white;
        text-decoration: none;
        display: block;
        padding: 15px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        font-size: 1.1rem;
        font-weight: 500;
        transition: all 0.3s ease;
    }
    
    .mobile-menu-item:hover {
        color: #e6f0ff;
        padding-left: 10px;
    }
    
    .mobile-menu-item.cta {
        background: #ffc107;
        color: #000;
        border-radius: 5px;
        text-align: center;
        font-weight: 600;
        margin: 20px 0;
        border-bottom: none;
    }
    
    .mobile-menu-item.cta:hover {
        background: #ffca2c;
        padding-left: 0;
        transform: translateY(-2px);
    }
    
    .mobile-category {
        margin: 15px 0;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 8px;
        overflow: hidden;
    }
    
    .mobile-category-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
        background: rgba(0, 0, 0, 0.2);
        color: white;
        font-weight: 600;
        cursor: pointer;
        transition: background 0.3s ease;
    }
    
    .mobile-category-header:hover {
        background: rgba(0, 0, 0, 0.3);
    }
    
    .mobile-category-header i {
        transition: transform 0.3s ease;
    }
    
    .mobile-category-header.active i {
        transform: rotate(180deg);
    }
    
    .mobile-submenu {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        background: rgba(255, 255, 255, 0.05);
    }
    
    .mobile-submenu.active {
        max-height: 1000px;
    }
    
    .mobile-submenu-item {
        display: block;
        padding: 12px 20px 12px 30px;
        color: rgba(255, 255, 255, 0.9);
        text-decoration: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        transition: all 0.3s ease;
        font-size: 1rem;
    }
    
    .mobile-submenu-item:last-child {
        border-bottom: none;
    }
    
    .mobile-submenu-item:hover {
        background: rgba(255, 255, 255, 0.1);
        color: white;
        padding-left: 35px;
    }
    
    .overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

@media (max-width: 768px) {
    .top-bar {
        font-size: 0.75rem;
        padding: 12px 14px;
    }
    
    .top-bar .social-icons, .top-bar .language-switcher {
        display: none;
    }
    
    .navbar-brand {
        height: 70px;
        top: -32px;
        left: 15px;
    }
    
    .navbar-brand img {
        height: 70px;
    }
    
    .main-header {
        border-radius: 0 0 10px 10px;
        padding: 12px 14px;
    }
    
    .nav-link {
        margin: 5px 0;
        font-size: 1rem;
        padding: 10px 15px;
    }
    
    .navbar-nav .nav-item {
        text-align: center;
    }
    
    .btn-light {
        margin: 10px 0;
        width: 90%;
        margin-left: 5%;
    }
    
    .mobile-menu {
        padding: 15px;
    }
    
    .mobile-menu-item {
        padding: 12px 0;
        font-size: 1rem;
    }
    
    .mobile-category-header {
        padding: 12px 15px;
        font-size: 1rem;
    }
    
    .mobile-submenu-item {
        padding: 10px 15px 10px 25px;
        font-size: 0.9rem;
    }
    
    .mobile-submenu-item:hover {
        padding-left: 30px;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        height: 60px;
        top: -28px;
        left: 10px;
    }
    
    .navbar-brand img {
        height: 60px;
    }
    
    .top-bar {
        text-align: center;
        padding: 12px 14px;
    }
    
    .top-bar > div {
        justify-content: center !important;
    }
}