/**
 * Frontend Header & Layout Styles
 * RV Academy - Frontend Layout CSS
 * File: /assets/css/frontend-header.css
 * Based on: /mockups-v2/frontend-common.css
 */

/* ============================================
   CSS Variables
   ============================================ */
:root {
    --primary: #ec1c24;
    --secondary: #cca766;
    --gold: #cca766;
    --dark: #2c3e50;
    --border-color: #e9edf1;
}

/* ============================================
   FRONTEND PAGE LAYOUT OVERRIDES
   Reset CUBA admin sidebar margins for frontend
   ============================================ */
.frontend-page.page-wrapper {
    margin-left: 0 !important;
    padding-top: 70px;
}


.frontend-page .page-body-wrapper {
    margin-left: 0 !important;
}

.frontend-page .page-body {
    margin-left: 0 !important;
    margin-top: 0 !important;
}

/* Footer - remove admin sidebar margin */
.frontend-page .footer,
.frontend-page.page-wrapper .footer,
.page-wrapper.frontend-page .footer {
    margin-left: 0 !important;
}

/* ============================================
   Frontend Header - Based on mockup
   ============================================ */
.frontend-header {
    background: #fff !important;
    border-bottom: 1px solid var(--border-color);
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.frontend-header .navbar {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    min-height: 70px;
}

.frontend-header .navbar-brand {
    padding: 12px 0;
    margin: 0;
}

.frontend-header .navbar-brand img {
    height: 55px;
}

/* Mobile Header Row */
.frontend-header .mobile-header {
    padding: 10px 0;
}

.frontend-header .mobile-header .navbar-brand img {
    height: 35px;
}

/* ============================================
   Mobile Header Right (Language + Toggle)
   ============================================ */
.frontend-header .mobile-header-right {
    gap: 5px;
    margin-left: auto;
}

.frontend-header .mobile-header-right .language-dropdown .dropdown-toggle {
    width: 50px;
    padding: 6px;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.frontend-header .mobile-header-right .language-dropdown .dropdown-toggle::after {
    margin-left: 0;
    font-size: 8px;
}

.frontend-header .toggle-nav {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.frontend-header .toggle-nav:hover {
    background: rgba(204, 167, 102, 0.1);
}

.frontend-header .toggle-nav svg {
    width: 20px;
    height: 20px;
    stroke: var(--dark);
}

/* ============================================
   Navigation Links
   ============================================ */
.frontend-header .navbar-nav.frontend-nav .nav-item .nav-link {
    color: #52526C;
    font-weight: 500;
    font-size: 18px;
    padding: 8px 16px;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.frontend-header .navbar-nav.frontend-nav .nav-item .nav-link:hover,
.frontend-header .navbar-nav.frontend-nav .nav-item .nav-link.active,
.frontend-nav .nav-link:hover,
.frontend-nav .nav-link.active {
    color: var(--gold) !important;
    border-bottom: 2px solid var(--gold);
}

/* Active link - Higher specificity to override CUBA */
.frontend-header .navbar-nav.frontend-nav > .nav-item > .nav-link.active {
    color: var(--gold) !important;
    border-bottom-color: var(--gold);
    font-weight: 600;
}

/* Dropdown toggle active state */
.frontend-header .navbar-nav.frontend-nav > .nav-item.dropdown > .nav-link.dropdown-toggle.active {
    color: var(--gold) !important;
}

/* Dropdown menus in header */
.frontend-header .navbar-nav .dropdown-menu {
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 10px 0;
}

.frontend-header .navbar-nav .dropdown-item {
    padding: 10px 20px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.frontend-header .navbar-nav .dropdown-item:hover {
    background: rgba(204, 167, 102, 0.1);
    color: var(--gold);
}

/* ============================================
   Language Dropdown
   ============================================ */
.frontend-header .language-dropdown .dropdown-toggle {
    color: #52526C;
    font-size: 14px;
    padding: 8px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.frontend-header .language-dropdown .dropdown-toggle:hover {
    color: var(--gold);
}

.frontend-header .language-dropdown .dropdown-toggle::after {
    margin-left: 5px;
}

.frontend-header .language-dropdown .dropdown-menu {
    min-width: 150px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
}

.frontend-header .language-dropdown .dropdown-item.active,
.frontend-header .language-dropdown .dropdown-item:hover {
    background: rgba(204, 167, 102, 0.1);
    color: var(--gold);
}

/* ============================================
   Profile Navigation - Click-based Dropdown
   ============================================ */
.frontend-header .profile-nav {
    position: relative;
    cursor: pointer;
}

.frontend-header .profile-nav .profile-media {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.frontend-header .profile-nav .profile-media img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
}

.frontend-header .profile-nav .profile-media .profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #ec1c24 0%, #c62828 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.frontend-header .profile-nav .profile-media .profile-avatar svg {
    width: 20px;
    height: 20px;
}

.frontend-header .profile-nav .profile-media .flex-grow-1 {
    margin-left: 15px;
}

.frontend-header .profile-nav .profile-media .flex-grow-1 span {
    font-weight: 500;
    color: #2c3e50;
    display: block;
    font-size: 14px;
}

.frontend-header .profile-nav .profile-media .flex-grow-1 p {
    font-size: 12px;
    line-height: 1;
    color: rgba(64, 64, 64, 0.7);
    margin-bottom: 0;
}

/* Profile Dropdown Menu */
.frontend-header .profile-nav .profile-dropdown {
    position: absolute;
    top: 55px;
    right: 0;
    left: auto;
    width: 220px;
    padding: 10px 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(89, 102, 122, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
    list-style: none;
    margin: 0;
}

/* Show on hover (desktop) or click (mobile) */
.frontend-header .profile-nav:hover .profile-dropdown,
.frontend-header .profile-nav.active .profile-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Arrow */
.frontend-header .profile-nav .profile-dropdown::before {
    content: "";
    position: absolute;
    top: -7px;
    right: 25px;
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 7px solid #fff;
    z-index: 2;
}

.frontend-header .profile-nav .profile-dropdown::after {
    content: "";
    position: absolute;
    top: -8px;
    right: 24px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid rgba(89, 102, 122, 0.1);
    z-index: 1;
}

/* Dropdown Items */
.frontend-header .profile-nav .profile-dropdown li {
    padding: 0;
    list-style: none;
}

.frontend-header .profile-nav .profile-dropdown li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    text-decoration: none;
    color: #3f475a;
    font-size: 14px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.frontend-header .profile-nav .profile-dropdown li a svg {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    vertical-align: middle;
    stroke: #3f475a;
    transition: all 0.3s ease;
}

.frontend-header .profile-nav .profile-dropdown li a:hover {
    background: rgba(204, 167, 102, 0.1);
    color: var(--gold);
    border-left-color: var(--gold);
}

.frontend-header .profile-nav .profile-dropdown li a:hover svg {
    stroke: var(--gold);
}

/* Logout item - special styling */
.frontend-header .profile-nav .profile-dropdown li:last-child a {
    border-top: 1px solid #f0f0f0;
    margin-top: 5px;
    padding-top: 15px;
    color: #dc3545;
}

.frontend-header .profile-nav .profile-dropdown li:last-child a svg {
    stroke: #dc3545;
}

.frontend-header .profile-nav .profile-dropdown li:last-child a:hover {
    background: rgba(220, 53, 69, 0.08);
    border-left-color: #dc3545;
    color: #dc3545;
}

/* ============================================
   Login Button
   ============================================ */
.frontend-header .btn-login {
    background: linear-gradient(135deg, #ec1c24 0%, #c62828 100%);
    border: none;
    padding: 10px 28px;
    font-weight: 600;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(236, 28, 36, 0.3);
    transition: all 0.3s ease;
    color: #fff;
}

.frontend-header .btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(236, 28, 36, 0.4);
    color: #fff;
}

/* ============================================
   Mobile Responsive
   ============================================ */
@media (max-width: 991.98px) {
    .frontend-header {
        padding: 0;
    }

    .frontend-header .navbar-collapse {
        background: #fff;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        padding: 15px 20px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        border-radius: 0 0 10px 10px;
    }

    /* Menu căn trái */
    .frontend-header .navbar-nav.frontend-nav {
        align-items: flex-start !important;
    }

    .frontend-header .navbar-nav.frontend-nav .nav-item {
        width: 100%;
    }

    .frontend-header .navbar-nav.frontend-nav .nav-item .nav-link {
        padding: 12px 0;
        border-bottom: 1px solid #f0f0f0;
        display: block;
    }

    .frontend-header .navbar-nav.frontend-nav .nav-item .nav-link:hover,
    .frontend-header .navbar-nav.frontend-nav .nav-item .nav-link.active {
        border-bottom: 1px solid #f0f0f0;
        background: transparent;
    }

    .frontend-header .navbar-nav.frontend-nav .nav-item:last-child .nav-link {
        border-bottom: none;
    }

    /* Desktop language dropdown hidden on mobile via d-none d-lg-block */

    /* Profile dropdown in mobile */
    .frontend-header .profile-nav {
        width: 100%;
        border-top: 1px solid #eee;
        margin-top: 15px;
        padding-top: 15px;
    }

    .frontend-header .profile-nav .profile-media {
        padding: 10px 0;
    }

    .frontend-header .profile-nav .profile-media .flex-grow-1 {
        display: block;
        margin-left: 12px;
    }

    .frontend-header .profile-nav .profile-dropdown {
        position: static;
        width: 100%;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding: 0;
        margin-top: 10px;
        display: none;
        background: #f8f9fa;
        border-radius: 8px;
    }

    .frontend-header .profile-nav .profile-dropdown::before,
    .frontend-header .profile-nav .profile-dropdown::after {
        display: none;
    }

    .frontend-header .profile-nav:hover .profile-dropdown {
        display: none;
    }

    .frontend-header .profile-nav.active .profile-dropdown {
        display: block;
    }

    .frontend-header .profile-nav .profile-dropdown li a {
        padding: 12px 15px;
        font-size: 14px;
        border-left: none;
    }

    .frontend-header .profile-nav .profile-dropdown li a:hover {
        border-left: none;
        background: rgba(204, 167, 102, 0.1);
    }

    .frontend-header .profile-nav .profile-dropdown li:last-child a {
        border-top: none;
        margin-top: 0;
        padding-top: 12px;
    }

    /* Login button mobile */
    .frontend-header .btn-login {
        width: 100%;
        margin-top: 15px;
        text-align: center;
    }
}

@media (max-width: 575.98px) {
    .frontend-header .profile-nav .profile-media .flex-grow-1 span {
        font-size: 13px;
    }

    .frontend-header .profile-nav .profile-media .flex-grow-1 p {
        font-size: 11px;
    }
}

/* ============================================
   Footer Title
   ============================================ */
.frontend-page .footer-title {
    color: var(--gold);
}
