﻿/* ========================================================================== 
   СОВРЕМЕННЫЙ LAYOUT - ОСНОВНЫЕ СТИЛИ 
   ========================================================================== */

:root {
    --primary-color: #6c5ce7;
    --primary-light: #8b7cf0;
    --primary-dark: #4a3bb5;
    --secondary-color: #00d2ff;
    --success-color: #00b894;
    --warning-color: #fdcb6e;
    --danger-color: #d63031;
    --dark-bg: #0a0c14;
    --surface-bg: #121620;
    --surface-light: #1e2430;
    --text-primary: #ffffff;
    --text-secondary: #d1d5e0;
    --text-muted: #9aa1b5;
    --border-color: rgba(255, 255, 255, 0.12);
    --border-light: rgba(255, 255, 255, 0.08);
    --shadow-sm: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --gradient-1: linear-gradient(135deg, #6c5ce7 0%, #00d2ff 100%);
    --gradient-2: linear-gradient(135deg, #00b894 0%, #00d2ff 100%);
}

/* ========================================================================== 
   ГЛОБАЛЬНЫЕ СТИЛИ
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    max-width: 100%;
    background-color: var(--dark-bg);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

/* ========================================================================== 
   НАВИГАЦИЯ 
   ========================================================================== */

.main-navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(10, 12, 20, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
    width: 100%;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
    transition: var(--transition);
}

    .nav-logo:hover {
        transform: translateY(-1px);
    }

.logo-icon {
    font-size: 1.8rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-text {
    background: linear-gradient(135deg, #fff 0%, #d1d5e0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.6rem 1.2rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    border-radius: 30px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

    .nav-link::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: var(--primary-color);
        opacity: 0.1;
        transform: translate(-50%, -50%);
        transition: width 0.6s, height 0.6s;
        z-index: -1;
    }

    .nav-link:hover::before,
    .nav-link.active::before {
        width: 200px;
        height: 200px;
    }

    .nav-link:hover,
    .nav-link.active {
        color: var(--text-primary);
    }

.nav-link-highlight {
    background: var(--gradient-1);
    color: white !important;
}

    .nav-link-highlight::before {
        display: none;
    }

    .nav-link-highlight:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 20px rgba(108, 92, 231, 0.3);
    }

/* ========================================================================== 
   ВЫПАДАЮЩЕЕ МЕНЮ ПОЛЬЗОВАТЕЛЯ 
   ========================================================================== */

.nav-user {
    margin-left: 1rem;
}

.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 1rem 0.4rem 0.4rem;
    background: var(--surface-light);
    border: 1px solid var(--border-color);
    border-radius: 40px;
    cursor: pointer;
    transition: var(--transition);
    min-width: 140px;
    position: relative;
    z-index: 1001;
}

    .user-button:hover {
        background: var(--surface-bg);
        border-color: var(--primary-color);
    }

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--gradient-1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.user-name {
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.dropdown-arrow {
    color: var(--text-secondary);
    transition: transform var(--transition);
    margin-left: auto;
    flex-shrink: 0;
}

.user-dropdown.show .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 240px;
    background: var(--surface-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.user-dropdown.show .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    width: 100%;
    border: none;
    background: none;
    font-size: 0.95rem;
    cursor: pointer;
}

    .dropdown-item:hover {
        background: var(--surface-light);
        color: var(--text-primary);
    }

    .dropdown-item svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }

    .dropdown-item.text-danger:hover {
        background: rgba(214, 48, 49, 0.15);
        color: #ff6b6b;
    }

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

/* ========================================================================== 
   МОБИЛЬНОЕ МЕНЮ 
   ========================================================================== */

.nav-mobile-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
    position: relative;
    z-index: 1002;
}

    .nav-mobile-btn span {
        width: 100%;
        height: 2px;
        background: var(--text-primary);
        transition: var(--transition);
        border-radius: 2px;
        display: block;
    }

    .nav-mobile-btn:hover span {
        background: var(--primary-color);
    }

    .nav-mobile-btn.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .nav-mobile-btn.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-mobile-btn.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

/* ========================================================================== 
   ОСНОВНОЙ КОНТЕНТ 
   ========================================================================== */

.main-content {
    min-height: calc(100vh - 160px);
    background: var(--dark-bg);
    padding: 2rem 0;
    width: 100%;
}

/* ========================================================================== 
   АЛЕРТЫ 
   ========================================================================== */

.alert {
    max-width: 1400px;
    margin: 0 auto 1.5rem;
    padding: 1rem 1.5rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideIn 0.3s ease;
    box-shadow: var(--shadow-md);
    width: calc(100% - 4rem);
}

.alert-success {
    background: linear-gradient(135deg, rgba(0, 184, 148, 0.2), rgba(0, 184, 148, 0.1));
    border: 1px solid rgba(0, 184, 148, 0.3);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(214, 48, 49, 0.2), rgba(214, 48, 49, 0.1));
    border: 1px solid rgba(214, 48, 49, 0.3);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(253, 203, 110, 0.2), rgba(253, 203, 110, 0.1));
    border: 1px solid rgba(253, 203, 110, 0.3);
}

.alert-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.alert-content {
    flex: 1;
    color: var(--text-primary);
    font-weight: 500;
}

.alert-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 0.5rem;
    transition: var(--transition);
}

    .alert-close:hover {
        color: var(--text-primary);
        transform: scale(1.1);
    }

/* ========================================================================== 
   ФУТЕР 
   ========================================================================== */

.main-footer {
    background: var(--surface-bg);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 2rem;
    width: 100%;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-logo {
    font-size: 2rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.footer-links {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
}

    .footer-link::after {
        content: '';
        position: absolute;
        bottom: -4px;
        left: 0;
        width: 0;
        height: 2px;
        background: var(--gradient-1);
        transition: var(--transition);
    }

    .footer-link:hover {
        color: var(--text-primary);
    }

        .footer-link:hover::after {
            width: 100%;
        }

.footer-copyright {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    width: 100%;
}

/* ========================================================================== 
   АНИМАЦИИ 
   ========================================================================== */

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.fade-in {
    animation: slideIn 0.3s ease;
}

/* ========================================================================== 
   АДАПТИВНОСТЬ 
   ========================================================================== */

@media (max-width: 992px) {
    .nav-container {
        padding: 0 1rem;
    }

    .nav-mobile-btn {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--dark-bg);
        flex-direction: column;
        align-items: stretch;
        padding: 2rem;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        z-index: 999;
        height: calc(100vh - 72px);
    }

        .nav-menu.show {
            transform: translateX(0);
        }

    .nav-list {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        max-height: none;
        overflow-y: visible;
    }

    .nav-link {
        justify-content: center;
        padding: 1rem;
        width: 100%;
    }

    .nav-user {
        margin-left: 0;
        margin-top: 1rem;
        width: 100%;
    }

    .user-dropdown {
        width: 100%;
    }

    .user-button {
        width: 100%;
        justify-content: center;
    }

    .dropdown-menu {
        position: absolute;
        width: 240px;
        left: auto;
        right: 0;
        top: 100%;
        margin-top: 0.5rem;
        z-index: 1001;
    }

    .footer-links {
        gap: 1rem;
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 768px) {
    .logo-text {
        display: none;
    }

    .alert {
        margin: 0 1rem 1rem;
        padding: 0.75rem 1rem;
        width: calc(100% - 2rem);
    }

    .user-button {
        min-width: auto;
        padding: 0.4rem;
    }

    .user-name {
        display: none;
    }

    .dropdown-arrow {
        display: none;
    }

    .dropdown-menu {
        width: 200px;
    }
}

@media (max-width: 480px) {
    .footer-brand {
        flex-direction: column;
        text-align: center;
    }

    .dropdown-menu {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        width: 100%;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        z-index: 1002;
    }

    .user-dropdown.show .dropdown-menu {
        transform: translateY(0);
    }

    .dropdown-item {
        padding: 1rem;
        justify-content: center;
    }

    .nav-menu {
        padding: 1rem;
    }
}
