/* #SoyComunicación Radio - Stats Dashboard Styles */

:root {
    --primary: #0f7cff;
    --primary-dark: #0a4f99;
    --accent: #00ffff;
    --background: #0f1419;
    --surface: #1a2332;
    --border: #2a3f5f;
    --text: #e0e8f0;
    --text-muted: #a0b0c0;
    --success: #10b981;
    --live: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--background) 0%, #1a2f4f 100%);
    color: var(--text);
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.header-content h1 {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
}

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

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
    border-radius: 8px;
}

.status-dot {
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-dot.offline {
    background: var(--text-muted);
    animation: none;
}

.status-text {
    font-size: 12px;
    font-weight: 500;
    color: var(--success);
}

.status-text.offline {
    color: var(--text-muted);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Stats Card */
.stats-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
}

.main-card {
    background: linear-gradient(135deg, rgba(15, 124, 255, 0.1) 0%, rgba(0, 255, 255, 0.05) 100%);
    border: 2px solid var(--primary);
}

.stat-item {
    flex: 1;
    text-align: center;
}

.center-stat {
    margin-bottom: 30px;
}

.listener-count {
    font-size: 72px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    margin-bottom: 10px;
}

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

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

.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.now-playing {
    padding: 20px;
    background: rgba(0, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 8px;
}

.now-playing-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-weight: 600;
}

.now-playing-title {
    font-size: 18px;
    color: var(--accent);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}

.tab-btn {
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: var(--text);
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Controls */
.controls {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
}

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

.controls select {
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.controls select:focus {
    outline: none;
    border-color: var(--primary);
}

.controls input[type="date"] {
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.controls input[type="date"]:focus {
    outline: none;
    border-color: var(--primary);
}

.controls button {
    padding: 8px 20px;
    background: var(--primary);
    border: none;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.controls button:hover {
    background: var(--primary-dark);
    box-shadow: 0 0 20px rgba(15, 124, 255, 0.3);
}

.controls button:active {
    transform: scale(0.98);
}

/* Chart Container */
#trendsChart, #historyChart {
    max-width: 100%;
    margin: 20px 0;
}

.history-table-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow-x: auto;
}

/* Details Grid */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.detail-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
}

.detail-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(15, 124, 255, 0.1);
}

.detail-card h3 {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    font-weight: 600;
}

.detail-card p {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
}

/* Info Content */
.info-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 30px;
}

.info-content h3 {
    color: var(--accent);
    margin-top: 20px;
    margin-bottom: 12px;
    font-size: 16px;
}

.info-content h3:first-child {
    margin-top: 0;
}

.info-content p {
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 16px;
    font-size: 14px;
}

.info-content a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.info-content a:hover {
    color: var(--accent);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }

    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .header-content h1 {
        font-size: 22px;
    }

    .listener-count {
        font-size: 48px;
    }

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

    .stats-card {
        padding: 20px;
    }

    .stat-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tab-btn {
        padding: 12px 16px;
        font-size: 12px;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .listener-count {
        font-size: 36px;
    }

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

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

    .header {
        padding: 15px;
    }

    .stats-card {
        padding: 15px;
    }

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

    .controls select,
    .controls input[type="date"],
    .controls button {
        width: 100%;
    }
}

/* Loading State */
.skeleton {
    background: linear-gradient(90deg, var(--surface) 25%, var(--border) 50%, var(--surface) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 2s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* Listeners Container */
.listeners-container {
    display: grid;
    gap: 15px;
}

.loading {
    color: #a0b0c0;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* DateTime in header */
.datetime-info {
    font-size: 12px;
    color: #a0b0c0;
    margin-top: 8px;
    font-weight: 300;
}

.timezone {
    opacity: 0.7;
}

/* Audio Player */
.player-container {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(26, 35, 50, 0.6);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 8px;
    padding: 15px 20px;
    margin: 15px 0;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.play-btn,
.stop-btn {
    width: 50px;
    height: 50px;
    border: 2px solid #00ffff;
    background: rgba(0, 255, 255, 0.1);
    color: #00ffff;
    font-size: 20px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.play-btn:hover,
.stop-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    transform: scale(1.05);
}

.play-btn:active,
.stop-btn:active {
    transform: scale(0.95);
}

.player-info {
    display: flex;
    flex-direction: column;
}

.player-label {
    font-size: 12px;
    color: #a0b0c0;
    margin: 0;
}

.player-status {
    font-size: 14px;
    color: #00ffff;
    margin: 5px 0 0 0;
    font-weight: bold;
}

@media (max-width: 768px) {
    .player-container {
        flex-direction: column;
        padding: 12px 15px;
    }

    .player-controls {
        width: 100%;
        justify-content: center;
    }

    .player-info {
        text-align: center;
    }
}
