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

:root {
    --primary-color: #1a1a2e;
    --secondary-color: #16213e;
    --accent-color: #0f3460;
    --highlight-color: #533483;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --background-light: #f5f7fa;
    --background-white: #ffffff;
    --border-color: #e1e8ed;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --error-color: #e74c3c;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: var(--background-light);
    min-height: 100vh;
    padding: 10px;
    margin: 0;
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    background: var(--background-white);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    border: 1px solid var(--border-color);
    min-height: 100vh;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.motivation-section {
    background: linear-gradient(135deg, var(--background-light) 0%, var(--background-white) 100%);
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--accent-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.motivation-section h2 {
    color: var(--primary-color);
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.motivation-section p {
    color: var(--text-primary);
    font-size: 1em;
    line-height: 1.8;
    margin-bottom: 15px;
    text-align: justify;
}

.motivation-section p strong {
    color: var(--accent-color);
    font-weight: 600;
}

.motivation-highlight {
    background: rgba(15, 52, 96, 0.05);
    padding: 20px;
    border-radius: 6px;
    border-left: 4px solid var(--highlight-color);
    margin-top: 20px;
    font-style: italic;
}

.motivation-highlight strong {
    color: var(--highlight-color);
    font-weight: 600;
    font-style: normal;
}

h1 {
    font-size: 2.5em;
    color: var(--primary-color);
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 1em;
    color: var(--text-secondary);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--background-light);
    border-radius: 6px;
    flex-wrap: wrap;
    align-items: flex-end;
    border: 1px solid var(--border-color);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 200px;
}

.control-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

select {
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9375em;
    background: var(--background-white);
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
    font-family: inherit;
}

select:hover {
    border-color: var(--accent-color);
}

select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(15, 52, 96, 0.1);
}

.btn {
    padding: 12px 24px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.9375em;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: inherit;
}

.btn:hover {
    background: var(--highlight-color);
}

.btn:active {
    transform: translateY(1px);
}

.visualization-container {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 32px;
    margin-bottom: 40px;
    min-height: calc(100vh - 300px);
}

#chart-container {
    min-height: calc(100vh - 300px);
    width: 100%;
    height: calc(100vh - 300px);
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--background-white);
    border-radius: 6px;
    padding: 50px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: visible;
}

#chart-container svg {
    display: block;
    margin: 0 auto;
}

#legend-container {
    background: var(--background-white);
    border-radius: 6px;
    padding: 24px;
    border: 1px solid var(--border-color);
    max-height: calc(100vh - 300px);
    overflow-y: auto;
    min-height: 400px;
}

#legend-container h3 {
    font-size: 1em;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 10px;
    border-radius: 4px;
    transition: background 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.legend-item:hover {
    background: var(--background-light);
    border-color: var(--border-color);
}

.legend-color {
    width: 24px;
    height: 24px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.legend-text {
    flex: 1;
    font-size: 0.875em;
    line-height: 1.4;
}

.legend-text strong {
    color: var(--text-primary);
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
}

.legend-bandwidth {
    font-weight: 600;
    color: var(--accent-color);
    font-size: 0.8125em;
}

.info-panel {
    background: var(--background-white);
    border-radius: 6px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.info-panel h3 {
    color: var(--text-primary);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 12px;
    font-size: 1em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-source-footer {
    background: var(--background-white);
    border-radius: 6px;
    padding: 24px;
    margin-top: 40px;
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--accent-color);
}

.data-source-info h4 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.1em;
    font-weight: 600;
}

.data-source-info p {
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.6;
    font-size: 0.9375em;
}

.data-source-info a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
}

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

.data-update-note {
    background: var(--background-light);
    padding: 15px;
    border-radius: 4px;
    border-left: 4px solid var(--warning-color);
    margin-top: 15px;
    margin-bottom: 15px;
}

.data-update-note strong {
    color: var(--text-primary);
}

.last-updated {
    font-size: 0.875em;
    color: var(--text-secondary);
    font-style: italic;
}

.last-updated span {
    font-weight: 500;
    color: var(--text-primary);
}

.author-credit {
    font-size: 0.9375em;
    color: var(--text-secondary);
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.author-credit strong {
    color: var(--text-primary);
    font-weight: 600;
}

#band-info {
    min-height: 120px;
}

.band-detail {
    background: var(--background-light);
    padding: 20px;
    border-radius: 4px;
    border-left: 4px solid var(--accent-color);
    margin-bottom: 12px;
}

.band-detail h4 {
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 1.125em;
    font-weight: 600;
}

.band-detail p {
    margin: 6px 0;
    color: var(--text-secondary);
    font-size: 0.9375em;
}

.band-detail strong {
    color: var(--text-primary);
    font-weight: 600;
    min-width: 120px;
    display: inline-block;
}


.slice {
    cursor: pointer;
    transition: all 0.2s ease;
}

.slice:hover {
    opacity: 0.85;
    stroke: var(--primary-color);
    stroke-width: 2;
    filter: brightness(1.1);
}

.slice-label-inside {
    pointer-events: none;
    font-size: 11px;
    font-weight: 600;
    fill: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.slice-label-outside {
    pointer-events: none;
    font-size: 10px;
    font-weight: 600;
    fill: #2c3e50;
}

.center-text {
    font-family: inherit;
}

@media (max-width: 1024px) {
    .visualization-container {
        grid-template-columns: 1fr;
    }
    
    #chart-container {
        min-height: 500px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .container {
        padding: 24px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 12px;
    }
    
    .container {
        padding: 20px;
    }
    
    #chart-container {
        min-height: 400px;
        padding: 20px;
    }
    
    h1 {
        font-size: 1.75em;
    }
    
    .controls {
        padding: 20px;
    }
    
}
