/* ===== VARIABLES ===== */
:root {
    --primary-color: #7e57c2;
    --primary-light: #b085f5;
    --primary-dark: #4d2c91;
    --accent-color: #ff6b9d;
    --accent-light: #ff8eb4;
    --accent-dark: #e91e63;
    --text-color: #2c3e50;
    --text-secondary: #6c757d;
    --surface-color: #ffffff;
    --background-color: #f8f9fa;
    --border-color: #e9ecef;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.15);
    --gradient-primary: linear-gradient(135deg, #7e57c2 0%, #b085f5 100%);
    --gradient-accent: linear-gradient(135deg, #ff6b9d 0%, #ff8eb4 100%);
    --gradient-card: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

[data-theme="dark"] {
    --text-color: #e9ecef;
    --text-secondary: #adb5bd;
    --surface-color: #1a1a2e;
    --background-color: #16213e;
    --border-color: #2d3748;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.4);
    --gradient-card: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

/* ===== HEADER STYLES ===== */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

[data-theme="dark"] header {
    background: rgba(15, 15, 25, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 1rem 2rem;
    gap: 2rem;
}

/* ===== LOGO STYLES ===== */
.logo-with-icon {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 12px;
    flex-shrink: 0;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #7e57c2 0%, #b085f5 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.logo-icon::before {
    content: 'H';
    color: white;
    font-size: 1.2rem;
    font-weight: 800;
    font-family: 'Arial', sans-serif;
}

.logo-text-full {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #2c3e50 0%, #7e57c2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
    white-space: nowrap;
}

[data-theme="dark"] .logo-text-full {
    background: linear-gradient(135deg, #ffffff 0%, #b085f5 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

/* ===== NAVIGATION LINKS ===== */
.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin: 0 auto;
    flex-shrink: 1;
    min-width: 0;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    padding: 0.5rem 0;
    position: relative;
    transition: all 0.3s ease;
    opacity: 0.8;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-links a:hover {
    opacity: 1;
    color: var(--primary-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
    border-radius: 1px;
}

.nav-links a:hover::after {
    width: 100%;
}

/* ===== AUTH BUTTONS ===== */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

/* Base button styles */
.btn {
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
    font-family: inherit;
}

/* Primary button */
.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 10px rgba(126, 87, 194, 0.3);
}

.btn-primary:hover {
    background: var(--accent-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(126, 87, 194, 0.4);
}

/* Secondary button */
.btn-secondary {
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--surface-color);
    border-color: var(--primary-color);
}

/* Profile button */
.btn-profile {
    background: var(--surface-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    font-weight: 500;
}

.btn-profile:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Admin button */
.btn-admin {
    background: linear-gradient(135deg, #ff6b9d 0%, #ff8eb4 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(255, 107, 157, 0.3);
    font-weight: 600;
}

.btn-admin:hover {
    background: linear-gradient(135deg, #ff8eb4 0%, #ff6b9d 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
}

/* ===== HAMBURGER MENU ===== */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    position: relative;
    z-index: 1001;
    flex-shrink: 0;
}

.hamburger span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--text-color);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ===== MOBILE MENU - ИСПРАВЛЕННАЯ ВЕРСИЯ ===== */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--surface-color);
    z-index: 999;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    padding: 80px 2rem 2rem 2rem;
    overflow-y: auto;
}

[data-theme="dark"] .mobile-menu {
    background: var(--surface-color);
}

.mobile-menu.active {
    display: flex;
}

.mobile-menu a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
    max-width: 280px;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.mobile-menu a:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Admin button in mobile menu */
.btn-admin-mobile {
    background: linear-gradient(135deg, #ff6b9d 0%, #ff8eb4 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1.1rem;
    margin: 0.5rem 0;
    text-align: center;
    width: 100%;
    max-width: 280px;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
    border: none;
}

.btn-admin-mobile:hover {
    background: linear-gradient(135deg, #ff8eb4 0%, #ff6b9d 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.4);
}

.mobile-auth {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 280px;
    padding-top: 2rem;
}

.mobile-auth .btn {
    width: 100%;
    justify-content: center;
    font-size: 1.1rem;
    padding: 1rem 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 1000;
}

.toggle-btn {
    width: 60px;
    height: 32px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.toggle-btn::before {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    border-radius: 50%;
    top: 3px;
    left: 4px;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .toggle-btn::before {
    transform: translateX(26px);
    background: var(--accent-color);
}

.toggle-icon {
    font-size: 14px;
    color: var(--text-color);
    opacity: 0.7;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 968px) {
    nav {
        padding: 1rem 1.5rem;
        gap: 1.5rem;
    }
    
    .logo-text-full {
        font-size: 1.6rem;
    }
    
    .nav-links {
        gap: 1.5rem;
    }
    
    .nav-links a {
        font-size: 0.95rem;
    }
    
    .auth-buttons {
        gap: 0.8rem;
    }
    
    .btn {
        padding: 7px 16px;
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-links, .auth-buttons {
        display: none;
    }

    nav {
        padding: 1rem;
        position: relative;
        z-index: 1002;
    }

    .logo-text-full {
        font-size: 1.4rem;
    }

    .logo-icon {
        width: 32px;
        height: 32px;
    }
    
    .logo-icon::before {
        font-size: 1rem;
    }
    
    .btn-admin {
        display: none;
    }
    
    .mobile-menu {
        padding-top: 70px;
    }
    
    .mobile-menu a, .mobile-menu .btn {
        font-size: 1.1rem;
        padding: 0.9rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .logo-text-full {
        font-size: 1.2rem;
    }
    
    .mobile-menu {
        padding: 60px 1rem 1rem 1rem;
    }
    
    .mobile-menu a, .mobile-menu .btn {
        font-size: 1rem;
        padding: 0.8rem 1.2rem;
        max-width: 100%;
    }
    
    .btn-admin-mobile {
        font-size: 1rem;
        padding: 0.8rem 1.2rem;
        max-width: 100%;
    }
    
    .mobile-auth {
        max-width: 100%;
    }
    
    .mobile-auth .btn {
        font-size: 0.95rem;
        padding: 0.8rem 1.2rem;
    }
    
    .theme-toggle {
        bottom: 20px;
        right: 20px;
    }
    
    .toggle-btn {
        width: 50px;
        height: 28px;
    }
    
    .toggle-btn::before {
        width: 20px;
        height: 20px;
        top: 3px;
        left: 3px;
    }
    
    [data-theme="dark"] .toggle-btn::before {
        transform: translateX(22px);
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    .btn, .mobile-menu a, .hamburger span, .toggle-btn {
        transition: none;
    }
}

/* Focus styles for accessibility */
button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .theme-toggle,
    .hamburger,
    .auth-buttons {
        display: none !important;
    }
    
    header {
        position: static;
        background: white !important;
        border-bottom: 1px solid #ccc;
    }
}