/* 1. base.html */
   * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            color: #333;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
        }

        /* Header */
        .main-header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 0 20px;
            position: sticky;
            top: 0;
            z-index: 1000;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
            backdrop-filter: blur(10px);
            border-bottom: 3px solid rgba(255, 255, 255, 0.1);
        }

        .header-content {
            max-width: 1400px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 15px 0;
        }

        .logo-section {
            display: flex;
            align-items: center;
            gap: 15px;
            transition: transform 0.3s ease;
        }

        .logo-section:hover {
            transform: scale(1.02);
        }

        .logo-img {
            width: 70px;
            height: 70px;
            border-radius: 50%;
            object-fit: cover;
            border: 3px solid rgba(255, 255, 255, 0.3);
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
            transition: all 0.3s ease;
        }

        .logo-img:hover {
            transform: rotate(10deg);
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
        }

        .site-title {
            font-size: 2.2rem;
            font-weight: 700;
            background: linear-gradient(90deg, #fff 0%, #f0f0f0 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            letter-spacing: 0.5px;
        }

        .site-subtitle {
            font-size: 0.9rem;
            opacity: 0.9;
            margin-top: 2px;
            font-weight: 300;
        }

        /* Навигация - ИСПРАВЛЕННЫЙ БЛОК без переносов */
        .main-nav {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .nav-menu {
            display: flex;
            list-style: none;
            gap: 8px;
            margin: 0;
            padding: 0;
            flex-wrap: nowrap;
            overflow: visible !important; /* Убираем горизонтальную прокрутку */
        }

        .nav-item-menu {
            position: relative;
            flex-shrink: 0;
        }

        .nav-link {
            color: rgb(255, 255, 255);
            text-decoration: none;
            padding: 12px 18px;
            border-radius: 25px;
            font-weight: 500;
            font-size: 0.95rem;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 8px;
            position: relative;
            overflow: hidden;
            white-space: nowrap;
            min-height: 44px;
            box-sizing: border-box;
            background: transparent;
            border: 1px solid transparent;
        }

        .nav-link:hover {
            background: rgba(102, 126, 234, 0.3); 
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
            border: 1px solid rgba(255, 255, 255, 0.3);
        }

        .nav-link.active {
            background: rgba(102, 126, 234, 0.4); 
            box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.4);
        }

        .nav-link::before,
        .nav-link::after {
            display: none;
        }

        .nav-link i,
        .nav-link span {
            position: relative;
            color: rgb(255, 255, 255);
            text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5); 
            transition: transform 0.3s ease;
        }

        .nav-link:hover i {
            transform: scale(1.1);
        }

        .nav-link:hover span {
            transform: translateX(3px);
        }

        /* === ИСПРАВЛЕННОЕ ВЫПАДАЮЩЕЕ МЕНЮ === */
        .nav-item-menu.dropdown {
            position: relative;
        }

        .dropdown-toggle {
            display: flex;
            align-items: center;
            gap: 8px;
            position: relative;
        }

        .dropdown-arrow {
            font-size: 0.7em;
            margin-left: 5px;
            transition: transform 0.3s ease;
        }

        .dropdown-menu {
            position: absolute;
            top: 100%;
            left: 0;
            background: white;
            min-width: 220px;
            border-radius: 12px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
            padding: 8px 0;
            opacity: 0;
            visibility: hidden;
            transform: translateY(10px);
            transition: all 0.3s ease;
            z-index: 10000;
            list-style: none;
            border: 1px solid rgba(0, 0, 0, 0.08);
            margin-top: 5px;
            max-height: 0;
            overflow: hidden;
        }

        /* Стрелочка сверху */
        .dropdown-menu::before {
            content: '';
            position: absolute;
            top: -6px;
            left: 20px;
            width: 12px;
            height: 12px;
            background: white;
            transform: rotate(45deg);
            border-left: 1px solid rgba(0, 0, 0, 0.08);
            border-top: 1px solid rgba(0, 0, 0, 0.08);
        }

        /* Показываем меню при наведении */
        .nav-item-menu.dropdown:hover .dropdown-menu {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
            max-height: 500px;
            overflow: visible;
        }

        .nav-item-menu.dropdown:hover .dropdown-arrow {
            transform: rotate(180deg);
        }

        /* Элементы выпадающего меню */
        .dropdown-item {
            position: relative;
        }

        .dropdown-link {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 20px;
            color: #333;
            text-decoration: none;
            transition: all 0.3s ease;
            font-size: 0.9rem;
            white-space: nowrap;
        }

        .dropdown-link:hover {
            background: rgba(102, 126, 234, 0.1);
            color: #667eea;
            padding-left: 25px;
        }

        .dropdown-link i {
            width: 16px;
            text-align: center;
            color: #667eea;
            font-size: 0.9em;
        }

        .dropdown-link.active {
            background: rgba(102, 126, 234, 0.15);
            color: #667eea;
            border-left: 3px solid #667eea;
        }

        /* Для блоков авторизации тоже убираем белый */
        .auth-link:hover {
            background: rgba(255, 255, 255, 0.1) !important;
            border-color: rgba(255, 255, 255, 0.3) !important;
        }

        .auth-link.register:hover {
            background: linear-gradient(135deg, #0da46e 0%, #2ebf88 100%) !important;
            border: none !important;
        }

        .user-info:hover {
            background: rgba(255, 255, 255, 0.2);
        }

        /* Блок авторизации */
        .auth-section {
            display: flex;
            align-items: center;
            gap: 15px;
            margin-left: 20px;
            flex-shrink: 0;
        }

        .user-info {
            display: flex;
            align-items: center;
            gap: 10px;
            background: rgba(255, 255, 255, 0.15);
            padding: 8px 16px;
            border-radius: 20px;
            backdrop-filter: blur(10px);
            transition: all 0.3s ease;
            position: relative;
            z-index: 1;
            overflow: hidden;
            white-space: nowrap;
            flex-shrink: 0;
        }

        .user-info::after {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, 
                transparent 0%,
                rgba(255, 255, 255, 0.1) 50%,
                transparent 100%);
            transition: left 0.7s ease;
            z-index: -1;
        }

        .user-info:hover::after {
            left: 100%;
        }

        .user-info:hover {
            background: rgba(255, 255, 255, 0.25);
            transform: translateY(-2px);
        }

        .user-avatar {
            width: 35px;
            height: 35px;
            border-radius: 50%;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: bold;
            border: 2px solid rgba(255, 255, 255, 0.3);
            position: relative;
            z-index: 2;
            flex-shrink: 0;
        }

        .user-name {
            font-weight: 500;
            font-size: 0.95rem;
            position: relative;
            z-index: 2;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 150px;
        }

        .auth-links {
            display: flex;
            gap: 10px;
            flex-shrink: 0;
        }

        .auth-link {
            color: white;
            text-decoration: none;
            padding: 8px 18px;
            border-radius: 20px;
            font-weight: 500;
            font-size: 0.9rem;
            transition: all 0.3s ease;
            border: 2px solid rgba(255, 255, 255, 0.3);
            position: relative;
            overflow: hidden;
            z-index: 1;
            white-space: nowrap;
            display: flex;
            align-items: center;
            gap: 6px;
            min-height: 40px;
        }

        .auth-link::after {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, 
                transparent 0%,
                rgba(255, 255, 255, 0.2) 50%,
                transparent 100%);
            transition: left 0.7s ease;
            z-index: -1;
        }

        .auth-link:hover::after {
            left: 100%;
        }

        .auth-link:hover {
            background: rgba(255, 255, 255, 0.2);
            border-color: rgba(255, 255, 255, 0.5);
            transform: translateY(-2px);
        }

        .auth-link.login {
            background: rgba(255, 255, 255, 0.1);
        }

        .auth-link.register {
            background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
            border: none;
        }

        .auth-link i {
            flex-shrink: 0;
        }

        .auth-link span {
            white-space: nowrap;
        }

        /* Мобильная навигация */
        .mobile-toggle {
            display: none;
            background: none;
            border: none;
            color: white;
            font-size: 1.5rem;
            cursor: pointer;
            padding: 10px;
            border-radius: 5px;
            position: relative;
            z-index: 1001;
            flex-shrink: 0;
        }

        .mobile-toggle:hover {
            background: rgba(255, 255, 255, 0.1);
        }

        /* Основной контент */
        .main-content {
            flex: 1;
            max-width: 1400px;
            width: 100%;
            margin: 30px auto;
            padding: 0 20px;
        }

        .content-container {
            background: white;
            border-radius: 20px;
            padding: 40px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
            border: 1px solid rgba(0, 0, 0, 0.05);
            min-height: 400px;
        }

        /* Футер */
        .main-footer {
            background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
            color: white;
            padding: 40px 20px;
            margin-top: auto;
        }

        .footer-content {
            max-width: 1400px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 20px;
        }

        .footer-logo {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .footer-logo-img {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            object-fit: cover;
        }

        .footer-title {
            font-size: 1.5rem;
            font-weight: 600;
            color: #e2e8f0;
        }

        .footer-info {
            flex: 1;
            max-width: 600px;
        }

        .footer-text {
            font-size: 0.9rem;
            line-height: 1.6;
            color: #a0aec0;
            text-align: center;
        }

        .footer-links {
            display: flex;
            gap: 20px;
        }

        .footer-link {
            color: #cbd5e0;
            text-decoration: none;
            font-size: 0.9rem;
            transition: color 0.3s ease;
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .footer-link:hover {
            color: #f7f7f7;
        }

        /* Анимации */
        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .fade-in {
            animation: fadeIn 0.6s ease-out forwards;
        }












        /* Адаптивность */
        @media (max-width: 1200px) {
            .header-content {
                flex-wrap: wrap;
                gap: 15px;
            }
            
            .nav-menu {
                order: 3;
                width: 100%;
                justify-content: center;
                margin-top: 10px;
            }
            
            .auth-section {
                order: 2;
                margin-left: auto;
            }
        }

       @media (max-width: 1024px) {
    .header-content {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 15px 0;
        position: relative;
    }
    
    .logo-section {
        flex: 1;
        min-width: 0; /* Убираем min-width */
    }
    
    .main-nav {
        flex: 0 0 100%; /* Занимает всю ширину */
        order: 3; /* Переносим навигацию на новую строку */
        margin-top: 15px;
        width: 100%;
    }
    
    .nav-menu {
        justify-content: flex-start;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        flex-wrap: nowrap;
        width: 100%;
    }
    
    .auth-section {
        order: 2;
        margin-left: auto;
        flex-shrink: 0;
    }
    
    .mobile-toggle {
        order: 2;
        margin-left: auto;
    }
}

       @media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        align-items: center;
    }
    
    .logo-section {
        flex: 1;
        min-width: 0;
    }
    
    .site-title {
        font-size: 1.5rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .site-subtitle {
        font-size: 0.7rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .logo-img {
        width: 50px;
        height: 50px;
        flex-shrink: 0;
    }
    
    .mobile-toggle {
        display: block;
        margin-left: 10px;
        order: 2;
        flex-shrink: 0;
        z-index: 1002;
    }
    
    .auth-section {
        order: 3;
        width: 100%;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .main-nav {
        order: 4;
        width: 100%;
        position: relative;
    }
    
    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        position: absolute;
        top: calc(100% + 10px);
        left: 0;
        padding: 15px;
        border-radius: 15px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        z-index: 1000;
        max-height: 70vh;
        overflow-y: auto;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-item-menu {
        width: 100%;
        margin: 2px 0;
    }
    
    .nav-link {
        justify-content: flex-start;
        border-radius: 12px;
        margin: 5px 0;
        white-space: normal;
        min-height: 44px;
        padding: 12px 15px;
        background: rgba(255, 255, 255, 0.1);
    }
    
    /* Мобильное выпадающее меню */
    .dropdown-menu {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        background: rgba(255, 255, 255, 0.15);
        box-shadow: none;
        margin: 5px 0 5px 20px !important;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        border: none;
        border-radius: 8px;
        padding: 0;
        width: calc(100% - 20px);
    }
    
    .dropdown-menu.active {
        max-height: 500px;
        padding: 5px 0;
    }
    
    .dropdown-menu::before {
        display: none;
    }
    
    .dropdown-link {
        color: white;
        padding: 10px 15px 10px 30px;
        border-left: 3px solid transparent;
    }
    
    .dropdown-link:hover {
        background: rgba(255, 255, 255, 0.2);
        padding-left: 35px;
    }
    
    /* Исправления для блока авторизации на мобильных */
    .auth-section {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
    }
    
    .user-info {
        flex: 1;
        background: rgba(255, 255, 255, 0.2);
        padding: 8px 12px;
    }
    
    .user-name {
        max-width: 120px;
        font-size: 0.85rem;
    }
    
    .user-name span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }
    
    .auth-links {
        flex-shrink: 0;
    }
    
    .auth-link {
        padding: 8px 12px;
        font-size: 0.85rem;
        min-height: 36px;
    }
    
    .auth-link span {
        display: inline;
    }
    
    .content-container {
        padding: 20px;
    }
}

       @media (max-width: 480px) {
    .logo-section {
        gap: 8px;
    }
    
    .site-title {
        font-size: 1.2rem;
    }
    
    .site-subtitle {
        font-size: 0.6rem;
    }
    
    .logo-img {
        width: 40px;
        height: 40px;
    }
    
    .mobile-toggle {
        padding: 8px;
        font-size: 1.2rem;
    }
    
    .auth-section {
        flex-direction: column;
        gap: 8px;
    }
    
    .user-info {
        width: 100%;
        justify-content: center;
    }
    
    .auth-links {
        width: 100%;
        display: flex;
        gap: 10px;
    }
    
    .auth-link {
        flex: 1;
        justify-content: center;
    }
    
    .nav-link {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    
    .content-container {
        padding: 15px;
    }
    
    .footer-title {
        font-size: 1.2rem;
    }
    
    .footer-text {
        font-size: 0.8rem;
    }
}
        /* Уведомления и статусы */
        .notification-badge {
            position: absolute;
            top: 5px;
            right: 5px;
            background: #e53e3e;
            color: white;
            font-size: 0.7rem;
            padding: 2px 6px;
            border-radius: 10px;
            animation: pulse 2s infinite;
            z-index: 3;
            white-space: nowrap;
        }

        @keyframes pulse {
            0% {
                transform: scale(1);
                box-shadow: 0 0 0 0 rgba(229, 62, 62, 0.7);
            }
            70% {
                transform: scale(1.05);
                box-shadow: 0 0 0 10px rgba(229, 62, 62, 0);
            }
            100% {
                transform: scale(1);
                box-shadow: 0 0 0 0 rgba(229, 62, 62, 0);
            }
        }