/*
 * Academic Topic Evolution Analysis - Stylesheet
 * 
 * A modern, responsive stylesheet for visualizing academic topic trends
 * Follows BEM methodology and mobile-first responsive design principles
 * 
 * Author: Chris H. Wiggins
 * Version: 1.0.0
 */

/* ===== CSS RESET & BASE STYLES ===== */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 
                'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #2d3748;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== LAYOUT COMPONENTS ===== */

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

/* ===== HEADER SECTION ===== */

.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f7fafc 100%);
    border-radius: 16px;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

.main-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 16px;
    letter-spacing: -0.025em;
}

.subtitle {
    font-size: clamp(1rem, 3vw, 1.25rem);
    color: #4a5568;
    margin-bottom: 12px;
    font-weight: 500;
}

.methodology {
    font-size: 0.95rem;
    color: #718096;
    font-style: italic;
}

/* ===== STATISTICS SECTION ===== */

.statistics-section {
    margin-bottom: 40px;
}

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

.stat-card {
    background: #ffffff;
    padding: 28px 24px;
    border-radius: 12px;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #4299e1, #63b3ed);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card.success::before {
    background: linear-gradient(90deg, #48bb78, #68d391);
}

.stat-card.highlight::before {
    background: linear-gradient(90deg, #ed8936, #f6ad55);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    display: block;
}

.stat-title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #718096;
    margin-bottom: 8px;
}

.stat-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 8px;
}

.stat-description {
    font-size: 0.875rem;
    color: #4a5568;
}

/* ===== VISUALIZATION SECTION ===== */

.visualization-section {
    margin-bottom: 50px;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 20px;
    text-align: center;
}

.chart-container {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    padding: 24px;
    margin-bottom: 16px;
}

.chart-element {
    width: 100%;
    height: 600px;
    min-height: 500px;
}

.chart-controls {
    text-align: center;
    margin-top: 16px;
}

.chart-note {
    font-size: 0.875rem;
    color: #718096;
    font-style: italic;
}

/* ===== INSIGHTS SECTION ===== */

.insights-section {
    margin-bottom: 50px;
}

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

.insight-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.insight-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: 0 4px 4px 0;
    transition: width 0.3s ease;
}

.insight-card:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.insight-card:hover::before {
    width: 6px;
}

.ml-card::before { background: linear-gradient(180deg, #4299e1, #63b3ed); }
.finance-card::before { background: linear-gradient(180deg, #48bb78, #68d391); }
.social-card::before { background: linear-gradient(180deg, #ed8936, #f6ad55); }
.climate-card::before { background: linear-gradient(180deg, #38b2ac, #4fd1c7); }

.insight-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.insight-icon {
    font-size: 2rem;
    margin-right: 12px;
}

.insight-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a202c;
}

.metric {
    font-size: 1.125rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 12px;
}

.insight-description {
    color: #4a5568;
    line-height: 1.7;
    margin-bottom: 16px;
}

.trend-indicator {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.trend-arrow {
    margin-right: 8px;
    font-size: 1.1rem;
}

.trend-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: #2d3748;
    font-family: 'SF Mono', Monaco, monospace;
}

/* ===== METHODOLOGY SECTION ===== */

.methodology-section {
    margin-bottom: 50px;
}

.methodology-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.methodology-card {
    background: #ffffff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

.methodology-card h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 12px;
}

.methodology-card p {
    color: #4a5568;
    line-height: 1.6;
}

/* ===== FOOTER ===== */

.footer {
    margin-top: 60px;
    padding: 40px 20px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    text-align: center;
}

.footer-text {
    font-size: 0.95rem;
    color: #4a5568;
    margin-bottom: 8px;
}

.footer-link {
    color: #4299e1;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #3182ce;
    text-decoration: underline;
}

.footer-meta {
    font-size: 0.875rem;
    color: #718096;
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 768px) {
    .app-container {
        padding: 16px;
    }
    
    .header {
        padding: 30px 16px;
        margin-bottom: 30px;
    }
    
    .stats-grid,
    .insights-grid,
    .methodology-content {
        grid-template-columns: 1fr;
    }
    
    .chart-element {
        height: 500px;
        min-height: 400px;
    }
    
    .insight-card {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .stat-card {
        padding: 20px 16px;
    }
    
    .chart-container {
        padding: 16px;
    }
    
    .chart-element {
        height: 400px;
        min-height: 350px;
    }
}

/* ===== ACCESSIBILITY ===== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus states for keyboard navigation */
.footer-link:focus {
    outline: 2px solid #4299e1;
    outline-offset: 2px;
}
