:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --accent: #ec4899;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #0f172a;
    --dark-light: #1e293b;
    --gray: #64748b;
    --gray-light: #cbd5e1;
    --bg: #0f172a;
    --bg-light: #1e293b;
    --white: #ffffff;
    --border: #334155;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0.05;
    z-index: -1;
}

/* Header */
header {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    padding: 1.5rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 2px solid var(--border);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--gray-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--white);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 6rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.hero p {
    font-size: 1.5rem;
    color: var(--gray-light);
    margin-bottom: 3rem;
}

.cta-button {
    display: inline-block;
    padding: 1rem 3rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.125rem;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
    transition: transform 0.3s, box-shadow 0.3s;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.5);
}

/* Categories Grid */
.categories {
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.categories h2 {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 3rem;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.category-card {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
    border: 2px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.3);
}

.category-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.category-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.category-card p {
    color: var(--gray-light);
}

/* Control Panel */
.controls-panel {
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 2px solid var(--border);
}

.control-group {
    margin-bottom: 1.5rem;
}

.control-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--white);
}

.form-control,
.form-select {
    width: 100%;
    padding: 0.875rem;
    background: var(--bg-light);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--white);
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-select {
    cursor: pointer;
}

/* Buttons */
.btn {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.4);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--white);
    border: 2px solid var(--border);
}

/* Visualization Container */
.visualization-container {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
    border: 2px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    min-height: 600px;
    position: relative;
    overflow: hidden;
}

#chart-svg {
    width: 100%;
    height: 600px;
}

/* Animation Controls */
.animation-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

/* Slider */
input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: var(--border);
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.5);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    cursor: pointer;
    border: none;
}

/* Multi-select */
.multi-select {
    position: relative;
}

.selected-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.selected-item {
    background: var(--primary);
    color: var(--white);
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.selected-item button {
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
    font-size: 1.125rem;
    line-height: 1;
}

/* Loading */
.loading {
    text-align: center;
    padding: 4rem;
    color: var(--gray);
}

.spinner {
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Grid Layout */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem 2rem;
    margin-top: 4rem;
    border-top: 2px solid var(--border);
    color: var(--gray-light);
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.125rem;
    }

    .category-grid {
        grid-template-columns: 1fr;
    }

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .nav-links {
        display: none;
    }
}

/* Chart Styles */
.bar {
    transition: all 0.5s ease-in-out;
}

.bar-label {
    font-weight: 600;
    font-size: 14px;
}

.bar-value {
    font-weight: 700;
    font-size: 16px;
}

.year-display {
    font-size: 80px;
    font-weight: 900;
    fill: rgba(255, 255, 255, 0.1);
}

/* Intro Screen */
.intro-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    z-index: 10;
    animation: fadeOut 0.5s ease-out 2s forwards;
}

.intro-screen h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-align: center;
}

.intro-screen p {
    font-size: 1.5rem;
    color: var(--gray-light);
    text-align: center;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        pointer-events: none;
    }
}

/* Recording Indicator */
.recording-indicator {
    position: fixed;
    top: 100px;
    right: 20px;
    background: var(--danger);
    color: var(--white);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 700;
    display: none;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.5);
    z-index: 1000;
}

.recording-indicator.active {
    display: flex;
}

.rec-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--white);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}