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

:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --accent: #f093fb;
    --success: #4ade80;
    --warning: #fbbf24;
    --danger: #f87171;
    --dark: #1e293b;
    --light: #f8fafc;
    --gray: #64748b;
    --border: #e2e8f0;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 3rem 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.header-content {
    text-align: center;
}

.logo {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.tagline {
    font-size: 1.25rem;
    opacity: 0.95;
    font-weight: 300;
}

/* Hero Stats */
.hero {
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin: -2rem 0 2rem;
    position: relative;
    z-index: 10;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0;
}

.hero-stat {
    padding: 2.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border-right: 1px solid var(--border);
    transition: background 0.3s ease;
}

.hero-stat:last-child {
    border-right: none;
}

.hero-stat:hover {
    background: var(--light);
}

.hero-stat-icon {
    font-size: 3.5rem;
    line-height: 1;
}

.hero-stat-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
}

.hero-stat-content p {
    color: var(--gray);
    font-size: 0.95rem;
}

/* Main */
.main {
    padding: 2rem 0 4rem;
}

/* Section */
.section {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.section-subtitle {
    color: var(--gray);
    margin-bottom: 1.5rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.stat-card.highlight {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Ranking */
.ranking {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--light);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    transition: all 0.3s ease;
}

.ranking-item:hover {
    background: #e2e8f0;
    transform: translateX(4px);
}

.ranking-item.top-1 { border-left-color: #ffd700; background: #fffbeb; }
.ranking-item.top-2 { border-left-color: #c0c0c0; }
.ranking-item.top-3 { border-left-color: #cd7f32; }

.ranking-position {
    font-size: 1.5rem;
    font-weight: 700;
    min-width: 40px;
    text-align: center;
    color: var(--primary);
}

.ranking-item.top-1 .ranking-position { color: #d97706; }

.ranking-info {
    flex: 1;
}

.ranking-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--dark);
}

.ranking-meta {
    font-size: 0.85rem;
    color: var(--gray);
}

.ranking-stat {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    min-width: 100px;
    text-align: right;
}

.ranking-link {
    font-size: 0.85rem;
    color: var(--primary);
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.ranking-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Ranking Compact */
.ranking-compact {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ranking-compact .ranking-item {
    padding: 0.75rem 1rem;
}

.ranking-compact .ranking-position {
    font-size: 1.25rem;
    min-width: 30px;
}

.ranking-compact .ranking-title {
    font-size: 0.9rem;
}

.ranking-compact .ranking-stat {
    font-size: 1rem;
    min-width: 80px;
}

/* Two Columns */
.two-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 2rem;
}

@media (max-width: 1100px) {
    .two-columns {
        grid-template-columns: 1fr;
    }
}

/* Evolución Grid */
.evolucion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.evolucion-card {
    background: linear-gradient(135deg, #fafafa 0%, #f0f0f0 100%);
    border-radius: 12px;
    padding: 1.5rem;
    border-left: 4px solid var(--primary);
}

.evolucion-año {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
}

.evolucion-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.evolucion-stat {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.evolucion-stat-label {
    color: var(--gray);
}

.evolucion-stat-value {
    font-weight: 600;
    color: var(--dark);
}

.evolucion-mejor {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
}

.evolucion-mejor-titulo {
    color: var(--gray);
    margin-bottom: 0.25rem;
}

.evolucion-mejor-video {
    font-weight: 500;
    color: var(--dark);
}

/* Tags Cloud */
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    padding: 1rem 0;
}

.tag {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 50px;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: default;
}

.tag:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.tag.size-xl { font-size: 1.5rem; }
.tag.size-lg { font-size: 1.25rem; }
.tag.size-md { font-size: 1rem; }
.tag.size-sm { font-size: 0.9rem; }

/* Videos Recientes */
.videos-recientes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.video-card-reciente {
    background: var(--light);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border);
}

.video-card-reciente:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.video-card-content {
    padding: 1.25rem;
}

.video-card-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--dark);
    line-height: 1.4;
    font-size: 0.95rem;
}

.video-card-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--gray);
    margin-bottom: 0.75rem;
}

.video-card-stat {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.video-card-meta {
    font-size: 0.8rem;
    color: var(--gray);
}

.video-card-link {
    display: inline-block;
    margin-top: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
}

.video-card-link:hover {
    text-decoration: underline;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 300px;
    padding: 1rem 0;
}

/* Footer */
.footer {
    background: var(--dark);
    color: white;
    padding: 3rem 0;
    text-align: center;
    margin-top: 3rem;
}

.footer p {
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.footer-meta {
    font-size: 0.9rem;
    opacity: 0.7;
}

.footer-links {
    margin-top: 1rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.footer-links a:hover {
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-stats {
        grid-template-columns: 1fr;
    }

    .hero-stat {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .hero-stat:last-child {
        border-bottom: none;
    }

    .logo {
        font-size: 2rem;
    }

    .section {
        padding: 1.5rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .ranking-item {
        flex-wrap: wrap;
    }

    .ranking-stat {
        min-width: auto;
        width: 100%;
        text-align: left;
        margin-top: 0.5rem;
    }

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

    .videos-recientes {
        grid-template-columns: 1fr;
    }
}
