/* wwwroot/css/site.css */

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

.hidden { display: none !important; }

html, body {
    height: 100%;
    overflow: hidden;
    background: #0d1117;
    color: #e2e8f0;
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 14px;
}

/* ── Layout ─────────────────────────────────── */
#app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* The <main> element wraps #map and acts as the flex child */
#app-container > main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

#map {
    flex: 1;
    min-width: 0;
}

/* ── Right Panel ────────────────────────────── */
#control-panel {
    width: 360px;
    flex-shrink: 0;
    background: #161b27;
    border-left: 1px solid #2a3040;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.panel-header {
    background: #1e2535;
    padding: 12px 14px;
    border-bottom: 1px solid #2a3040;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.panel-title   { font-size: 14px; font-weight: 600; color: #e2e8f0; }
.panel-subtitle { font-size: 12px; color: #64748b; }

.panel-section {
    padding: 12px 14px;
    border-bottom: 1px solid #1e2535;
}
.panel-section--flex { flex: 1; }

.section-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-hint { font-size: 12px; color: #4a9eff; margin-top: 5px; }

/* ── Custom location dropdown ─────────────── */
.cs-wrap {
    position: relative;
    width: 100%;
    font-size: 14px;
    user-select: none;
}

/* The "button" row showing current value */
.cs-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #0d1117;
    color: #e2e8f0;
    border: 1px solid #2a3040;
    border-radius: 5px;
    padding: 6px 8px;
    cursor: pointer;
}
.cs-wrap:focus .cs-selected,
.cs-wrap.open  .cs-selected {
    outline: 2px solid #4a9eff;
    outline-offset: 1px;
    border-color: #4a9eff;
}
.cs-arrow { font-size: 12px; color: #64748b; transition: transform 0.15s; }
.cs-wrap.open .cs-arrow { transform: rotate(180deg); }

/* The drop-down list */
.cs-options {
    display: none;
    position: absolute;
    top: calc(100% + 3px);
    left: 0;
    right: 0;
    z-index: 9999;
    list-style: none;
    background: #1e2535;
    border: 1px solid #2a3040;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.cs-wrap.open .cs-options { display: block; }

.cs-option {
    padding: 7px 10px;
    color: #c0cce0;
    cursor: pointer;
    transition: color 0.1s;
}
.cs-option:hover {
    color: #7dc4ff;
}
.cs-option--active {
    color: #4a9eff;
    font-weight: 600;
}


/* ── Selection badge ─────────────────────── */
.selection-badge {
    background: #4a9eff;
    color: #000;
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 12px;
    font-weight: 700;
    display: none;
}
.selection-badge.visible { display: inline; }

/* ── Action buttons ──────────────────────── */
.action-buttons { display: flex; gap: 6px; margin-bottom: 8px; }

.action-btn {
    flex: 1;
    border: none;
    border-radius: 5px;
    padding: 7px 4px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s;
}
.action-btn:disabled   { opacity: 0.35; cursor: not-allowed; }
.action-btn.on         { background: #22c55e; color: #000; }
.action-btn.off        { background: #ef4444; color: #fff; }
.action-btn.dim        { background: #f59e0b; color: #000; }
.action-btn.deselect   { background: #444; color: #ccc; border: 1px solid #666; width: 100%; margin-top: 0.5rem; flex: none; }
.action-btn.deselect:hover:not(:disabled) { background: #555; color: #fff; }

/* ── Dim slider ──────────────────────────── */
.dim-slider-container {
    background: #0d1117;
    border: 1px solid #2a3040;
    border-radius: 5px;
    padding: 8px 10px;
}
.slider-label { font-size: 12px; color: #94a3b8; margin-bottom: 6px; }
#dim-slider   { width: 100%; accent-color: #f59e0b; cursor: pointer; }

/* ── Info grid ───────────────────────────── */
.info-placeholder {
    color: #64748b;
    font-size: 14px;
    font-style: italic;
    line-height: 1.6;
    padding: 6px 0;
}
.info-hint { font-size: 12px; }

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 8px;
    font-size: 14px;
}
.info-grid dt           { color: #64748b; }
.info-grid dd           { color: #e2e8f0; }
.info-grid dd.status-on  { color: #22c55e; font-weight: 600; }
.info-grid dd.status-dim { color: #f59e0b; font-weight: 600; }
.info-grid dd.status-off { color: #888888; font-weight: 600; }

/* ── Map legend ──────────────────────────── */
.map-legend {
    background: rgba(0, 0, 0, 0.72);
    padding: 6px 10px;
    border-radius: 5px;
    font-size: 12px;
    line-height: 1.8;
    color: #ccc;
    pointer-events: none;
}
.legend-on  { color: #ffd700; }
.legend-dim { color: #b8860b; }
.legend-off { color: #666666; }

/* ── Lasso cursor ────────────────────────── */
.leaflet-container.lasso-active { cursor: crosshair !important; }

/* ── Accordion ───────────────────────────── */
.acc-section {
    border-bottom: 1px solid #1e2535;
}

.acc-section > summary.acc-summary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #94a3b8;
    list-style: none;
    user-select: none;
    background: #161b27;
    transition: background 0.15s, color 0.15s;
}
/* Hide browser's default disclosure triangle */
.acc-section > summary.acc-summary::-webkit-details-marker { display: none; }
.acc-section > summary.acc-summary::marker { display: none; }

.acc-section[open] > summary.acc-summary {
    color: #e2e8f0;
    background: #1e2535;
    border-bottom: 1px solid #2a3040;
}

.acc-section > summary.acc-summary:hover {
    background: #1e2535;
    color: #e2e8f0;
}

.acc-body {
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ── Reposition move-mode ─────────────────── */
.move-street-row { display: flex; flex-direction: column; gap: 4px; }

.move-street-input {
    width: 100%;
    background: #0d1117;
    color: #e2e8f0;
    border: 1px solid #2a3040;
    border-radius: 5px;
    padding: 6px 8px;
    font-size: 14px;
}
.move-street-input:focus { outline: 2px solid #00bcd4; outline-offset: 1px; }

.move-edits-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: 110px;
    overflow-y: auto;
}
.move-edit-item {
    font-family: monospace;
    font-size: 12px;
    color: #ff9800;
    padding: 2px 0;
    border-bottom: 1px solid #1e2535;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.move-actions { display: flex; gap: 6px; }
.action-btn.save-pos    { background: #22c55e; color: #000; flex: 1; }
.action-btn.discard-pos { background: #444; color: #ccc; border: 1px solid #666; flex: 1; }
.action-btn.discard-pos:hover:not(:disabled) { background: #555; color: #fff; }

/* Crosshair on markers when in move mode */
.leaflet-container.move-mode .leaflet-interactive { cursor: crosshair !important; }

/* Invisible proxy icon for drag handle */
.move-proxy-icon { background: transparent; border: none; }
