/* Shared header and navigation theme based on style.txt */

:root {
    --rb-nav-height: 44px;
    --rb-shell-bg: rgba(15, 23, 42, 0.92);
    --rb-panel-bg: rgba(15, 23, 42, 0.4);
    --rb-panel-bg-strong: rgba(15, 23, 42, 0.6);
    --rb-panel-bg-hover: rgba(15, 23, 42, 0.78);
    --rb-border: rgba(255, 255, 255, 0.1);
    --rb-border-strong: rgba(45, 212, 191, 0.32);
    --rb-text: rgba(255, 255, 255, 0.82);
    --rb-text-strong: #ffffff;
    --rb-accent: #2dd4bf;
    --rb-accent-dark: #14b8a6;
    --rb-danger: #ef4444;
    --rb-warning: #ffd700;
}

#Header {
    background: var(--rb-shell-bg) !important;
    border-bottom: 1px solid var(--rb-border) !important;
    box-shadow: 0 12px 28px rgba(2, 6, 23, 0.35) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.header-wrapper {
    padding: 12px 0 !important;
}

.header-wrapper .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    padding: 0 20px;
    gap: 16px;
    position: relative;
}

#menu > ul {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    list-style: none;
    gap: 10px;
    margin: 0;
    padding: 0;
}

#menu > ul > li {
    display: inline-flex;
    align-items: center;
    height: var(--rb-nav-height);
    margin: 0;
    position: relative;
}

#menu > ul > li > a {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    height: var(--rb-nav-height);
    padding: 11px 16px !important;
    border-radius: 8px;
    border: 1px solid var(--rb-border) !important;
    background: var(--rb-panel-bg) !important;
    color: var(--rb-text) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.1;
    text-decoration: none;
    white-space: nowrap;
    box-sizing: border-box;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#menu > ul > li > a:hover {
    background: var(--rb-panel-bg-hover) !important;
    border-color: var(--rb-border-strong) !important;
    color: var(--rb-text-strong) !important;
    transform: translateY(-1px);
}

#menu > ul > li > a.active {
    background: var(--rb-accent) !important;
    border-color: var(--rb-accent) !important;
    color: #0f172a !important;
    box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.22), 0 10px 20px rgba(20, 184, 166, 0.18) !important;
}

#menu > ul > li > a.active:hover {
    background: var(--rb-accent-dark) !important;
    border-color: var(--rb-accent-dark) !important;
    color: #0f172a !important;
}

#menu > ul > li > a::after {
    display: none !important;
}

/* Neutralize older dashboard-only blue styling */
#menu > ul > li > a[href="/dashboard"] {
    background: var(--rb-panel-bg) !important;
    border-color: var(--rb-border) !important;
    color: var(--rb-text) !important;
}

#menu > ul > li > a[href="/dashboard"]:hover {
    background: var(--rb-panel-bg-hover) !important;
    border-color: var(--rb-border-strong) !important;
    color: var(--rb-text-strong) !important;
}

/* Admin tab stays on-system but keeps a different accent */
#menu > ul > li > a[href="/models"] {
    color: var(--rb-warning) !important;
    border-color: rgba(255, 215, 0, 0.2) !important;
}

#menu > ul > li > a[href="/models"]:hover,
#menu > ul > li > a[href="/models"].active {
    background: rgba(255, 215, 0, 0.12) !important;
    border-color: rgba(255, 215, 0, 0.34) !important;
    color: #fff7cc !important;
    box-shadow: none !important;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown::after {
    content: "";
    position: absolute;
    bottom: -12px;
    left: 0;
    right: 0;
    height: 12px;
    pointer-events: auto;
}

.nav-dropdown .dropdown-toggle {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.nav-dropdown .dropdown-toggle::before,
.nav-dropdown .dropdown-toggle::after {
    display: none !important;
}

.nav-dropdown-caret {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    font-size: 11px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.62);
    transition: transform 0.18s ease, color 0.18s ease;
}

.nav-dropdown:hover .nav-dropdown-caret,
.nav-dropdown:focus-within .nav-dropdown-caret {
    color: #2dd4bf;
    transform: translateY(1px);
}

.nav-dropdown .dropdown-menu-nav {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 236px;
    max-width: 276px;
    padding: 8px;
    margin: 0;
    list-style: none;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(11, 18, 32, 0.98) 100%);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
    box-shadow: 0 20px 48px rgba(2, 6, 23, 0.46);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 999;
    transform: translateY(4px);
}

.nav-dropdown .dropdown-menu-nav li {
    width: 100%;
    margin: 0;
    padding: 0;
}

.nav-dropdown .dropdown-menu-nav li a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 0;
    padding: 12px 14px !important;
    border-radius: 10px;
    border: 1px solid transparent !important;
    background: transparent !important;
    color: var(--rb-text) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-align: left;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

.nav-dropdown .dropdown-menu-nav li a::before,
.nav-dropdown .dropdown-menu-nav li a::after {
    display: none !important;
}

.nav-dropdown .dropdown-menu-nav li a:hover {
    background: rgba(45, 212, 191, 0.12) !important;
    border-color: rgba(45, 212, 191, 0.22) !important;
    color: var(--rb-text-strong) !important;
    transform: translateY(-1px);
    box-shadow: none !important;
}

.nav-dropdown:hover .dropdown-menu-nav,
.nav-dropdown:focus-within .dropdown-menu-nav {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.language-switcher-menu {
    display: inline-flex !important;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 40px;
    margin: 0 2px;
    padding: 3px !important;
    list-style: none;
    background: var(--rb-panel-bg) !important;
    border: 1px solid var(--rb-border);
    border-radius: 10px;
    box-sizing: border-box;
    overflow: hidden;
    align-self: center;
}

.language-switcher-menu .lang-flag {
    width: 28px;
    min-width: 28px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--rb-text);
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    opacity: 0.55;
    transition: opacity 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.language-switcher-menu .lang-flag:hover:not(.active) {
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.05);
}

.language-switcher-menu .lang-flag.active {
    opacity: 1;
    background: rgba(45, 212, 191, 0.18);
    box-shadow: inset 0 0 0 1px rgba(45, 212, 191, 0.3);
}

.login-button a {
    background: var(--rb-panel-bg) !important;
    border: 1px solid var(--rb-border) !important;
    color: var(--rb-text-strong) !important;
    padding: 11px 18px !important;
}

.login-button a:hover {
    background: var(--rb-panel-bg-hover) !important;
    border-color: var(--rb-border-strong) !important;
    color: var(--rb-text-strong) !important;
}

.signup-button a {
    background: var(--rb-accent) !important;
    border: 1px solid var(--rb-accent) !important;
    color: #0f172a !important;
    font-weight: 700 !important;
    padding: 11px 20px !important;
    box-shadow: 0 10px 20px rgba(20, 184, 166, 0.18) !important;
}

.signup-button a:hover {
    background: var(--rb-accent-dark) !important;
    border-color: var(--rb-accent-dark) !important;
    color: #0f172a !important;
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(20, 184, 166, 0.24) !important;
}

.profile-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: var(--rb-nav-height);
}

.profile-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    height: var(--rb-nav-height) !important;
    min-width: 0 !important;
    padding: 8px 10px !important;
    border-radius: 10px !important;
    background: var(--rb-panel-bg) !important;
    border: 1px solid var(--rb-border) !important;
    color: var(--rb-text-strong) !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.profile-btn:hover {
    background: var(--rb-panel-bg-hover) !important;
    border-color: var(--rb-border-strong) !important;
    transform: translateY(-1px) !important;
}

.profile-avatar {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: var(--rb-accent) !important;
    color: #0f172a !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    flex-shrink: 0;
}

.profile-name {
    color: var(--rb-text-strong);
    font-size: 12px;
    font-weight: 600;
    max-width: 88px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid var(--rb-border);
    background: var(--rb-panel-bg);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.mobile-menu-toggle.active,
.mobile-menu-toggle:hover {
    background: var(--rb-panel-bg-hover);
    border-color: var(--rb-border-strong);
}

.mobile-menu-toggle span {
    width: 20px;
    height: 2px;
    margin: 3px 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88) !important;
}

@media (max-width: 768px) {
    #menu {
        display: none;
        position: absolute;
        top: calc(100% + 10px);
        left: 14px;
        right: 14px;
        padding: 14px;
        background: rgba(15, 23, 42, 0.96);
        border: 1px solid var(--rb-border);
        border-radius: 18px;
        box-shadow: 0 20px 40px rgba(2, 6, 23, 0.42);
        z-index: 1200;
        max-height: calc(100vh - 96px);
        overflow: hidden;
    }

    #menu.mobile-open,
    #menu.active {
        display: block !important;
    }

    #menu > ul {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        flex-wrap: nowrap;
        max-height: calc(100vh - 132px);
        overflow-y: auto;
        padding-right: 2px;
    }

    #menu > ul > li {
        width: 100%;
        height: auto;
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    #menu > ul > li > a,
    .profile-btn,
    .login-button a,
    .signup-button a {
        width: 100%;
        justify-content: flex-start !important;
        padding: 11px 14px !important;
    }

    .mobile-menu-toggle {
        display: inline-flex;
    }

    .language-switcher-menu {
        width: 100%;
        justify-content: center;
        margin: 0;
        padding: 6px !important;
    }

    .nav-dropdown::after {
        display: none;
    }

    .nav-dropdown .dropdown-menu-nav {
        position: static;
        visibility: hidden;
        opacity: 0;
        min-width: 100%;
        max-width: none;
        margin-top: 8px;
        padding: 8px;
        background: rgba(15, 23, 42, 0.58);
        box-shadow: none;
        border-radius: 12px;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
    }

    .nav-dropdown.dropdown-open .dropdown-menu-nav {
        visibility: visible;
        opacity: 1;
        max-height: 500px;
    }

    .nav-dropdown .dropdown-menu-nav li a {
        justify-content: flex-start;
        text-align: left;
    }

    .language-switcher-menu .lang-flag {
        width: 38px;
        min-width: 38px;
        height: 34px;
        font-size: 18px;
    }

    .profile-dropdown {
        width: 100%;
        height: auto;
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .profile-btn {
        justify-content: flex-start !important;
    }

    .profile-btn > span:last-child {
        margin-left: auto;
    }

    .profile-name {
        display: block;
        max-width: none;
    }

    .profile-dropdown .dropdown-menu {
        display: none;
        position: static !important;
        right: auto !important;
        width: 100% !important;
        margin-top: 10px !important;
        box-sizing: border-box;
        transform: none !important;
    }

    .profile-dropdown.active .dropdown-menu {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
}

/* Shared footer theme based on style.txt */
#Footer {
    background: rgba(15, 23, 42, 0.92) !important;
    border-top: 1px solid var(--rb-border) !important;
    box-shadow: 0 -12px 28px rgba(2, 6, 23, 0.18) !important;
}

#Footer .widgets_wrapper {
    padding: 56px 0 !important;
    background: transparent !important;
}

#Footer .footer-columns {
    gap: 28px;
}

#Footer .footer-column h4 {
    color: var(--rb-text-strong) !important;
    margin-bottom: 22px;
    padding-bottom: 12px;
}

#Footer .footer-column h4::after {
    background: var(--rb-accent) !important;
    height: 2px;
}

#Footer .footer-column p,
#Footer .footer-column ul li,
#Footer .contact-info li,
#Footer .copyright p {
    color: var(--rb-text) !important;
}

#Footer .footer-column ul li a {
    color: var(--rb-text) !important;
    text-decoration: none;
}

#Footer .footer-column ul li a:hover {
    color: var(--rb-accent) !important;
}

#Footer .social-icons a {
    background: var(--rb-panel-bg-strong) !important;
    border: 1px solid var(--rb-border);
    box-shadow: none !important;
}

#Footer .social-icons a:hover {
    background: rgba(45, 212, 191, 0.16) !important;
    border-color: var(--rb-border-strong) !important;
}

#Footer .newsletter h4 {
    color: var(--rb-text-strong) !important;
}

#Footer .newsletter form {
    gap: 0;
}

#Footer .newsletter input {
    background: var(--rb-panel-bg-strong) !important;
    border: 2px solid var(--rb-border) !important;
    color: var(--rb-text-strong) !important;
    border-radius: 8px 0 0 8px !important;
}

#Footer .newsletter input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

#Footer .newsletter input:focus {
    border-color: var(--rb-accent) !important;
    outline: none;
}

#Footer .newsletter button {
    background: var(--rb-accent) !important;
    color: #0f172a !important;
    border: 2px solid var(--rb-accent) !important;
    border-radius: 0 8px 8px 0 !important;
    font-weight: 700;
}

#Footer .newsletter button:hover {
    background: var(--rb-accent-dark) !important;
    border-color: var(--rb-accent-dark) !important;
}

#Footer .newsletter-feedback {
    min-height: 20px;
    margin: 10px 2px 0;
    color: var(--rb-text);
    font-size: 13px;
    line-height: 1.45;
}

#Footer .copyright {
    background: rgba(15, 23, 42, 0.96) !important;
    border-top: 1px solid var(--rb-border);
}
