* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #1a1a2e; color: #e0e0e0; min-height: 100vh; }
a { color: #64b5f6; text-decoration: none; }
a:hover { text-decoration: underline; }

header { background: #16213e; padding: 1.5rem 2rem; text-align: center; border-bottom: 3px solid #e94560; }
header h1 { font-size: 1.8rem; color: #fff; }
.subtitle { color: #aaa; margin-top: 0.3rem; font-size: 0.95rem; }

.container { display: flex; max-width: 1400px; margin: 0 auto; gap: 1.5rem; padding: 1.5rem; }

/* FILTERS */
.filters { flex: 0 0 260px; background: #16213e; border-radius: 12px; padding: 1.2rem; position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
.filters h2 { font-size: 1.1rem; margin-bottom: 1rem; color: #e94560; }
.filter-group { margin-bottom: 1rem; }
.filter-group h3 { font-size: 0.85rem; text-transform: uppercase; color: #888; margin-bottom: 0.4rem; letter-spacing: 0.5px; }
.filter-label { display: flex; align-items: center; gap: 0.5rem; padding: 0.25rem 0; font-size: 0.85rem; cursor: pointer; }
.filter-label:hover { color: #fff; }
.filter-label input[type="checkbox"] { accent-color: #e94560; width: 16px; height: 16px; }
.filter-actions { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.btn-filter { background: #0f3460; border: none; color: #e0e0e0; padding: 0.4rem 0.8rem; border-radius: 6px; cursor: pointer; font-size: 0.8rem; }
.btn-filter:hover { background: #1a5276; }

/* SYNC PANEL */
.sync-panel { border-top: 1px solid #333; padding-top: 0.8rem; }
.btn-sync { background: #0f3460; border: none; color: #e0e0e0; padding: 0.45rem 0.8rem; border-radius: 6px; cursor: pointer; font-size: 0.8rem; width: 100%; margin-bottom: 0.4rem; }
.btn-sync:hover { background: #1a5276; }
.btn-sync-disconnect { background: #4a1a1a; }
.btn-sync-disconnect:hover { background: #6b2a2a; }
.btn-sync-sm { background: none; border: none; cursor: pointer; font-size: 1rem; padding: 0.1rem 0.3rem; }
.sync-load-row { display: flex; gap: 0.4rem; margin-top: 0.3rem; }
.sync-input { flex: 1; min-width: 0; background: #1a1a2e; border: 1px solid #333; color: #fff; padding: 0.5rem 0.6rem; border-radius: 6px; font-size: 1rem; font-family: monospace; text-transform: uppercase; letter-spacing: 1px; }
.sync-input::placeholder { color: #555; text-transform: none; letter-spacing: 0; }
.sync-load-row .btn-sync { width: auto; margin-bottom: 0; flex-shrink: 0; padding: 0.5rem 0.9rem; font-size: 1.1rem; min-height: 44px; min-width: 44px; display: flex; align-items: center; justify-content: center; }
.sync-code-display { display: flex; align-items: center; gap: 0.4rem; background: #1a1a2e; padding: 0.5rem 0.7rem; border-radius: 8px; margin-bottom: 0.4rem; }
.sync-code-label { font-size: 0.75rem; color: #888; }
.sync-code-display strong { font-family: monospace; font-size: 1.05rem; color: #ffd700; letter-spacing: 1.5px; }
.sync-status { font-size: 0.75rem; color: #4caf50; margin-bottom: 0.4rem; min-height: 1.1em; }
.sync-status.error { color: #e94560; }

/* EVENTS */
.events { flex: 1; width: 100%; }
.day-header { font-size: 1.3rem; color: #e94560; padding: 0.8rem 0 0.5rem; border-bottom: 2px solid #333; margin-bottom: 0.8rem; }

.event-card { background: #16213e; border-radius: 10px; margin-bottom: 0.6rem; overflow: hidden; transition: transform 0.1s; }
.event-card:hover { transform: translateX(3px); }
.event-main { display: flex; align-items: center; padding: 0.7rem 1rem; gap: 0.8rem; }

.event-fav { flex: 0 0 32px; }
.fav-btn { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: #666; transition: color 0.2s; }
.fav-btn:hover, .fav-btn.active { color: #ffd700; }

.event-info { flex: 1; min-width: 0; }
.event-time { font-size: 0.8rem; color: #aaa; font-weight: 600; }
.event-name { font-size: 1.05rem; font-weight: 700; color: #fff; margin: 0.15rem 0; }
.event-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.event-stage { font-size: 0.75rem; color: #90caf9; }
.event-section { font-size: 0.7rem; padding: 0.1rem 0.5rem; border-radius: 4px; text-transform: uppercase; font-weight: 600; }
.section-bands { background: #4a148c; color: #fff; }
.section-djs { background: #1b5e20; color: #fff; }
.section-extras { background: #bf360c; color: #fff; }
.event-tag { font-size: 0.7rem; background: #333; color: #ccc; padding: 0.1rem 0.5rem; border-radius: 4px; }
.event-desc { font-size: 0.78rem; color: #999; margin-top: 0.3rem; line-height: 1.3; }

.event-actions { flex: 0 0 auto; display: flex; flex-direction: column; gap: 0.3rem; }
.btn-cal { display: inline-block; padding: 0.3rem 0.7rem; border-radius: 6px; font-size: 0.75rem; white-space: nowrap; text-align: center; }
.btn-gcal { background: #1a73e8; color: #fff; }
.btn-gcal:hover { background: #1565c0; text-decoration: none; }
.btn-ics { background: #333; color: #e0e0e0; }
.btn-ics:hover { background: #555; text-decoration: none; }

/* MAIN CONTENT WRAPPER */
.main-content { flex: 1; min-width: 0; }

/* VIEW TOGGLE */
.view-toggle { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.btn-view { background: #0f3460; border: none; color: #aaa; padding: 0.5rem 1.2rem; border-radius: 8px; cursor: pointer; font-size: 0.9rem; font-weight: 600; transition: background 0.2s, color 0.2s; }
.btn-view.active { background: #e94560; color: #fff; }
.btn-view:hover { color: #fff; }

/* TIMELINE */
.timeline-view { background: #16213e; border-radius: 12px; padding: 1rem; }
.timeline-day-tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.timeline-day-tab { background: #0f3460; border: none; color: #aaa; padding: 0.4rem 1rem; border-radius: 6px; cursor: pointer; font-size: 0.85rem; font-weight: 600; }
.timeline-day-tab.active { background: #e94560; color: #fff; }
.timeline-day-tab:hover { color: #fff; }

.timeline-grid-wrapper { overflow-x: auto; padding-bottom: 0.5rem; }
.timeline-grid { display: grid; position: relative; min-width: 100%; }

.tl-header-cell { position: sticky; top: 0; background: #1a1a2e; color: #aaa; font-size: 0.7rem; text-align: center; padding: 0.3rem 0; border-bottom: 1px solid #333; z-index: 2; white-space: nowrap; }
.tl-stage-label { position: sticky; left: 0; background: #16213e; color: #90caf9; font-size: 0.78rem; font-weight: 700; padding: 0.4rem 0.6rem; display: flex; align-items: center; border-right: 1px solid #333; z-index: 3; white-space: nowrap; min-height: 44px; }
.tl-corner { position: sticky; left: 0; top: 0; background: #16213e; z-index: 4; border-right: 1px solid #333; border-bottom: 1px solid #333; }

.tl-event { border-radius: 5px; padding: 0.2rem 0.4rem; font-size: 0.7rem; font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; display: flex; align-items: center; gap: 0.3rem; min-height: 36px; margin: 2px 1px; border-left: 3px solid rgba(255,255,255,0.3); transition: filter 0.2s; }
.tl-event:hover { filter: brightness(1.2); z-index: 10; white-space: normal; overflow: visible; position: relative; }
.tl-event.is-fav { border-left-color: #ffd700; }
.tl-event.is-fav::after { content: '★'; color: #ffd700; margin-left: auto; flex-shrink: 0; }
.tl-event.hidden-fav { opacity: 0.12; pointer-events: none; }

.tl-row-bg { border-bottom: 1px solid #222; }
.tl-hour-line { border-left: 1px solid #333; }

footer { text-align: center; padding: 2rem; color: #666; font-size: 0.85rem; }

/* RESPONSIVE */
@media (max-width: 768px) {
    .container { flex-direction: column; padding: 0.8rem; }
    .filters { position: static; max-height: none; flex: none; }
    .event-main { flex-wrap: wrap; }
    .event-actions { flex-direction: row; width: 100%; margin-top: 0.4rem; }
    header h1 { font-size: 1.3rem; }
}

