/**
 * Statistics Modal Styles
 * Slide-out modal for user statistics display
 */

/* Modal Container */
.statistics-modal {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.statistics-modal.active {
    visibility: visible;
    opacity: 1;
}

/* Modal Overlay */
.statistics-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

/* Modal Content */
.statistics-modal-content {
    position: absolute;
    top: 0;
    right: 0;
    width: min(500px, 90vw);
    height: 100%;
    background: var(--panel-bg);
    border-left: 1px solid var(--border-color);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
}

.statistics-modal.active .statistics-modal-content {
    transform: translateX(0);
}

/* Modal Header */
.statistics-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
}

.statistics-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.statistics-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.statistics-modal-close:hover {
    background: var(--glass-bg);
    color: var(--text-primary);
    transform: scale(1.1);
}

/* Modal Body */
.statistics-modal-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) var(--glass-bg);
}

.statistics-modal-body::-webkit-scrollbar {
    width: 6px;
}

.statistics-modal-body::-webkit-scrollbar-track {
    background: var(--glass-bg);
    border-radius: 3px;
}

.statistics-modal-body::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 3px;
}

.statistics-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

/* Loading State */
.stats-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--glass-border);
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.stats-loading p {
    margin: 0;
    font-size: 14px;
}

/* Statistics Content Styles */
.statistics-modal-body .stats-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.statistics-modal-body .stats-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.statistics-modal-body .stats-header .stats-icon {
    font-size: 20px;
}

.statistics-modal-body .stats-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Streak Display */
.statistics-modal-body .streak-display {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    backdrop-filter: blur(10px);
    margin-bottom: 20px;
}

.statistics-modal-body .streak-flame {
    font-size: 32px;
    margin-bottom: 8px;
}

.statistics-modal-body .streak-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 4px;
}

.statistics-modal-body .streak-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Stats Grid */
.statistics-modal-body .stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.statistics-modal-body .stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 16px 12px;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: transform 0.2s ease, background-color 0.2s ease;
    cursor: help;
}

.statistics-modal-body .stat-card:hover {
    transform: translateY(-2px);
    background: var(--glass-border);
}

.statistics-modal-body .stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 4px;
}

.statistics-modal-body .stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Progress Stats */
.statistics-modal-body .progress-stat {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 16px;
    backdrop-filter: blur(10px);
    margin-bottom: 20px;
}

.statistics-modal-body .progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.statistics-modal-body .progress-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.statistics-modal-body .progress-value {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
}

.statistics-modal-body .progress-bar {
    height: 6px;
    background: var(--glass-border);
    border-radius: 3px;
    overflow: hidden;
}

.statistics-modal-body .progress-fill {
    height: 100%;
    background: var(--accent-color);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Expert Breakdown */
.statistics-modal-body .expert-breakdown {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 16px;
    backdrop-filter: blur(10px);
    margin-bottom: 20px;
}

.statistics-modal-body .expert-breakdown h5 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.statistics-modal-body .expert-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.statistics-modal-body .expert-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--glass-border);
}

.statistics-modal-body .expert-item:last-child {
    border-bottom: none;
}

.statistics-modal-body .expert-name {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

.statistics-modal-body .expert-count {
    font-size: 12px;
    color: var(--accent-color);
    font-family: 'Courier New', monospace;
}

/* Achievements Section */
.statistics-modal-body .achievements-section {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 16px;
    backdrop-filter: blur(10px);
    margin-bottom: 20px;
}

.statistics-modal-body .achievements-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.statistics-modal-body .achievements-header h5 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.statistics-modal-body .achievements-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.statistics-modal-body .achievement-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    background: var(--glass-border);
    border-radius: 6px;
    transition: transform 0.2s ease;
}

.statistics-modal-body .achievement-item:hover {
    transform: translateX(2px);
}

.statistics-modal-body .achievement-icon {
    font-size: 16px;
}

.statistics-modal-body .achievement-text {
    flex: 1;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Featured Stats */
.statistics-modal-body .featured-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.statistics-modal-body .featured-stat {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    backdrop-filter: blur(10px);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .statistics-modal-content {
        width: 100vw;
        border-left: none;
    }
    
    .statistics-modal-header {
        padding: 16px 20px;
    }
    
    .statistics-modal-body {
        padding: 20px;
    }
    
    .statistics-modal-body .stats-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .statistics-modal-body .stat-card {
        padding: 12px;
    }
    
    .statistics-modal-body .streak-display {
        padding: 16px;
    }
    
    .statistics-modal-body .streak-number {
        font-size: 24px;
    }
}

/* Dark/Light Theme Compatibility */
[data-theme="light"] .statistics-modal-content {
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .loading-spinner {
    border-color: var(--glass-border);
    border-top-color: var(--accent-color);
}