/* ============================================
   STATISTICS VIEW STYLES
   ============================================ */

.stats-view {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

.stats-view.hidden {
    display: none;
}

/* Stats Header */
.stats-header {
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.back-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 10px 16px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-button:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: var(--primary-color);
    transform: translateX(-2px);
}

.back-button svg {
    color: var(--primary-color);
}

.stats-header h2 {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

/* Stats Section */
.stats-section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Stats Grid (Today's Summary) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

.stat-card {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2);
}

.stat-card.success {
    border-color: rgba(34, 197, 94, 0.3);
}

.stat-card.success:hover {
    border-color: var(--success-color);
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.2);
}

.stat-card.warning {
    border-color: rgba(251, 146, 60, 0.3);
}

.stat-card.warning:hover {
    border-color: var(--warning-color);
    box-shadow: 0 8px 24px rgba(251, 146, 60, 0.2);
}

.stat-card.streak {
    border-color: rgba(245, 158, 11, 0.3);
}

.stat-card.streak:hover {
    border-color: #f59e0b;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.2);
}

.stat-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Progress Overview */
.progress-overview {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 40px;
}

.progress-ring {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.stats-view .progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.progress-percentage {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.progress-sublabel {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.progress-details {
    flex: 1;
    display: grid;
    gap: 12px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-item.total {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.detail-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.detail-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.detail-value.success {
    color: var(--success-color);
}

.detail-value.warning {
    color: var(--warning-color);
}

/* Word List */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 16px;
}

.list-tabs {
    display: flex;
    gap: 8px;
    background: rgba(30, 41, 59, 0.4);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
}

.tab-button {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-button:hover {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.1);
}

.tab-button.active {
    background: var(--primary-color);
    color: white;
}

.word-list-container {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
}

.word-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.word-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.word-item:hover {
    background: rgba(15, 23, 42, 0.6);
    border-color: var(--primary-color);
    transform: translateX(4px);
}

.word-info {
    flex: 1;
}

.word-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.word-meaning {
    font-size: 14px;
    color: var(--text-secondary);
}

.word-meta {
    display: flex;
    align-items: center;
    gap: 16px;
}

.word-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.word-count {
    font-size: 12px;
    padding: 4px 8px;
    background: rgba(99, 102, 241, 0.2);
    border-radius: 6px;
    color: var(--primary-color);
    font-weight: 500;
}

.loading-state,
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state {
    font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .progress-overview {
        flex-direction: column;
        gap: 24px;
    }

    .stat-value {
        font-size: 28px;
    }

    .list-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .back-button span {
        display: none;
    }

    .stat-card {
        padding: 16px;
    }

    .word-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .word-meta {
        width: 100%;
        justify-content: space-between;
    }
}