:root {
    --primary-color: #6B2D5C;
    --secondary-color: #F4A261;
    --accent-color: #E76F51;
    --bg-dark: #1a1a2e;
    --bg-light: #16213e;
    --text-light: #ffffff;
    --text-muted: #a0a0a0;
    --stage-1: #E63946;
    --stage-2: #457B9D;
    --stage-3: #2A9D8F;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-light) 100%);
    min-height: 100vh;
    color: var(--text-light);
}

/* Header */
.header {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    text-align: center;
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 2.5rem;
    background: linear-gradient(45deg, var(--secondary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.header .subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Day Tabs */
.day-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    flex-wrap: wrap;
}

.day-tab {
    padding: 12px 30px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 30px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 600;
}

.day-tab:hover {
    background: rgba(255, 255, 255, 0.2);
}

.day-tab.active {
    background: var(--secondary-color);
    border-color: var(--accent-color);
}

/* Stage Legend */
.stage-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 15px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 5px;
}

.legend-color.stage-0 { background: var(--stage-1); }
.legend-color.stage-1 { background: var(--stage-2); }
.legend-color.stage-2 { background: var(--stage-3); }

/* Timetable Container */
.timetable-container {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Desktop View - Grid */
.timetable-grid {
    display: none;
}

.timetable-grid.active {
    display: grid;
    grid-template-columns: 80px repeat(3, 1fr);
    gap: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    overflow: hidden;
}

.grid-header {
    background: rgba(0, 0, 0, 0.4);
    padding: 15px;
    text-align: center;
    font-weight: bold;
}

.grid-header.stage-0 { border-top: 4px solid var(--stage-1); }
.grid-header.stage-1 { border-top: 4px solid var(--stage-2); }
.grid-header.stage-2 { border-top: 4px solid var(--stage-3); }

.time-slot {
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.event-cell {
    background: rgba(255, 255, 255, 0.05);
    min-height: 60px;
    position: relative;
}

.event-block {
    position: absolute;
    left: 2px;
    right: 2px;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.event-block:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.event-block.stage-0 { background: var(--stage-1); }
.event-block.stage-1 { background: var(--stage-2); }
.event-block.stage-2 { background: var(--stage-3); }

.event-block .event-name {
    font-weight: bold;
    font-size: 0.95rem;
    margin-bottom: 3px;
}

.event-block .event-time {
    font-size: 0.8rem;
    opacity: 0.9;
}

/* Mobile View - List */
.timetable-list {
    display: block;
}

.timetable-list.hidden {
    display: none;
}

.stage-section {
    margin-bottom: 30px;
}

.stage-title {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: bold;
}

.stage-title.stage-0 { background: var(--stage-1); }
.stage-title.stage-1 { background: var(--stage-2); }
.stage-title.stage-2 { background: var(--stage-3); }

.event-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: background 0.2s;
}

.event-card:hover {
    background: rgba(255, 255, 255, 0.15);
}

.event-card .time {
    font-size: 0.9rem;
    color: var(--secondary-color);
    min-width: 100px;
    text-align: center;
}

.event-card .details {
    flex: 1;
}

.event-card .name {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 3px;
}

.event-card .description {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Event Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-light);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: translateY(-20px);
    transition: transform 0.3s;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal h2 {
    margin-bottom: 15px;
    color: var(--secondary-color);
}

.modal p {
    margin-bottom: 10px;
    line-height: 1.6;
}

.modal .close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal .timeslots {
    margin-top: 20px;
}

.modal .timeslot-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 8px;
}

/* Responsive */
@media (min-width: 768px) {
    .timetable-list {
        display: none;
    }
    
    .timetable-list.hidden {
        display: none;
    }
    
    .timetable-grid {
        display: grid;
    }
    
    .timetable-grid.active {
        display: grid;
    }
}

@media (max-width: 767px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .day-tab {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .timetable-grid {
        display: none !important;
    }
    
    .timetable-list {
        display: block !important;
    }
    
    .timetable-list.hidden {
        display: none !important;
    }
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer a {
    color: var(--secondary-color);
    text-decoration: none;
}
