/* Statistics Page Specific Styles */

/* Navigation */
.main-nav {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-top: 20px;
}

.nav-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s;
    background: rgba(79, 70, 229, 0.1);
}

.nav-link:hover {
    background: var(--primary);
    color: white;
    transform: translateX(-3px);
}

/* Hero Section */
.stats-hero {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 16px;
    color: white;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.stats-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: float 20s infinite ease-in-out;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.stats-hero h1 {
    font-size: 42px;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.hero-subtitle {
    font-size: 18px;
    opacity: 0.95;
    margin-bottom: 20px;
}

.last-updated {
    font-size: 14px;
    opacity: 0.8;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.metric-card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
    border: 2px solid transparent;
}

body.dark-mode .metric-card {
    background: var(--card-bg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(79, 70, 229, 0.15);
    border-color: var(--primary);
}

.metric-card.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08); }
    50% { box-shadow: 0 4px 30px rgba(79, 70, 229, 0.2); }
    100% { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08); }
}

.metric-icon {
    font-size: 36px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 12px;
}

.metric-content {
    flex: 1;
}

.metric-value {
    font-size: 32px;
    font-weight: bold;
    color: var(--text);
    line-height: 1;
    margin-bottom: 5px;
}

.metric-label {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 5px;
}

.metric-change {
    font-size: 12px;
    color: #9ca3af;
}

.success-rate {
    color: #10b981;
    font-weight: 500;
}

.trend-up {
    color: #10b981;
}

.trend-down {
    color: #ef4444;
}

/* Charts */
.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.chart-container-wrapper {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

body.dark-mode .chart-container-wrapper {
    background: var(--card-bg);
}

.chart-container-wrapper h2 {
    margin-bottom: 20px;
    color: var(--primary);
    font-size: 20px;
}

.chart-container {
    position: relative;
    height: 250px;
}

/* Activity Feed */
.activity-section {
    background: white;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

body.dark-mode .activity-section {
    background: var(--card-bg);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    color: var(--primary);
    font-size: 20px;
    margin: 0;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ef4444;
    font-size: 14px;
    font-weight: 500;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.activity-feed {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    gap: 20px;
    padding: 15px;
    border-bottom: 1px solid #e5e7eb;
    transition: background 0.3s;
}

body.dark-mode .activity-item {
    border-bottom-color: #374151;
}

.activity-item:hover {
    background: rgba(79, 70, 229, 0.05);
}

.activity-time {
    min-width: 80px;
    color: #6b7280;
    font-size: 14px;
}

.activity-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
}

.activity-tiles {
    font-family: monospace;
    background: #f3f4f6;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
}

body.dark-mode .activity-tiles {
    background: #374151;
}

.activity-dict {
    color: #6b7280;
    font-size: 14px;
}

.activity-status {
    font-size: 18px;
}

.activity-status.success {
    color: #10b981;
}

.activity-status.failed {
    color: #ef4444;
}

/* Stats Grid */
.stats-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.stats-panel {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

body.dark-mode .stats-panel {
    background: var(--card-bg);
}

.stats-panel h2 {
    color: var(--primary);
    font-size: 20px;
    margin-bottom: 20px;
}

/* Config Grid */
.config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.config-card {
    padding: 15px;
    background: #f9fafb;
    border-radius: 12px;
}

body.dark-mode .config-card {
    background: var(--bg-dark);
}

.config-card h3 {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Dictionary Bars */
#dictionary-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dict-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dict-name {
    font-size: 13px;
    min-width: 100px;
    color: var(--text);
}

.dict-bar-container {
    flex: 1;
    height: 20px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

body.dark-mode .dict-bar-container {
    background: #374151;
}

.dict-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border-radius: 10px;
    transition: width 0.5s ease;
}

.dict-count {
    font-size: 12px;
    color: #6b7280;
    min-width: 30px;
    text-align: right;
}

/* Modern Table */
.table-wrapper {
    overflow-x: auto;
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
}

.modern-table thead tr {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.modern-table th {
    color: white;
    padding: 12px;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
}

.modern-table td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
}

body.dark-mode .modern-table td {
    border-bottom-color: #374151;
}

.modern-table tbody tr:hover {
    background: rgba(79, 70, 229, 0.05);
}

.loading-cell {
    text-align: center;
    color: #9ca3af;
    padding: 20px !important;
}

/* Heatmap */
.heatmap-section {
    background: white;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

body.dark-mode .heatmap-section {
    background: var(--card-bg);
}

.heatmap-section h2 {
    color: var(--primary);
    font-size: 20px;
    margin-bottom: 20px;
}

.heatmap-container {
    display: grid;
    grid-template-columns: auto repeat(24, 1fr);
    gap: 3px;
    margin-bottom: 15px;
}

.heatmap-day-label {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    font-size: 12px;
    color: #6b7280;
}

.heatmap-hour {
    aspect-ratio: 1;
    background: var(--primary);
    border-radius: 4px;
    opacity: 0.1;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
}

.heatmap-hour:hover {
    transform: scale(1.2);
    z-index: 10;
}

.heatmap-hour-label {
    font-size: 10px;
    color: #6b7280;
    text-align: center;
}

.heatmap-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 12px;
    color: #6b7280;
}

.legend-squares {
    display: flex;
    gap: 3px;
}

.legend-square {
    width: 16px;
    height: 16px;
    background: var(--primary);
    border-radius: 3px;
}

/* Fun Facts */
.fun-facts {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 40px;
}

body.dark-mode .fun-facts {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg-dark) 100%);
}

.fun-facts h2 {
    text-align: center;
    color: var(--primary);
    font-size: 24px;
    margin-bottom: 30px;
}

.facts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.fact-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s;
}

body.dark-mode .fact-card {
    background: var(--card-bg);
}

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

.fact-emoji {
    font-size: 32px;
    margin-bottom: 10px;
}

.fact-text strong {
    display: block;
    font-size: 24px;
    color: var(--primary);
    margin-bottom: 5px;
}

.fact-text span {
    font-size: 12px;
    color: #6b7280;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stats-hero h1 {
        font-size: 28px;
    }

    .charts-row {
        grid-template-columns: 1fr;
    }

    .stats-grid-2 {
        grid-template-columns: 1fr;
    }

    .config-grid {
        grid-template-columns: 1fr;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .facts-grid {
        grid-template-columns: 1fr;
    }
}