/* Stats Page Specific Styles */

.stats-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: 80px 20px;
    text-align: center;
}

.stats-section {
    padding: 60px 20px;
}

/* Key Metrics */
.key-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.metric-card {
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.metric-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    border-color: var(--accent-color);
}

.metric-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.metric-value {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--accent-color);
    font-family: 'Playfair Display', serif;
    margin-bottom: 0.5rem;
}

.metric-label {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.metric-sublabel {
    font-size: 0.9rem;
    color: #666;
}

/* Additional Metrics */
.additional-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.info-card {
    background: linear-gradient(135deg, var(--light-bg) 0%, var(--white) 100%);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.info-card h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.info-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 0.75rem;
}

.info-card p {
    color: #666;
    font-size: 0.95rem;
}

/* Word Count Insights */
.word-count-section {
    margin-bottom: 4rem;
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.insight-card {
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.insight-card:hover {
    border-color: var(--accent-color);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.insight-card h3 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-size: 1.4rem;
    text-align: center;
}

.article-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.insight-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--light-bg);
    border-radius: 10px;
    transition: var(--transition);
    cursor: pointer;
    align-items: center;
}

.insight-item:hover {
    background: var(--accent-color);
    color: var(--white);
    transform: translateX(5px);
}

.insight-rank {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
    min-width: 40px;
    text-align: center;
}

.insight-item:hover .insight-rank {
    color: var(--white);
}

.insight-content {
    flex: 1;
}

.insight-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.insight-meta {
    font-size: 0.85rem;
    opacity: 0.8;
    font-weight: 500;
}

/* Categories Section */
.categories-section,
.years-section {
    margin-bottom: 4rem;
}

.section-title {
    text-align: center;
    margin-bottom: 2rem;
}

.categories-chart,
.years-chart {
    max-width: 900px;
    margin: 0 auto;
}

.category-bar,
.year-bar {
    margin-bottom: 1.5rem;
}

.bar-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.bar-label-name {
    flex: 1;
}

.bar-label-count {
    color: var(--accent-color);
    font-weight: 700;
}

.bar-container {
    height: 35px;
    background: var(--light-bg);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color) 0%, var(--primary-color) 100%);
    border-radius: 20px;
    transition: width 1s ease-out;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 15px;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: 4rem 3rem;
    border-radius: 20px;
    text-align: center;
    margin-top: 4rem;
}

.cta-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--white);
}

.cta-section p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.cta-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-btn {
    padding: 14px 35px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    transition: var(--transition);
    display: inline-block;
}

.cta-btn.primary {
    background: var(--accent-color);
    color: var(--white);
}

.cta-btn.primary:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.cta-btn.secondary {
    background: var(--white);
    color: var(--primary-color);
}

.cta-btn.secondary:hover {
    background: var(--light-bg);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.metric-card,
.info-card,
.category-bar,
.year-bar {
    animation: fadeInUp 0.6s ease-out;
}

.metric-card:nth-child(1) { animation-delay: 0.1s; }
.metric-card:nth-child(2) { animation-delay: 0.2s; }
.metric-card:nth-child(3) { animation-delay: 0.3s; }
.metric-card:nth-child(4) { animation-delay: 0.4s; }

/* Modal Styles */
.articles-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
}

.modal-content {
    background: var(--white);
    border-radius: 15px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 10;
}

.modal-header h2 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.8rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    background: var(--light-bg);
    color: var(--accent-color);
}

.modal-body {
    padding: 30px;
}

.modal-article-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    transition: var(--transition);
    background: var(--white);
}

.modal-article-item:hover {
    border-color: var(--accent-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.modal-article-image {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--light-bg);
}

.modal-article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-article-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-article-meta {
    display: flex;
    gap: 15px;
    align-items: center;
}

.modal-article-date {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

.modal-article-source {
    font-size: 0.75rem;
    color: var(--accent-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-article-title {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin: 0;
    font-weight: 700;
    line-height: 1.4;
}

.modal-article-description {
    font-size: 0.9rem;
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
}

.modal-article-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: auto;
}

.modal-article-link:hover {
    text-decoration: underline;
}

/* Bar hover effects */
.category-bar:hover,
.year-bar:hover {
    background: var(--light-bg);
    border-radius: 8px;
    padding: 5px;
    margin: -5px;
}

.category-bar:hover .bar-label-name,
.year-bar:hover .bar-label-name {
    color: var(--accent-color);
}

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

    .metric-value {
        font-size: 2.5rem;
    }

    .cta-section h2 {
        font-size: 1.8rem;
    }

    .cta-section p {
        font-size: 1rem;
    }

    .cta-buttons {
        flex-direction: column;
        gap: 1rem;
    }

    .cta-btn {
        width: 100%;
    }

    .modal-content {
        max-height: 95vh;
    }

    .modal-article-item {
        flex-direction: column;
    }

    .modal-article-image {
        width: 100%;
        height: 200px;
    }

    .modal-header h2 {
        font-size: 1.3rem;
    }
}
