/* Stats Page Styles */

.stats-hero {
    text-align: center;
    margin: 20px 0 35px 0;
}

.stats-hero h1 {
    font-size: 2.2rem;
    margin: 0 0 10px 0;
    color: #ffffff;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 40%, #90EE90 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stats-subtitle {
    color: #999;
    font-size: 1.05rem;
    margin: 0 auto;
    max-width: 600px;
}

/* Overview Metric Cards Grid */
.stats-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 35px;
}

@media screen and (max-width: 1100px) {
    .stats-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media screen and (max-width: 580px) {
    .stats-overview-grid {
        grid-template-columns: 1fr;
    }
}

.metric-card {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    border-top: 3px solid #90EE90;
    min-width: 0;
    overflow: hidden;
}

.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
    border-color: #444;
}

.metric-icon {
    font-size: 2.2rem;
    line-height: 1;
    background: rgba(255, 255, 255, 0.04);
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.metric-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.metric-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #888;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.metric-value {
    font-size: 1.55rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.5px;
    line-height: 1.2;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 2px 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-format-ext {
    font-size: 1.55rem;
    font-weight: 700;
    color: #ffffff;
}

.top-format-count {
    font-size: 0.95rem;
    font-weight: 600;
    color: #90EE90;
    white-space: nowrap;
}

/* Category Breakdown Section */
.category-breakdown-section {
    margin-bottom: 35px;
}

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

.section-header-row h2 {
    margin: 0;
    font-size: 1.4rem;
    color: #ffffff;
}

.section-tag {
    font-size: 0.8rem;
    color: #90EE90;
    background: rgba(144, 238, 144, 0.1);
    border: 1px solid rgba(144, 238, 144, 0.25);
    padding: 4px 10px;
    border-radius: 15px;
    font-weight: 500;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

@media screen and (max-width: 1150px) {
    .categories-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media screen and (max-width: 720px) {
    .categories-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

.category-card {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    min-width: 0;
    overflow: hidden;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
    border-color: #555;
}

.category-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.cat-emoji {
    font-size: 1.8rem;
}

.cat-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cat-count {
    font-size: 1.25rem;
    font-weight: 700;
    color: #90EE90;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cat-progress-bg {
    width: 100%;
    height: 6px;
    background: #2a2a2a;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.cat-progress-bar {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #90EE90, #5cc95c);
    transition: width 0.8s ease-out;
}

.cat-subtext {
    color: #888;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cat-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 10px;
    background: #252525;
    color: #90EE90;
    border: 1px solid #3d3d3d;
    border-radius: 6px;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.category-card:hover .cat-btn {
    background: #90EE90;
    color: #121212;
    border-color: #90EE90;
}

/* Fun Facts Banner */
.fun-facts-card {
    background: linear-gradient(135deg, #1c261e 0%, #1c1c1c 100%);
    border: 1px solid rgba(144, 238, 144, 0.3);
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 35px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fun-fact-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fun-fact-badge {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #90EE90;
}

.btn-refresh-fact {
    background: #262626;
    color: #ddd;
    border: 1px solid #444;
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 0.8rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.15s;
}

.btn-refresh-fact:hover {
    background: #333;
    color: #fff;
    border-color: #666;
    transform: scale(1.03);
}

.fun-fact-content {
    margin: 0;
    font-size: 1.1rem;
    color: #f0f0f0;
    line-height: 1.5;
    font-weight: 500;
}

/* Formats Explorer Section */
.formats-explorer-section {
    margin-bottom: 40px;
}

.explorer-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.explorer-header h2 {
    margin: 0 0 4px 0;
    font-size: 1.4rem;
    color: #ffffff;
}

.explorer-desc {
    margin: 0;
    color: #888;
    font-size: 0.9rem;
}

.explorer-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ext-search-input {
    background: #252525;
    border: 1px solid #444;
    color: #ffffff;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
    width: 240px;
    outline: none;
    transition: border-color 0.2s;
}

.ext-search-input:focus {
    border-color: #90EE90;
}

.view-toggles {
    display: flex;
    background: #252525;
    border: 1px solid #3d3d3d;
    border-radius: 6px;
    overflow: hidden;
}

.view-toggle-btn {
    background: transparent;
    border: none;
    color: #aaa;
    padding: 8px 14px;
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.view-toggle-btn.active {
    background: #383838;
    color: #90EE90;
    font-weight: 600;
}

/* Formats Cards Grid */
.formats-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
}

.ext-card {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.ext-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    border-color: #4a4a4a;
}

.ext-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.ext-pill {
    font-family: monospace;
    font-weight: 700;
    font-size: 1rem;
    background: rgba(144, 238, 144, 0.12);
    color: #90EE90;
    border: 1px solid rgba(144, 238, 144, 0.25);
    padding: 3px 8px;
    border-radius: 6px;
}

.ext-icon {
    font-size: 1.3rem;
}

.ext-count {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 4px;
}

.ext-percent {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 8px;
}

.ext-progress-bg {
    width: 100%;
    height: 4px;
    background: #2a2a2a;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 12px;
}

.ext-progress-bar {
    height: 100%;
    background: #90EE90;
    border-radius: 2px;
}

.ext-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #2a2a2a;
    padding-top: 10px;
    margin-top: 4px;
}

.ext-time {
    font-size: 0.75rem;
    color: #777;
}

.ext-search-btn {
    font-size: 0.75rem;
    color: #90b8ee;
    text-decoration: none;
    font-weight: 600;
    padding: 3px 7px;
    border-radius: 4px;
    border: 1px solid rgba(144, 184, 238, 0.2);
    transition: all 0.15s;
}

.ext-search-btn:hover {
    background: rgba(144, 184, 238, 0.15);
    color: #ffffff;
    border-color: #90b8ee;
}

/* Table Wrapper & Table Enhancements */
.table-wrapper {
    background: #1e1e1e;
    border-radius: 8px;
    border: 1px solid #333;
    overflow-x: auto;
}

#stats-table {
    width: 100%;
    border-collapse: collapse;
}

#stats-table th {
    background: #252525;
    padding: 12px 16px;
    font-size: 0.85rem;
    color: #bbb;
    border-bottom: 1px solid #333;
    text-align: left;
}

#stats-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #2a2a2a;
    font-size: 0.9rem;
    color: #e0e0e0;
}

#stats-table tr:hover {
    background: #242424;
}

@media screen and (max-width: 768px) {
    .stats-hero h1 {
        font-size: 1.7rem;
    }

    .explorer-header {
        flex-direction: column;
        align-items: stretch;
    }

    .ext-search-input {
        width: 100%;
    }

    .explorer-controls {
        width: 100%;
        justify-content: space-between;
    }
}
