/**
 * BMLT Enabled Stats - Frontend Display Styles
 * Modern, engaging visual design
 */

/* CSS Custom Properties */
:root {
    --blst-primary: #0073aa;
    --blst-primary-dark: #005a87;
    --blst-secondary: #23282d;
    --blst-success: #00a32a;
    --blst-warning: #dba617;
    --blst-info: #72aee6;
    --blst-light: #f6f7f7;
    --blst-border: #dcdcde;
    --blst-text: #1d2327;
    --blst-text-muted: #646970;
    --blst-white: #ffffff;
    --blst-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --blst-shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
    --blst-radius: 8px;
    --blst-radius-lg: 12px;
    --blst-transition: 0.2s ease;
}

/* Container */
.blst-stats-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: var(--blst-text);
    line-height: 1.6;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.blst-stats-container *,
.blst-stats-container *::before,
.blst-stats-container *::after {
    box-sizing: border-box;
}

/* Section Styling */
.blst-section {
    margin-bottom: 50px;
}

.blst-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 600;
    color: var(--blst-secondary);
    margin: 0 0 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--blst-light);
}

.blst-title-icon {
    width: 28px;
    height: 28px;
    color: var(--blst-primary);
}

.blst-subsection-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--blst-secondary);
    margin: 0 0 16px;
}

/* Hero Stats Cards */
.blst-hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.blst-hero-small .blst-hero-card {
    padding: 20px;
}

.blst-hero-card {
    background: var(--blst-white);
    border-radius: var(--blst-radius-lg);
    padding: 24px;
    box-shadow: var(--blst-shadow);
    transition: transform var(--blst-transition), box-shadow var(--blst-transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.blst-hero-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--blst-shadow-lg);
}

.blst-card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 16px;
}

.blst-card-icon svg {
    width: 28px;
    height: 28px;
}

/* Card icon colors */
.blst-card-meetings .blst-card-icon { background: #e8f5e9; color: #2e7d32; }
.blst-card-servers .blst-card-icon { background: #e3f2fd; color: #1565c0; }
.blst-card-stars .blst-card-icon { background: #fff8e1; color: #f9a825; }
.blst-card-downloads .blst-card-icon { background: #f3e5f5; color: #7b1fa2; }
.blst-card-installs .blst-card-icon { background: #e8eaf6; color: #3949ab; }
.blst-card-repos .blst-card-icon { background: #fce4ec; color: #c2185b; }
.blst-card-forks .blst-card-icon { background: #e0f7fa; color: #00838f; }
.blst-card-issues .blst-card-icon { background: #ffebee; color: #c62828; }
.blst-card-plugins .blst-card-icon { background: #e8f5e9; color: #2e7d32; }
.blst-card-groups .blst-card-icon { background: #fff3e0; color: #ef6c00; }
.blst-card-zones .blst-card-icon { background: #e1f5fe; color: #0277bd; }
.blst-card-rating .blst-card-icon { background: #fff8e1; color: #f9a825; }

.blst-card-content {
    display: flex;
    flex-direction: column;
}

.blst-stat-number {
    font-size: 36px;
    font-weight: 700;
    color: var(--blst-secondary);
    line-height: 1.2;
}

.blst-hero-small .blst-stat-number {
    font-size: 28px;
}

.blst-stat-label {
    font-size: 14px;
    color: var(--blst-text-muted);
    margin-top: 4px;
}

/* Repository Cards */
.blst-repo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.blst-repo-card {
    background: var(--blst-white);
    border: 1px solid var(--blst-border);
    border-radius: var(--blst-radius);
    padding: 20px;
    text-decoration: none;
    color: inherit;
    transition: border-color var(--blst-transition), box-shadow var(--blst-transition);
    display: block;
}

.blst-repo-card:hover {
    border-color: var(--blst-primary);
    box-shadow: var(--blst-shadow);
}

.blst-repo-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--blst-primary);
    margin: 0 0 8px;
}

.blst-repo-desc {
    font-size: 14px;
    color: var(--blst-text-muted);
    margin: 0 0 12px;
    line-height: 1.5;
}

.blst-repo-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: var(--blst-text-muted);
}

.blst-repo-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.blst-repo-meta svg {
    width: 14px;
    height: 14px;
}

.blst-lang-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

/* Plugin Cards */
.blst-plugin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.blst-plugin-card {
    background: var(--blst-white);
    border: 1px solid var(--blst-border);
    border-radius: var(--blst-radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.blst-plugin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.blst-plugin-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--blst-secondary);
    margin: 0;
}

.blst-plugin-version {
    font-size: 12px;
    color: var(--blst-text-muted);
    background: var(--blst-light);
    padding: 2px 8px;
    border-radius: 4px;
}

.blst-plugin-desc {
    font-size: 13px;
    color: var(--blst-text-muted);
    margin: 0 0 12px;
}

.blst-plugin-rating {
    margin-bottom: 12px;
}

.blst-stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.blst-stars .star {
    color: #ddd;
    font-size: 16px;
}

.blst-stars .star.full,
.blst-stars .star.half {
    color: #f9a825;
}

.blst-stars .rating-number {
    margin-left: 8px;
    font-size: 13px;
    color: var(--blst-text-muted);
}

.blst-plugin-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 12px;
}

.blst-plugin-stat {
    display: flex;
    flex-direction: column;
}

.blst-plugin-stat .blst-stat-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--blst-secondary);
}

.blst-plugin-stat .blst-stat-label {
    font-size: 12px;
    color: var(--blst-text-muted);
}

.blst-plugin-bar {
    height: 6px;
    background: var(--blst-light);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
}

.blst-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--blst-primary), var(--blst-info));
    border-radius: 3px;
    transition: width 0.6s ease;
}

.blst-plugin-updated {
    font-size: 12px;
    color: var(--blst-text-muted);
    margin: 0 0 12px;
}

.blst-plugin-link {
    font-size: 14px;
    color: var(--blst-primary);
    text-decoration: none;
    font-weight: 500;
    margin-top: auto;
}

.blst-plugin-link:hover {
    text-decoration: underline;
}

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

.blst-chart-container {
    background: var(--blst-white);
    border: 1px solid var(--blst-border);
    border-radius: var(--blst-radius);
    padding: 24px;
}

.blst-chart-container.blst-chart-wide {
    grid-column: 1 / -1;
}

.blst-chart-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--blst-secondary);
    margin: 0 0 16px;
}

/* Fixed height chart containers to prevent scrolling */
.blst-chart-container canvas {
    max-height: 300px;
}

.blst-chart-fixed-height {
    min-height: 320px;
    max-height: 350px;
    overflow: hidden;
}

.blst-chart-fixed-height canvas {
    height: 280px !important;
    max-height: 280px !important;
}

/* Meetings Overview */
.blst-meetings-overview {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    padding: 24px;
    background: var(--blst-light);
    border-radius: var(--blst-radius);
    margin-bottom: 32px;
}

.blst-meeting-stat {
    text-align: center;
}

.blst-meeting-stat .blst-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--blst-secondary);
    display: block;
}

.blst-meeting-stat .blst-stat-label {
    font-size: 14px;
    color: var(--blst-text-muted);
}

/* Zone Bars */
.blst-zones-list {
    background: var(--blst-white);
    border: 1px solid var(--blst-border);
    border-radius: var(--blst-radius);
    padding: 24px;
}

.blst-zone-bars {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.blst-zone-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.blst-zone-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.blst-zone-name {
    font-weight: 500;
    color: var(--blst-secondary);
}

.blst-zone-count {
    font-size: 14px;
    color: var(--blst-text-muted);
}

.blst-zone-servers {
    font-size: 12px;
    opacity: 0.7;
}

.blst-zone-bar {
    height: 8px;
    background: var(--blst-light);
    border-radius: 4px;
    overflow: hidden;
}

.blst-zone-bar .blst-bar-fill {
    background: linear-gradient(90deg, #2e7d32, #66bb6a);
}

/* Language Tags */
.blst-language-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.blst-language-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--blst-white);
    border: 1px solid var(--blst-border);
    border-radius: 20px;
    font-size: 13px;
}

.blst-lang-count {
    font-weight: 600;
    color: var(--blst-text-muted);
}

/* Server Cards */
.blst-server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.blst-server-card {
    background: var(--blst-white);
    border: 1px solid var(--blst-border);
    border-radius: var(--blst-radius);
    padding: 16px;
    position: relative;
}

.blst-server-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--blst-secondary);
    margin: 0 0 12px;
    padding-right: 60px;
}

.blst-server-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
}

.blst-server-stat .blst-stat-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--blst-secondary);
    display: block;
}

.blst-server-stat .blst-stat-label {
    font-size: 11px;
    color: var(--blst-text-muted);
    text-transform: uppercase;
}

.blst-server-zone {
    font-size: 12px;
    color: var(--blst-text-muted);
}

.blst-server-status {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 500;
}

.blst-status-online {
    background: #d4edda;
    color: #155724;
}

.blst-status-offline {
    background: #f8d7da;
    color: #721c24;
}

/* Footer */
.blst-footer {
    text-align: center;
    padding: 24px;
    border-top: 1px solid var(--blst-border);
    margin-top: 40px;
}

.blst-footer.blst-footer-inline {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
}

.blst-updated {
    font-size: 13px;
    color: var(--blst-text-muted);
    margin: 0 0 8px;
}

.blst-powered {
    font-size: 13px;
    color: var(--blst-text-muted);
    margin: 0;
}

.blst-powered a {
    color: var(--blst-primary);
    text-decoration: none;
}

.blst-powered a:hover {
    text-decoration: underline;
}

.blst-github-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--blst-secondary);
    text-decoration: none;
    font-weight: 500;
}

.blst-github-link svg {
    width: 20px;
    height: 20px;
}

.blst-github-link:hover {
    color: var(--blst-primary);
}

/* Animated counter */
.blst-stat-number.counting {
    transition: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .blst-stats-container {
        padding: 16px;
    }

    .blst-hero-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .blst-hero-card {
        padding: 16px;
    }

    .blst-stat-number {
        font-size: 28px;
    }

    .blst-hero-small .blst-stat-number {
        font-size: 24px;
    }

    .blst-section-title {
        font-size: 20px;
    }

    .blst-repo-grid,
    .blst-plugin-grid,
    .blst-server-grid {
        grid-template-columns: 1fr;
    }

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

    .blst-meetings-overview {
        gap: 20px;
        padding: 16px;
    }

    .blst-meeting-stat .blst-stat-value {
        font-size: 22px;
    }

    .blst-footer.blst-footer-inline {
        flex-direction: column;
        gap: 12px;
    }
}

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

    .blst-plugin-header {
        flex-direction: column;
        gap: 8px;
    }

    .blst-plugin-stats {
        flex-direction: column;
        gap: 12px;
    }
}

/* Dark Theme Variant */
.blst-theme-dark {
    --blst-white: #1a1a2e;
    --blst-light: #16213e;
    --blst-border: #0f3460;
    --blst-text: #e0e0e0;
    --blst-text-muted: #a0a0a0;
    --blst-secondary: #ffffff;
    background: #0f0f1a;
}

.blst-theme-dark .blst-hero-card,
.blst-theme-dark .blst-repo-card,
.blst-theme-dark .blst-plugin-card,
.blst-theme-dark .blst-chart-container,
.blst-theme-dark .blst-zones-list,
.blst-theme-dark .blst-server-card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Compact Theme Variant */
.blst-theme-compact .blst-hero-card {
    padding: 16px;
}

.blst-theme-compact .blst-stat-number {
    font-size: 28px;
}

.blst-theme-compact .blst-section {
    margin-bottom: 30px;
}
