/* ==================== CSS VARIABLES ==================== */
:root {
    --primary-dark: #1A2A2A;
    --primary-darker: #0F2B1F;
    --primary-green: #1B4D3E;
    --accent-gold: #F5A623;
    --accent-orange: #E8871E;
    --text-white: #FFFFFF;
    --text-gray: #94A3B8;
    --text-light: #E2E8F0;
    --border-color: rgba(245, 166, 35, 0.2);
    --danger-red: #E63946;
    
    --title-gradient-start: #1B4D3E;
    --title-gradient-end: #F5A623;
    --title-font-size: 1.1rem;
    --title-font-size-mobile: 0.95rem;
    --title-font-size-small: 0.85rem;
    --title-font-weight: 700;
    --title-padding: 4px 12px;
    --title-padding-mobile: 2px 8px;
    --title-border-radius: 30px;
    --back-btn-bg: rgba(245, 166, 35, 0.1);
    --back-btn-hover-bg: rgba(245, 166, 35, 0.2);
    --back-btn-active-bg: rgba(245, 166, 35, 0.3);
    --back-btn-icon-color: #F5A623;
    --mobile-header-bg: linear-gradient(135deg, #1A2A2A 0%, #0F2B1F 100%);
    --desktop-header-bg: rgba(15, 43, 31, 0.95);
}

/* ==================== DESKTOP HEADER ==================== */
.desktop-header {
    position: sticky;
    top: 0;
    background: var(--desktop-header-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 12px rgba(27, 77, 62, 0.1);
    z-index: 1000;
    height: auto;
    min-height: 70px;
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.logo a {
    text-decoration: none;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-white);
    letter-spacing: -0.5px;
}

.logo-text .accent {
    color: var(--accent-gold);
}

.desktop-nav {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    padding: 4px;
    border-radius: 60px;
}

.nav-link {
    padding: 8px 24px;
    border-radius: 40px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-gray);
    transition: all 0.2s;
    cursor: pointer;
}

.nav-link:hover {
    color: var(--accent-gold);
    background: rgba(245, 166, 35, 0.15);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
    color: var(--primary-green);
}

.auth-section {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.btn-login,
.btn-register {
    padding: 8px 20px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-login {
    background: transparent;
    color: var(--text-gray);
    border: 1px solid #334155;
}

.btn-login:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    background: rgba(245, 166, 35, 0.1);
}

.btn-register {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
    color: var(--primary-green);
}

.btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 166, 35, 0.3);
}

/* ==================== USER DROPDOWN ==================== */
.user-avatar {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 40px;
    background: rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
}

.user-avatar:hover {
    background: rgba(245, 166, 35, 0.15);
    border-color: rgba(245, 166, 35, 0.4);
}

.user-avatar i:first-child {
    font-size: 1.2rem;
    color: var(--accent-gold);
}

.user-avatar span {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-white);
}

.user-avatar i:last-child {
    font-size: 0.7rem;
    color: var(--text-gray);
    transition: transform 0.2s;
}

.user-avatar:hover i:last-child {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 12px;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-darker));
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    min-width: 240px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s ease;
    z-index: 1000;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    text-decoration: none;
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: rgba(245, 166, 35, 0.15);
    color: var(--accent-gold);
    padding-left: 26px;
}

.dropdown-item i {
    width: 20px;
    color: var(--accent-gold);
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 4px 0;
}

.logout-item {
    color: var(--danger-red) !important;
}

.logout-item i {
    color: var(--danger-red) !important;
}

.logout-item:hover {
    background: rgba(230, 57, 70, 0.15) !important;
    color: var(--danger-red) !important;
}

/* ==================== TELEGRAM NAV LINK ==================== */
.telegram-nav-link {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    background: rgba(0, 136, 204, 0.1);
    padding: 8px 16px;
    border-radius: 40px;
    text-decoration: none;
    border: 1px solid rgba(0, 136, 204, 0.2);
    margin-left: 8px;
    transition: all 0.2s ease;
    color: var(--text-light) !important;
    font-size: 0.9rem;
    font-weight: 500;
}

.telegram-nav-link i {
    color: #0088cc;
    font-size: 1rem;
}

.telegram-nav-link span {
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 500;
}

.telegram-nav-link:hover {
    background: rgba(0, 136, 204, 0.2);
    border-color: rgba(0, 136, 204, 0.4);
    transform: translateY(-1px);
}

/* ==================== MOBILE HEADER ==================== */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--mobile-header-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    padding: 12px 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mobile-header-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mobile-logo a {
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-white);
}

.mobile-logo .accent {
    color: var(--accent-gold);
}

.mobile-back-btn {
    background: var(--back-btn-bg);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.mobile-back-btn:hover {
    background: var(--back-btn-hover-bg);
    transform: scale(1.05);
}

.mobile-back-btn:active {
    transform: scale(0.95);
    background: var(--back-btn-active-bg);
}

.mobile-back-btn i {
    font-size: 1.2rem;
    color: var(--back-btn-icon-color);
    transition: transform 0.2s;
}

.mobile-back-btn:hover i {
    transform: translateX(-2px);
}

.mobile-page-title {
    flex: 1;
    text-align: center;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding: 0 8px;
}

.mobile-page-title span {
    font-size: var(--title-font-size);
    font-weight: var(--title-font-weight);
    background: linear-gradient(135deg, var(--title-gradient-start), var(--title-gradient-end));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1.2;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: -0.3px;
    text-transform: capitalize;
    position: relative;
    padding: var(--title-padding);
    border-radius: var(--title-border-radius);
}

.mobile-telegram-link {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 136, 204, 0.12);
    padding: 6px 12px;
    border-radius: 30px;
    text-decoration: none;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.mobile-telegram-link i {
    color: #0088cc;
    font-size: 0.9rem;
}

.mobile-telegram-link span {
    color: #0088cc;
    font-size: 0.75rem;
    font-weight: 500;
}

.mobile-telegram-link:hover {
    background: rgba(0, 136, 204, 0.2);
    transform: scale(1.02);
}

.mobile-placeholder {
    width: 38px;
    flex-shrink: 0;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .desktop-header {
        display: none;
    }
    
    .mobile-header {
        display: block;
    }
    
    .mobile-telegram-link span {
        display: none;
    }
    
    .mobile-telegram-link {
        padding: 6px 10px;
    }
}

@media (min-width: 769px) {
    .mobile-header {
        display: none !important;
    }
}

@media (max-width: 1100px) {
    .telegram-nav-link span {
        display: none;
    }
    
    .telegram-nav-link {
        padding: 6px 12px !important;
    }
    
    .telegram-nav-link i {
        font-size: 1rem;
        margin: 0;
    }
}

@media (max-width: 768px) {
    .telegram-nav-link {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .mobile-header-container {
        gap: 8px;
    }
    
    .mobile-back-btn {
        width: 34px;
        height: 34px;
    }
    
    .mobile-back-btn i {
        font-size: 1rem;
    }
    
    .mobile-page-title span {
        font-size: var(--title-font-size-mobile);
        padding: var(--title-padding-mobile);
    }
    
    .mobile-placeholder {
        width: 34px;
    }
}

@media (max-width: 380px) {
    .mobile-page-title span {
        font-size: var(--title-font-size-small);
        max-width: 140px;
        padding: 2px 6px;
    }
}

/* ==================== SAFE AREA SUPPORT ==================== */
@supports (padding-top: env(safe-area-inset-top)) {
    .mobile-header {
        padding-top: env(safe-area-inset-top);
        height: auto;
    }
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-header {
    animation: fadeIn 0.3s ease;
}