/* Premium Statistics Dashboard Styles */

:root {
    --primary: #2563eb;
    /* Royal Blue */
    --secondary: #10b981;
    /* Emerald */
    --accent: #f59e0b;
    /* Amber */
    --purple: #8b5cf6;
    /* Violet */
    --text-dark: #1e293b;
    /* Slate 800 */
    --text-light: #64748b;
    /* Slate 500 */

    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --blur-strength: 16px;

    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
}

/* Premium Statistics Dashboard Styles */

:root {
    --primary: #2563eb;
    /* Royal Blue */
    --secondary: #10b981;
    /* Emerald */
    --accent: #f59e0b;
    /* Amber */
    --purple: #8b5cf6;
    /* Violet */
    --text-dark: #1e293b;
    /* Slate 800 */
    --text-light: #64748b;
    /* Slate 500 */

    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --blur-strength: 16px;

    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
}

/* ============================================================
   NOTICIA EDITORIAL
   ============================================================ */

.news-article-section {
    padding: 60px 0 32px;
}

.news-article {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 20px;
    padding: 48px 56px;
    max-width: 860px;
    margin: 0 auto;
}

.news-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: 20px;
    margin-bottom: 20px;
}

.news-category-badge svg {
    width: 14px;
    height: 14px;
}

.news-headline {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    line-height: 1.3;
    color: var(--text-dark);
    margin: 0 0 20px;
}

.news-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 28px;
    padding: 16px 0;
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 28px;
}

.news-meta-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.82rem;
    color: var(--text-light);
}

.news-meta-item svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.news-lead p {
    font-size: 1.1rem;
    line-height: 1.75;
    color: var(--text-dark);
    font-weight: 400;
    margin-bottom: 20px;
}

.news-body p {
    font-size: 0.97rem;
    line-height: 1.8;
    color: var(--text-light);
    margin-bottom: 16px;
}

.news-body p strong {
    color: var(--text-dark);
}

.news-quote {
    border-left: 4px solid var(--primary);
    background: rgba(37, 99, 235, 0.06);
    margin: 24px 0;
    padding: 16px 24px;
    border-radius: 0 10px 10px 0;
}

.news-quote p {
    font-style: italic;
    font-size: 1rem !important;
    color: var(--text-dark) !important;
    margin-bottom: 8px !important;
}

.news-quote cite {
    font-size: 0.82rem;
    color: var(--primary);
    font-weight: 600;
    font-style: normal;
}

.news-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .news-article {
        padding: 28px 20px;
    }
    .news-meta {
        flex-direction: column;
        gap: 10px;
    }
}

body {
    background: #f0f2f5;
    background-image:
        radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);
    /* Animated Mesh Gradient background */
    background:
        radial-gradient(circle at 15% 50%, rgba(37, 99, 235, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.08), transparent 25%);
    color: var(--text-dark);
    font-family: var(--font-body);
    overflow-x: hidden;
}

/* --- Header / Navigation --- */
.header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 16px 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo-container img {
    height: 40px;
    width: auto;
}

.nav-list {
    display: flex;
    gap: 24px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    padding: 8px 16px;
    border-radius: 8px;
}

.nav-link:hover {
    color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.nav-link.nav-highlight {
    color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
    font-weight: 600;
}

/* Mobile Menu Button (Hidden by default on desktop) */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-dark);
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
        /* Simple logical for now, logic needed in JS to toggle */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        padding: 20px;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }

    .nav-list {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .mobile-menu-btn {
        display: flex;
    }

    /* When active class added via JS (user needs to add JS logic or I'll add simple one) */
    .nav-menu.active {
        display: block;
    }
}


/* --- Utilities --- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* --- Animations --- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-5px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* --- Layout Components --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
    padding: 24px 0;
}

.col-span-12 {
    grid-column: span 12;
}

.col-span-8 {
    grid-column: span 8;
}

.col-span-6 {
    grid-column: span 6;
}

.col-span-4 {
    grid-column: span 4;
}

@media (max-width: 1024px) {
    .col-span-8 {
        grid-column: span 12;
    }

    .col-span-6 {
        grid-column: span 12;
    }

    .col-span-4 {
        grid-column: span 6;
    }
}

@media (max-width: 640px) {
    .col-span-4 {
        grid-column: span 12;
    }

    .dashboard-grid {
        gap: 16px;
        padding: 16px 0;
    }

    .premium-card {
        padding: 16px;
    }

    .page-title {
        font-size: 2rem;
    }

    .kpi-value {
        font-size: 2.5rem;
    }
}

/* --- Cards --- */
.premium-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--glass-shadow);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Spring-like */
    animation: fadeIn 0.6s ease-out forwards;
    opacity: 0;
    /* Started hidden for animation */
}

.premium-card:nth-child(1) {
    animation-delay: 0.1s;
}

.premium-card:nth-child(2) {
    animation-delay: 0.2s;
}

.premium-card:nth-child(3) {
    animation-delay: 0.3s;
}

.premium-card:nth-child(4) {
    animation-delay: 0.4s;
}

.premium-card:nth-child(5) {
    animation-delay: 0.5s;
}

.premium-card:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.1);
    border-color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.75);
}

/* --- Typography --- */
.page-title {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-dark) 0%, #475569 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    padding-bottom: 12px;
}

.card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

/* --- KPI Specifics --- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-card {
    position: relative;
    overflow: hidden;
    color: white;
    border: none;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            rgba(255, 255, 255, 0) 40%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0) 60%);
    transform: rotate(30deg);
    animation: shine 6s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) rotate(30deg);
    }

    20% {
        transform: translateX(100%) rotate(30deg);
    }

    100% {
        transform: translateX(100%) rotate(30deg);
    }
}

.kpi-card.primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.kpi-card.accent {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.kpi-card.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.kpi-value {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    line-height: 1;
    font-weight: 700;
    margin-bottom: 4px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.kpi-label {
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* --- Charts --- */
.chart-container-wrapper {
    position: relative;
    height: 320px;
    width: 100%;
}

.chart-container-wrapper.tall {
    height: 450px;
}

/* --- Dark Mode --- */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #0f172a;
        background-image:
            radial-gradient(circle at 15% 50%, rgba(37, 99, 235, 0.15), transparent 25%),
            radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.15), transparent 25%);
        color: #f1f5f9;
        --glass-bg: rgba(30, 41, 59, 0.7);
        --glass-border: rgba(255, 255, 255, 0.08);
        --text-dark: #f1f5f9;
        --text-light: #94a3b8;
    }

    .page-title {
        background: linear-gradient(135deg, #f8fafc 0%, #cbd5e1 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    .premium-card:hover {
        background: rgba(30, 41, 59, 0.85);
        border-color: rgba(255, 255, 255, 0.15);
    }

    .card-header {
        border-bottom-color: rgba(255, 255, 255, 0.08);
    }

    .card-icon {
        background: rgba(37, 99, 235, 0.2);
        color: #60a5fa;
    }
}