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

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    min-height: 100vh;
    color: #ffffff;
}

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

h1 {
    text-align: center;
    color: white;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 2.5rem;
    font-weight: 200;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    text-align: center;
    color: rgba(255,255,255,0.9);
    margin: 0 auto 30px auto;
    max-width: 800px;
    font-size: 0.875rem;
}

.controls {
    padding: 0;
    margin-bottom: 10px;
    text-align: center;
}

.controls h3 {
    color: white;
    margin-bottom: 15px;
    font-size: 1.2rem;
    text-align: center;
    border-bottom: 2px solid rgba(255,255,255,0.3);
    padding-bottom: 8px;
}


button {
    background: #000000;
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 8px 16px;
    margin: 5px;
    border-radius: 25px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

button:hover {
    background: #333333;
    border-color: rgba(255,255,255,0.4);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

button.active {
    background: #ffffff;
    color: #000000;
    border-color: #ffffff;
}

/* Oscar-specific button styling is in script_with_oscars.js */

#description {
    background: rgba(255,255,255,0.95);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
    font-style: italic;
    color: #666;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.main-content {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

#chart {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    min-height: 600px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
}

.sidebar {
    width: 262px;
    display: flex;
    flex-direction: column;
}

.legend {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    margin-top: 60px;
}

.bottom-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.instructions {
    background: #1e1e1e;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.legend h3 {
    margin-bottom: 15px;
    color: #ffffff;
    font-weight: 400;
    padding-bottom: 10px;
}

.instructions h3 {
    margin-bottom: 15px;
    color: #ffffff;
    font-weight: 400;
    border-bottom: 2px solid rgba(255,255,255,0.2);
    padding-bottom: 10px;
}

.legend-instruction {
    font-size: 0.75rem;
    color: #ffffff;
    margin: -10px 0 15px 0;
    line-height: 1.2;
}

#legend-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    flex: 1;
    overflow-y: auto;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 4px;
    border-radius: 6px;
    background: rgba(255,255,255,0.05);
    font-size: 0.75rem;
    transition: background-color 0.2s ease;
}

.legend-item:hover {
    background: rgba(255,255,255,0.1);
}

.category-checkbox {
    width: 12px;
    height: 12px;
    cursor: pointer;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.legend-label {
    font-weight: 400;
    line-height: 1.2;
    cursor: pointer;
    flex: 1;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.legend-controls {
    display: none;
}

.instructions ul {
    padding-left: 20px;
}

.instructions li {
    margin-bottom: 8px;
    line-height: 1.4;
    color: #ffffff;
    font-size: 0.875rem;
}

.analysis {
    background: #1e1e1e;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.analysis h3 {
    margin-bottom: 15px;
    color: #ffffff;
    font-weight: 400;
    border-bottom: 2px solid rgba(255,255,255,0.2);
    padding-bottom: 10px;
}

.analysis ul {
    padding-left: 20px;
    margin: 15px 0;
}

.analysis li {
    margin-bottom: 8px;
    line-height: 1.5;
    color: #ffffff;
    font-size: 0.875rem;
}

.analysis p {
    line-height: 1.6;
    margin-bottom: 15px;
    color: #ffffff;
    font-size: 0.875rem;
}

.footnote {
    text-align: center;
    color: rgba(255,255,255,0.7);
    margin: 0 auto 30px auto;
    max-width: 1200px;
    font-size: 0.875rem;
    line-height: 1.4;
}

.footnote a {
    color: #D0FFF9;
    text-decoration: none;
}

.footnote a:hover {
    text-decoration: underline;
}

.footer {
    text-align: center;
    color: rgba(255,255,255,0.5);
    margin: 0 auto 20px auto;
    max-width: 1200px;
    font-size: 0.7rem;
    line-height: 1.4;
}

.footer a {
    color: #D0FFF9;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Chord diagram specific styles */
.chord-group-arc {
    fill-opacity: 0.8;
    stroke: none;
    transition: opacity 0.2s ease, stroke-width 0.2s ease;
}

.chord-group-arc:hover {
    fill-opacity: 1.0;
}

.chord-group text, .chord-group-label {
    font-size: 11px;
    font-weight: 600;
    text-anchor: start;
    dominant-baseline: middle;
    fill: #ffffff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    stroke: rgba(0,0,0,0.6);
    stroke-width: 0.5px;
    paint-order: stroke fill;
    transition: opacity 0.2s ease, font-weight 0.2s ease;
}

.chord-group-label:hover {
    fill: #ffffff;
}

.chord-ribbon {
    fill-opacity: 0.67;
    stroke: none;
    transition: opacity 0.2s ease, stroke-width 0.2s ease;
}

.chord-ribbon:hover {
    fill-opacity: 0.9;
}

/* Responsive design */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .bottom-sections {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    #legend-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    button {
        padding: 8px 16px;
        margin: 3px;
        font-size: 12px;
    }
    
    #chart {
        min-height: 400px;
        padding: 15px;
    }
    
    .controls, .analysis, .footnote {
        padding: 15px;
    }
    
    .footnote-grid {
        grid-template-columns: 1fr;
    }
    
    #legend-content {
        grid-template-columns: 1fr;
    }
    
    .legend-item {
        font-size: 11px;
    }
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #2d2d2d;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 30px;
    max-width: 80vw;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 15px;
}

.modal-title {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 400;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    color: #ffffff;
}

.film-list {
    display: grid;
    gap: 15px;
    margin-top: 20px;
}

.film-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    transition: background-color 0.2s ease;
}

.film-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.film-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
}

.film-year {
    color: #cccccc;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.nominees-section {
    margin-top: 10px;
}

.category-nominees {
    margin-bottom: 10px;
}

.category-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nominee-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.nominee {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 0.75rem;
    transition: background-color 0.2s ease;
}

.nominee.winner {
    background: #D4AF37;
    color: #000000;
    font-weight: 600;
}

.loading-message {
    text-align: center;
    color: #cccccc;
    font-style: italic;
    padding: 20px;
}

.error-message {
    text-align: center;
    color: #ff6b6b;
    padding: 20px;
}