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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #ffffff;
}

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

/* Header */
.header {
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 0;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 2rem;
    font-weight: bold;
    color: #2563eb;
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav a:hover {
    color: #2563eb;
}

/* Main content */
main {
    margin-top: 80px;
}

/* Hero section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6rem 0;
    text-align: center;
}

.hero h2 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

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

.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-primary {
    background: #ffffff;
    color: #2563eb;
}

.btn-primary:hover {
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.btn-secondary {
    background: transparent;
    color: #ffffff;
    border-color: #ffffff;
}

.btn-secondary:hover {
    background: #ffffff;
    color: #2563eb;
    transform: translateY(-2px);
}

/* Sections */
.section {
    padding: 5rem 0;
}

.section h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: #1f2937;
}

.section p {
    font-size: 1.1rem;
    text-align: center;
    max-width: 800px;
    margin: 0 auto 2rem;
    color: #555;
}

/* Services section */
.services {
    background: #f8fafc;
}

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

.service-card {
    background: #ffffff;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #2563eb;
}

.service-card p {
    color: #666;
    margin: 0;
}

/* Metrics section */
.metrics-section {
    background: #ffffff;
}

.metrics-dashboard {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    margin-top: 3rem;
    align-items: start;
}

.chart-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    position: relative;
    height: 400px;
}

.chart-container canvas {
    max-height: 100%;
}

.metrics-summary {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.summary-card {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid #2563eb;
}

.summary-card h4 {
    font-size: 1rem;
    color: #555;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-card span {
    font-size: 1.8rem;
    font-weight: bold;
    color: #2563eb;
    display: block;
}

.metrics-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #666;
}

.loader-spinner {
    border: 3px solid #f3f3f3;
    border-radius: 50%;
    border-top: 3px solid #2563eb;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.metrics-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #ef4444;
}

.metrics-error button {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.metrics-no-data {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #666;
}

.metrics-no-data p {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.no-data-subtitle {
    font-size: 0.9rem !important;
    color: #888 !important;
    margin-bottom: 1.5rem !important;
}

.metrics-no-data button {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.data-source-indicator {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #666;
    z-index: 10;
}

.indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
}

.indicator-dot.live {
    background: #10b981;
    animation: pulse 2s infinite;
}

.indicator-dot.empty {
    background: #94a3b8;
}

.indicator-dot.error {
    background: #ef4444;
}

.nav a.active {
    color: #2563eb;
    font-weight: 600;
}

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

/* Contact section */
.contact-info {
    text-align: center;
    margin-top: 2rem;
}

.contact-info p {
    margin-bottom: 1rem;
}

.contact-info a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.contact-info a:hover {
    text-decoration: underline;
}

/* Footer */
.footer {
    background: #1f2937;
    color: #ffffff;
    padding: 2rem 0;
    text-align: center;
}

/* Responsive design */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav {
        gap: 1rem;
    }
    
    .hero h2 {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .metrics-dashboard {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .chart-container {
        height: 300px;
        padding: 1rem;
    }
    
    .metrics-summary {
        order: -1;
    }
    
    .summary-card {
        padding: 1rem;
    }
    
    .summary-card span {
        font-size: 1.5rem;
    }
    
    main {
        margin-top: 120px;
    }
}