/* Базовые стили */
:root {
    --primary: #2c3e50;
    --secondary: #3498db;
    --accent: #e74c3c;
    --light: #ecf0f1;
    --dark: #2c3e50;
    --success: #27ae60;
    --warning: #f39c12;
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Навигация */
.navbar {
    background: white;
    box-shadow: var(--shadow);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: bold;
}

.logo i {
    margin-right: 10px;
    color: var(--secondary);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: var(--light);
    color: var(--secondary);
}

/* Кнопки авторизации */
.auth-section {
    display: flex;
    gap: 15px;
    align-items: center;
}

.btn {
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-login {
    background: transparent;
    border: 2px solid var(--secondary);
    color: var(--secondary);
}

.btn-login:hover {
    background: var(--secondary);
    color: white;
}

.btn-register {
    background: var(--secondary);
    border: 2px solid var(--secondary);
    color: white;
}

.btn-register:hover {
    background: var(--primary);
    border-color: var(--primary);
}



.hero {
    background: white;
    border-radius: 10px;
    padding: 60px 20px;
    margin: 20px;
    box-shadow: var(--shadow);
    text-align: center;
}

.hero h1 {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 2.5rem;
}

.subtitle {
    color: #666;
    font-size: 1.2rem;
    margin-bottom: 40px;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.feature-card {
    padding: 30px;
    background: var(--light);
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card i {
    font-size: 2.5rem;
    color: var(--secondary);
    margin-bottom: 20px;
}

.feature-card h3 {
    margin-bottom: 10px;
    color: var(--primary);
}
/* Стили для нового логотипа */
.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
    margin-left: 8px;
}

.logo-brand {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1em;
}

.logo-sub {
    font-size: 0.8em;
    color: var(--secondary);
    font-weight: 500;
}

/* Для мобильных - делаем логотип компактнее */
@media (max-width: 768px) {
    .logo-text {
        display: none;     }
    
    .logo i {
        font-size: 1.8rem;
        margin-right: 0;
    }
}

/* Обновим hero-заголовок */
.hero .brand {
    color: var(--secondary);
    font-weight: 700;
}

/* Стили для выпадающего меню пользователя */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-btn {
    background: var(--light);
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-weight: 500;
    transition: all 0.3s ease;
}

.user-btn:hover {
    background: #e0e0e0;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    min-width: 180px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-radius: 5px;
    margin-top: 5px;
    display: none;
    z-index: 1000;
}

.user-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 12px 15px;
    text-decoration: none;
    color: var(--dark);
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dropdown-menu a:hover {
    background: var(--light);
    color: var(--secondary);
}

.dropdown-menu a:last-child {
    border-bottom: none;
    color: var(--accent);
}

/* Выпадающее меню пользователя */
.user-dropdown {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--light);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--primary);
    font-weight: 500;
}

.user-btn:hover {
    background: #e0e0e0;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.user-avatar i {
    font-size: 1.2rem;
}

.user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-arrow {
    font-size: 0.8rem;
    color: #777;
    transition: transform 0.3s ease;
}

.user-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

/* Выпадающее меню */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    min-width: 240px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
}

.user-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.dropdown-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropdown-avatar i {
    font-size: 1.5rem;
}

.dropdown-user-info {
    flex: 1;
}

.dropdown-user-info strong {
    display: block;
    font-size: 0.95rem;
}

.dropdown-user-info small {
    font-size: 0.8rem;
    opacity: 0.9;
}

.dropdown-divider {
    height: 1px;
    background: #eee;
    margin: 5px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--dark);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.dropdown-item:hover {
    background: #f8f9fa;
    border-left-color: var(--secondary);
    color: var(--secondary);
}

.dropdown-item i {
    width: 20px;
    color: #666;
}

.dropdown-item:hover i {
    color: var(--secondary);
}

.logout-item {
    color: #e74c3c;
}

.logout-item:hover {
    background: #ffebee;
    color: #c0392b;
    border-left-color: #e74c3c;
}

.logout-item i {
    color: #e74c3c;
}

/* === ФИКС ДЛЯ ВЫПАДАЮЩЕГО МЕНЮ === */
.user-dropdown {
    position: relative;
}

/* Убираем щель между кнопкой и меню */
.dropdown-menu {
    top: calc(100% + 1px) !important; /* Минимальный отступ */
    transition: opacity 0.1s, transform 0.1s !important; /* Мгновенное появление */
}

/* Создаем перекрывающую область */
.user-dropdown::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: -10px;
    right: -10px;
    height: 20px;
    background: transparent;
    z-index: 999;
}

/* Стили для секции статистики */
.stats-section {
    margin-top: 3rem;
    padding: 2rem 0;
}

.stats-title {
    text-align: center;
    margin-bottom: 2rem;
    color: #333;
    font-size: 1.8rem;
}

.stats-row {
    justify-content: center;
}

.stat-card {
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card .stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2c3e50;
    margin: 0.5rem 0;
}

.stat-card .stat-desc {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.stat-card i {
    font-size: 2.5rem;
    color: #3498db;
    margin-bottom: 1rem;
}

/* Стили для секции статистики */
.stats-section {
    margin-top: 3rem;
    padding: 2rem;
    background-color: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.stats-title {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
    font-size: 1.8rem;
}

.stats-row {
    justify-content: center;
}

.stat-card {
    text-align: center;
    transition: transform 0.3s ease;
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.12);
}

.stat-card .stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2c3e50;
    margin: 0.5rem 0;
}

.stat-card .stat-desc {
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.stat-card i {
    font-size: 2.5rem;
    color: #3498db;
    margin-bottom: 1rem;
}

/* Стили для кнопок действий */
.action-buttons {
    margin-top: 3rem;
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    gap: 0.5rem;
    min-width: 200px;
}

.btn-primary {
    background-color: #3498db;
    color: white;
    border: 1px solid #2980b9;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(41, 128, 185, 0.3);
}

.btn-secondary {
    background-color: #2ecc71;
    color: white;
    border: 1px solid #27ae60;
}

.btn-secondary:hover {
    background-color: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(46, 204, 113, 0.3);
}

.btn-admin {
    background-color: #9b59b6;
    color: white;
    border: 1px solid #8e44ad;
}

.btn-admin:hover {
    background-color: #8e44ad;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(155, 89, 182, 0.3);
}

/* Адаптивность */
@media (max-width: 768px) {
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .stat-card .stat-number {
        font-size: 2rem;
    }
    
    .stats-section {
        padding: 1.5rem;
    }
}

/* Анимация для чисел статистики */
@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.stat-number {
    animation: countUp 0.8s ease-out;
}

        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 20px;
        }
        
        /* Герой-секция */
        .hero {
            padding: 40px 0 20px;
        }
        
        .brand {
            font-size: 3.5rem;
            font-weight: 700;
            color: #2c3e50;
            display: block;
            text-align: center;
            margin-bottom: 10px;
            background: linear-gradient(135deg, #3498db, #2ecc71);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        
        .subtitle {
            text-align: center;
            font-size: 1.2rem;
            color: #5d6d7e;
            margin-bottom: 40px;
            max-width: 600px;
            margin-left: auto;
            margin-right: auto;
        }
        
        /* Сетка функций */
        .features {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 30px;
            margin-bottom: 50px;
        }
        
        .feature-card {
            background: white;
            border-radius: 16px;
            padding: 30px;
            text-align: center;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
            transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            border: 2px solid transparent;
            position: relative;
            overflow: hidden;
        }
        
        .feature-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: linear-gradient(90deg, #3498db, #2ecc71);
            transform: scaleX(0);
            transform-origin: left;
            transition: transform 0.4s ease;
        }
        
        .feature-card:hover {
            transform: translateY(-10px);
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
            border-color: #e8f4fc;
        }
        
        .feature-card:hover::before {
            transform: scaleX(1);
        }
        
        .feature-card i {
            font-size: 3rem;
            margin-bottom: 20px;
            color: #3498db;
            display: inline-block;
        }
        
        .feature-card h3 {
            font-size: 1.4rem;
            margin-bottom: 15px;
            color: #2c3e50;
            font-weight: 600;
        }
        
        .feature-card p {
            color: #5d6d7e;
            line-height: 1.6;
            font-size: 1rem;
            margin: 0;
        }
        
        .feature-card-link {
            text-decoration: none;
            color: inherit;
            display: block;
        }
        
        /* Заголовок раздела */
        .section-title {
            text-align: center;
            font-size: 1.8rem;
            color: #2c3e50;
            margin: 60px 0 30px;
            position: relative;
            display: inline-block;
            left: 50%;
            transform: translateX(-50%);
            padding-bottom: 10px;
        }
        
        .section-title::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: linear-gradient(90deg, #3498db, #2ecc71);
            border-radius: 3px;
        }
        
        /* Статистика */
        .stats-section {
            margin: 60px 0;
            padding: 40px 0;
            background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
            border-radius: 20px;
        }
        
        .stats-title {
            text-align: center;
            font-size: 2rem;
            color: #2c3e50;
            margin-bottom: 40px;
        }
        
        .stats-row {
            max-width: 900px;
            margin: 0 auto;
        }
        
        .stat-card {
            background: white;
            border-radius: 16px;
            padding: 25px;
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
        }
        
        .stat-card i {
            font-size: 2.5rem;
            margin-bottom: 15px;
            color: #3498db;
        }
        
        .stat-number {
            font-size: 2.5rem;
            font-weight: 700;
            color: #2c3e50;
            margin: 10px 0;
            line-height: 1;
        }
        
        .stat-desc {
            color: #5d6d7e;
            font-size: 0.95rem;
            margin: 0;
        }
        
        /* Новости */
        .news-section {
            padding: 60px 0;
            background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
        }
        
        .news-container {
            max-width: 1200px;
            margin: 0 auto;
        }
        
        .news-title {
            text-align: center;
            font-size: 2rem;
            color: #2c3e50;
            margin-bottom: 15px;
            font-weight: 700;
        }
        
        .news-subtitle {
            text-align: left;
            color: #64748b;
            font-size: 1.1rem;
            margin-bottom: 50px;
            max-width: 600px;
            margin-left: auto;
            margin-right: auto;
        }
        
        .news-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
            gap: 30px;
            margin-bottom: 40px;
        }
        
        .news-card {
            background: white;
            border-radius: 16px;
            overflow: hidden;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
            transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            border: 1px solid rgba(0,0,0,0.05);
        }
        
        .news-card:hover {
            transform: translateY(-8px);
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
        }
        
        .news-image {
            height: 200px;
            overflow: hidden;
            position: relative;
        }
        
        .news-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.6s ease;
        }
        
        .news-card:hover .news-image img {
            transform: scale(1.1);
        }
        
        .news-content {
            padding: 25px;
        }
        
        .news-category {
            display: inline-block;
            background: linear-gradient(135deg, #3498db, #2980b9);
            color: white;
            padding: 6px 14px;
            border-radius: 20px;
            font-size: 0.85rem;
            font-weight: 600;
            margin-bottom: 15px;
            text-decoration: none;
            box-shadow: 0 4px 10px rgba(52, 152, 219, 0.2);
        }
        
        .news-category:hover {
            background: linear-gradient(135deg, #2980b9, #21618c);
        }
        
        .news-card h3 {
            font-size: 1.3rem;
            margin: 0 0 10px 0;
            line-height: 1.4;
            font-weight: 600;
        }
        
        .news-card h3 a {
            color: #2c3e50;
            text-decoration: none;
            transition: color 0.3s ease;
        }
        
        .news-card h3 a:hover {
            color: #3498db;
        }
        
        .news-excerpt {
            color: #5d6d7e;
            line-height: 1.6;
            margin-bottom: 20px;
            font-size: 0.95rem;
        }
        
        .news-meta {
            display: flex;
            justify-content: space-between;
            align-items: left;
            color: #94a3b8;
            font-size: 0.9rem;
            padding-top: 15px;
            border-top: 1px solid #f1f5f9;
        }
        
        .news-date {
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        .news-views {
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        /* Кнопка Все новости */
        .all-news-btn {
            text-align: center;
            margin-top: 40px;
        }
        
        .btn-news {
            display: inline-flex;
            align-items: center;
            gap: 10px;
            background: linear-gradient(135deg, #2c3e50, #1a252f);
            color: white;
            padding: 14px 32px;
            border-radius: 30px;
            text-decoration: none;
            font-weight: 600;
            font-size: 1rem;
            transition: all 0.3s ease;
            box-shadow: 0 8px 20px rgba(44, 62, 80, 0.15);
        }
        
        .btn-news:hover {
            background: linear-gradient(135deg, #3498db, #2980b9);
            transform: translateY(-2px);
            box-shadow: 0 12px 25px rgba(52, 152, 219, 0.2);
        }
        
        /* Кэш-индикатор */
        .cache-info {
            text-align: center;
            margin-bottom: 20px;
        }
        
        .cache-badge {
            display: inline-block;
            padding: 6px 15px;
            border-radius: 20px;
            font-size: 0.85rem;
            font-weight: 500;
        }
        
        .cache-badge.cached {
            background: #d4edda;
            color: #155724;
            border: 1px solid #c3e6cb;
        }
        
        .cache-badge.db {
            background: #d1ecf1;
            color: #0c5460;
            border: 1px solid #bee5eb;
        }
        
        /* Индикатор ошибки БД */
        .db-error {
            text-align: center;
            margin-top: 20px;
            padding: 15px;
            background: #f8d7da;
            border-radius: 10px;
            max-width: 600px;
            margin-left: auto;
            margin-right: auto;
        }
        
        .db-error small {
            color: #721c24;
            font-size: 0.9rem;
        }
        
/* Исправление для мобильной статистики */
@media (max-width: 768px) {
    .stats-row {
        grid-template-columns: 1fr !important; /* Одна колонка на мобильных */
        gap: 20px !important;
    }
    
    .stat-card {
        padding: 20px !important;
    }
    
    .stat-number {
        font-size: 2rem !important;
    }
}

/* Стили для аккордеона в мобильном меню */
.mobile-menu-item.has-submenu {
    position: relative;
}

.mobile-submenu-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    cursor: pointer;
}

.mobile-submenu-toggle i:first-child {
    margin-right: 15px;
}

.mobile-submenu-toggle span {
    flex: 1;
    text-align: left;
}

.mobile-submenu-arrow {
    transition: transform 0.3s ease;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
}

.mobile-menu-item.has-submenu.active .mobile-submenu-arrow {
    transform: rotate(180deg);
}

.mobile-submenu {
    display: none;
    list-style: none;
    padding: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.2);
}

.mobile-menu-item.has-submenu.active .mobile-submenu {
    display: block;
}

.mobile-submenu li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-submenu li:last-child {
    border-bottom: none;
}

.mobile-submenu a {
    padding-left: 52px !important; /* Отступ для подпунктов */
    font-size: 14px;
}

.mobile-submenu a i {
    font-size: 14px;
    width: 20px;
    color: rgba(255, 255, 255, 0.5);
}

.mobile-submenu a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-submenu a:hover i {
    color: #4ecdc4;
}

/* Дополнительные исправления для очень маленьких экранов */
@media (max-width: 480px) {
    .stats-title {
        font-size: 1.5rem !important;
    }
    
    .stat-number {
        font-size: 1.8rem !important;
    }
    
    .stat-card i {
        font-size: 2rem !important;
    }
}

        /* Адаптивность */
        @media (max-width: 768px) {
            .brand {
                font-size: 2.5rem;
            }
            
            .subtitle {
                font-size: 1.1rem;
            }
            
            .features {
                grid-template-columns: 1fr;
                gap: 20px;
            }
            
            .feature-card {
                padding: 25px;
            }
            
            .news-grid {
                grid-template-columns: 1fr;
            }
            
            .stats-title, .news-title {
                font-size: 1.7rem;
            }
            
            .stat-number {
                font-size: 2rem;
            }
        }
        
        /* Анимации */
        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        
        .feature-card, .news-card, .stat-card {
            animation: fadeIn 0.6s ease-out forwards;
            opacity: 0;
        }
        
        .feature-card:nth-child(1) { animation-delay: 0.1s; }
        .feature-card:nth-child(2) { animation-delay: 0.2s; }
        .feature-card:nth-child(3) { animation-delay: 0.3s; }
        .feature-card:nth-child(4) { animation-delay: 0.4s; }
        .feature-card:nth-child(5) { animation-delay: 0.5s; }
        .feature-card:nth-child(6) { animation-delay: 0.6s; }
        
        .news-card:nth-child(1) { animation-delay: 0.3s; }
        .news-card:nth-child(2) { animation-delay: 0.4s; }
        .news-card:nth-child(3) { animation-delay: 0.5s; }
}
