/* Стили для страницы статистики в матричном стиле */

/* CSS переменные для единообразия с главной страницей */
:root {
    --base-bg: #151F28;
    --matrix-color: #00ff00;
    --active-color: #29fd53;
}

/* Убираем переопределение глобальных стилей .content */

.statistics-container {
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
    background: rgba(21, 31, 40, 0.95);
    border: 1px solid rgba(0, 255, 0, 0.4);
    border-radius: 15px;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0, 255, 0, 0.3);
    
    /* Safe Area Insets для Telegram Mini App */
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
}

.statistics-container h1 {
    text-align: center;
    margin-bottom: 40px;
    color: var(--active-color);
    font-size: 32px;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
    width: 100%;
}

.stat-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 20px;
    padding: 35px 25px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0, 255, 0, 0.2);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(15px);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(0, 255, 0, 0.1),
        transparent
    );
    transition: left 0.6s ease;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card:hover {
    transform: translateY(-8px);
    border-color: var(--active-color);
    box-shadow: 0 15px 40px rgba(0, 255, 0, 0.4);
    background: rgba(0, 255, 0, 0.05);
}

.stat-icon {
    font-size: 40px;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 10px rgba(0, 255, 0, 0.3));
}

.stat-number {
    font-size: 42px;
    font-weight: 800;
    color: var(--active-color);
    margin-bottom: 15px;
    text-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
    -webkit-text-stroke: 0.5px rgba(0, 255, 0, 0.3);
}

.stat-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.chart-container {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 20px;
    padding: 35px;
    box-shadow: 0 8px 25px rgba(0, 255, 0, 0.2);
    backdrop-filter: blur(15px);
}

.chart-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--active-color);
    font-size: 24px;
    font-weight: 600;
    text-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
}

.chart-placeholder {
    text-align: center;
    padding: 50px;
    color: rgba(255, 255, 255, 0.7);
    border: 2px dashed rgba(0, 255, 0, 0.4);
    border-radius: 15px;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.chart-placeholder p {
    font-size: 18px;
    margin: 0;
    font-style: italic;
}

/* Анимации для карточек */
@keyframes cardGlow {
    0%, 100% {
        box-shadow: 0 8px 25px rgba(0, 255, 0, 0.2);
    }
    50% {
        box-shadow: 0 8px 25px rgba(0, 255, 0, 0.4);
    }
}

.stat-card:nth-child(1) {
    animation: cardGlow 3s ease-in-out infinite;
}

.stat-card:nth-child(2) {
    animation: cardGlow 3s ease-in-out infinite 0.5s;
}

.stat-card:nth-child(3) {
    animation: cardGlow 3s ease-in-out infinite 1s;
}

.stat-card:nth-child(4) {
    animation: cardGlow 3s ease-in-out infinite 1.5s;
}

.stat-card:nth-child(5) {
    animation: cardGlow 3s ease-in-out infinite 2s;
}

.stat-card:nth-child(6) {
    animation: cardGlow 3s ease-in-out infinite 2.5s;
}

.stat-card:nth-child(7) {
    animation: cardGlow 3s ease-in-out infinite 3s;
}

.stat-card:nth-child(8) {
    animation: cardGlow 3s ease-in-out infinite 3.5s;
}

/* Специальные стили для карточки с любимой темой */
.stat-card:nth-child(8) .stat-number {
    font-size: 18px;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
}

/* Прогресс по темам */
.topic-progress-section {
    margin-top: 40px;
}

.topic-progress-section h2 {
    color: var(--active-color);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 25px;
    text-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
}

.topic-progress-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.topic-progress-item {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.topic-progress-item:hover {
    border-color: var(--active-color);
    box-shadow: 0 5px 20px rgba(0, 255, 0, 0.3);
    transform: translateY(-2px);
}

.topic-name {
    color: var(--active-color);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

.topic-progress-bar {
    position: relative;
    height: 30px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid rgba(0, 255, 0, 0.2);
}

.topic-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, rgba(0, 255, 0, 0.3), rgba(41, 253, 83, 0.6));
    border-radius: 15px;
    transition: width 0.6s ease;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.topic-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
}

/* Достижения */
.achievements-section {
    margin-top: 40px;
}

.achievements-section h2 {
    color: var(--active-color);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 25px;
    text-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
}

.achievement-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
}

.achievement-card.unlocked {
    border-color: var(--active-color);
    box-shadow: 0 5px 20px rgba(0, 255, 0, 0.4);
}

.achievement-card.locked {
    opacity: 0.5;
    filter: grayscale(0.8);
}

.achievement-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 255, 0, 0.5);
}

.achievement-icon {
    font-size: 48px;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 10px rgba(0, 255, 0, 0.5));
}

.achievement-name {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.achievement-status {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
}

/* Пустое состояние */
.empty-state-container {
    text-align: center;
    padding: 60px 20px;
    margin-top: 40px;
    background: rgba(0, 0, 0, 0.2);
    border: 2px dashed rgba(0, 255, 0, 0.3);
    border-radius: 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.6;
}

.empty-state-container p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    margin: 10px 0;
}

.empty-hint {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

/* Адаптивность */
@media (max-width: 768px) {
    .statistics-container {
        padding: 20px;
        
        /* Safe Area Insets для мобильных */
        padding-top: max(20px, env(safe-area-inset-top));
        padding-bottom: max(20px, env(safe-area-inset-bottom));
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }
    
    .statistics-container h1 {
        font-size: 28px;
        margin-bottom: 30px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 15px;
        margin-bottom: 40px;
    }
    
    .stat-card {
        padding: 20px 15px;
        border-radius: 15px;
    }
    
    .stat-icon {
        font-size: 28px;
        margin-bottom: 12px;
    }
    
    .stat-number {
        font-size: 28px;
        margin-bottom: 10px;
    }
    
    .stat-label {
        font-size: 13px;
    }
    
    .chart-container {
        padding: 20px;
        border-radius: 15px;
    }
    
    .chart-container h2 {
        font-size: 18px;
        margin-bottom: 20px;
    }
    
    .chart-placeholder {
        padding: 30px 20px;
    }
    
    .chart-placeholder p {
        font-size: 14px;
    }
    
    .topic-progress-section h2,
    .achievements-section h2 {
        font-size: 20px;
    }
    
    .topic-name {
        font-size: 16px;
    }
    
    .achievements-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .achievement-icon {
        font-size: 40px;
    }
    
}

@media (max-width: 480px) {
    .statistics-container {
        padding: 15px;
        
        /* Safe Area Insets для очень маленьких экранов */
        padding-top: max(15px, env(safe-area-inset-top));
        padding-bottom: max(15px, env(safe-area-inset-bottom));
        padding-left: max(15px, env(safe-area-inset-left));
        padding-right: max(15px, env(safe-area-inset-right));
    }
    
    .statistics-container h1 {
        font-size: 24px;
        margin-bottom: 25px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-bottom: 30px;
    }
    
    .stat-card {
        padding: 15px 10px;
    }
    
    .stat-icon {
        font-size: 24px;
        margin-bottom: 8px;
    }
    
    .stat-number {
        font-size: 20px;
        margin-bottom: 8px;
    }
    
    .stat-label {
        font-size: 11px;
        line-height: 1.2;
    }
    
    .chart-container {
        padding: 15px;
    }
    
    .chart-container h2 {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    .chart-placeholder {
        padding: 20px 15px;
    }
    
    .chart-placeholder p {
        font-size: 12px;
    }
    
    .topic-progress-section h2,
    .achievements-section h2 {
        font-size: 18px;
    }
    
    .topic-name {
        font-size: 14px;
    }
    
    .topic-progress-bar {
        height: 25px;
    }
    
    .topic-progress-text {
        font-size: 12px;
    }
    
    .achievements-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .achievement-card {
        padding: 12px;
    }
    
    .achievement-icon {
        font-size: 32px;
    }
    
    .achievement-name {
        font-size: 12px;
    }
    
    .empty-state-container {
        padding: 40px 15px;
    }
    
    .empty-icon {
        font-size: 48px;
    }
    
}

/* Специальные стили для разных типов статистики */
.stat-card:nth-child(1) .stat-icon {
    color: #4ade80; /* Зеленый для общего количества */
}

.stat-card:nth-child(2) .stat-icon {
    color: #22c55e; /* Зеленый для правильных ответов */
}

.stat-card:nth-child(3) .stat-icon {
    color: #ef4444; /* Красный для неправильных ответов */
}

.stat-card:nth-child(4) .stat-icon {
    color: #3b82f6; /* Синий для точности */
}

.stat-card:nth-child(5) .stat-icon {
    color: #f59e0b; /* Оранжевый для текущей серии */
}

.stat-card:nth-child(6) .stat-icon {
    color: #fbbf24; /* Желтый для лучшей серии */
}

.stat-card:nth-child(7) .stat-icon {
    color: #a855f7; /* Фиолетовый для очков */
}

.stat-card:nth-child(8) .stat-icon {
    color: #ec4899; /* Розовый для любимой темы */
}

/* Эффекты при наведении для иконок */
.stat-card:hover .stat-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 0 15px rgba(0, 255, 0, 0.5));
}

/* Дополнительные эффекты для активных карточек */
.stat-card.active {
    background: rgba(0, 255, 0, 0.1);
    border-color: var(--active-color);
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.3);
}

.stat-card.active .stat-number {
    color: #fff;
    text-shadow: 0 0 20px rgba(0, 255, 0, 0.8);
}




