/* GLOBAL & CONTAINER */
body { font-family: 'Segoe UI', system-ui, sans-serif; background: #121212; color: #e0e0e0; padding: 0; margin: 0; overflow-x: hidden; }
.container { max-width: 1300px; margin: auto; padding: 0 20px 180px 20px; }

/* HEADER & STICKY NAV */
.sticky-header {
    position: sticky;
    top: 0;
    background: #121212;
    z-index: 100;
    padding: 15px 0;
    border-bottom: 1px solid #333;
}
.header-top { display: flex; justify-content: space-between; align-items: center; }
h1 { font-size: 1.4rem; margin: 0; }

.filter-toggle {
    background: #1e1e1e; border: 1px solid #444; color: #eee;
    padding: 6px 12px; border-radius: 4px; cursor: pointer;
    font-size: 0.8rem; display: flex; align-items: center; gap: 8px;
}
.filter-toggle:hover { background: #2a2a2a; border-color: #666; }

/* COLLAPSIBLE FILTER BAR */
#filterForm.filter-bar { 
    background-color: #1a1a1a !important; 
    border-radius: 8px; 
    display: none; 
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 25px; 
    border: 1px solid #333; 
    padding: 20px; 
    margin-top: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}
#filterForm.filter-bar.active { display: grid !important; }

/* FILTER GROUPS */
.filter-group { display: flex; flex-direction: column; gap: 8px; }
.filter-group label.group-label { color: #666; font-weight: bold; text-transform: uppercase; font-size: 0.65rem; letter-spacing: 1px; margin-bottom: 4px; border-bottom: 1px solid #222; padding-bottom: 4px; }
#filterForm .checkbox-item { background: transparent !important; font-size: 0.75rem; color: #ccc !important; display: flex; align-items: center; gap: 8px; cursor: pointer; height: 18px; }
#filterForm input[type="checkbox"] { accent-color: #00d2ff; margin: 0; cursor: pointer; width: 14px; height: 14px; }

/* REGION GRID - 3x3 Layout */
.region-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 85px); 
    gap: 8px 0; 
}
.region-group { grid-column: span 1; }

/* SERVER ROWS */
#server-list-container { margin-top: 20px; }
.server-row { 
    display: flex; align-items: center; gap: 15px; margin-bottom: 8px; 
    background: #1a1a1a; padding: 8px 12px; border-radius: 6px; border: 1px solid #2a2a2a;
}
.server-info { flex: 0 0 300px; display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.server-name { font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.server-address { font-size: 0.75rem; font-family: monospace; color: #666; text-decoration: none; transition: color 0.2s; }
.server-address:hover { color: #4caf50 !important; }

/* TIMELINE */
.timeline-container { 
    flex: 1; position: relative; height: 28px; background: #222; 
    border-radius: 4px; display: flex; border: 1px solid #333; 
    overflow: hidden; min-width: 0;
}
.slot { flex: 1 0 0; height: 100%; border-right: 1px solid rgba(0,0,0,0.1); }
.active { background-color: #4caf50 !important; } 
.idle { background-color: #2a2a2a !important; }   
.future.active { background-color: #00d2ff !important; opacity: 0.6; }                         
.now-indicator { position: absolute; top: 0; bottom: 0; width: 2px; background: #ff5252; z-index: 10; box-shadow: 0 0 8px rgba(255, 82, 82, 0.8); }

/* FOOTER */
.fixed-footer { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(15, 15, 15, 0.98); backdrop-filter: blur(12px); border-top: 1px solid #333; z-index: 110; padding: 8px 0; }
.footer-content { max-width: 1300px; margin: auto; padding: 0 20px; display: flex; align-items: center; gap: 10px; }
.legend { flex: 0 0 320px; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; padding-left: 12px; order: 1; }
.legend-item { display: flex; align-items: center; color: #aaa; white-space: nowrap; }
.legend-item span { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }

/* LABELS */
.label-row { flex: 1; position: relative; height: 18px; order: 2; padding: 0; margin: 0; overflow: visible; }
.labels { position: relative; width: 100%; height: 100%; font-size: 10px; color: #888; }
.labels span { position: absolute; white-space: nowrap; transform: translateX(-50%); }
.date-label { color: #fff !important; font-weight: bold; }

/* RESPONSIVE */
@media (max-width: 800px) {
    .container { padding: 0 10px 140px 10px; }
    .server-row { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px; }
    .server-info { flex: none; width: 100%; border-bottom: 1px solid #333; padding-bottom: 6px; }
    .timeline-container { width: 100%; height: 28px; min-height: 28px; flex: none; display: flex; } 
    .footer-content { flex-direction: column; gap: 8px; padding: 0 10px; }
    .label-row { order: 1; width: 100%; margin: 0; height: 18px; flex: none; } 
    .legend { order: 2; flex: none; width: 100%; padding-left: 0; justify-content: center; gap: 8px; }
    
    #filterForm.filter-bar { 
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); 
        gap: 15px; 
        padding: 15px;
    }
    .region-group { grid-column: span 2; } 
}