/* Custom Styles for NEB Network Admin
   Clean, professional neutral theme. Brand accent = NEB blue (#2E9BD6). */
:root {
    --brand: #2E9BD6;
    --brand-dark: #1E7FB8;
    --brand-50: #eaf5fb;
}

body { background-color: #f7f8fa; color: #1f2937; }

/* Navigation Links — quiet neutral text; active/hover use a subtle brand tint. */
.nav-link {
    padding: 0.5rem 0.9rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.15s ease;
}

.nav-link:hover {
    background-color: #f3f4f6;
    color: #111827;
}

.nav-link.active {
    background-color: var(--brand-50);
    color: var(--brand-dark);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.modal.hidden {
    display: none !important;
}

/* Toast Notifications */
.toast {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    color: white;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease-out;
}

.toast.success {
    background-color: rgb(34 197 94); /* green-500 */
}

.toast.error {
    background-color: rgb(239 68 68); /* red-500 */
}

.toast.info {
    background-color: rgb(59 130 246); /* blue-500 */
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Form Section Headings */
.form-section-heading {
    font-size: 0.7rem;
    font-weight: 600;
    color: rgb(107 114 128);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgb(229 231 235);
    padding-bottom: 0.25rem;
    margin-bottom: 0.75rem;
}

/* Duration Shortcut Buttons */
.duration-shortcuts {
    display: flex;
    gap: 0.5rem;
}

.duration-shortcuts button {
    font-size: 0.75rem;
    color: var(--brand-dark);
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid #cfe6f4;
    background: white;
    cursor: pointer;
    transition: all 0.15s ease;
}

.duration-shortcuts button:hover {
    background-color: var(--brand-50);
}

/* Transform mode toggle transition */
.transition-opacity {
    transition: opacity 0.2s ease;
}

/* Slider Rows (Edit Transformation) */
.slider-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.slider-label {
    width: 1.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgb(107 114 128);
    text-align: center;
    flex-shrink: 0;
}

.slider-input {
    flex: 1;
    height: 6px;
    appearance: none;
    background: rgb(229 231 235);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.slider-input::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--brand);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s ease;
}

.slider-input::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider-input::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--brand);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.slider-number {
    width: 4.5rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid rgb(209 213 219);
    border-radius: 0.375rem;
    font-size: 0.8rem;
    text-align: center;
    flex-shrink: 0;
}

.slider-number:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(46,155,214,0.2);
}

/* Portal Card */
.portal-card {
    border: 1px solid rgb(229 231 235); /* gray-200 */
    border-radius: 0.5rem;
    padding: 1rem;
    transition: all 0.15s ease;
    cursor: pointer;
}

.portal-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    border-color: #9fd0ec;
    background-color: var(--brand-50); /* indigo-50 */
}

/* Design Card */
.design-card {
    border: 1px solid rgb(229 231 235);
    border-radius: 0.5rem;
    padding: 1rem;
    transition: all 0.15s ease;
}

.design-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    border-color: rgb(134 239 172); /* green-300 */
    background-color: rgb(240 253 244); /* green-50 */
}

/* Location Card */
.location-card {
    border: 1px solid rgb(229 231 235);
    border-radius: 0.5rem;
    padding: 0.75rem;
    transition: all 0.15s ease;
    cursor: pointer;
}

.location-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    border-color: rgb(253 186 116); /* orange-300 */
    background-color: rgb(255 247 237); /* orange-50 */
}

/* Status badges */
.badge {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 9999px;
    font-weight: 500;
}

.badge-voting {
    background-color: rgb(243 232 255); /* purple-100 */
    color: rgb(126 34 206); /* purple-700 */
}

.badge-information {
    background-color: rgb(219 234 254); /* blue-100 */
    color: rgb(29 78 216); /* blue-700 */
}

.badge-superposition {
    background-color: rgb(255 237 213); /* orange-100 */
    color: rgb(194 65 12); /* orange-700 */
}

.badge-panel {
    background-color: rgb(209 250 229); /* emerald-100 */
    color: rgb(4 120 87); /* emerald-700 */
}

.badge-active {
    background-color: rgb(220 252 231); /* green-100 */
    color: rgb(21 128 61); /* green-700 */
}

.badge-ended {
    background-color: rgb(243 244 246); /* gray-100 */
    color: rgb(55 65 81); /* gray-700 */
}

/* Map popup custom styling */
.leaflet-popup-content-wrapper {
    border-radius: 0.5rem;
}

.leaflet-popup-content {
    font-size: 0.875rem;
}

/* Loading spinner */
.spinner {
    width: 2rem;
    height: 2rem;
    border: 4px solid #cfe6f4;
    border-top-color: var(--brand-dark); /* indigo-600 */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgb(243 244 246);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgb(209 213 219);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgb(156 163 175);
}

/* Results Bar */
.results-bar {
    height: 1rem;
    border-radius: 9999px;
    overflow: hidden;
    background-color: rgb(229 231 235); /* gray-200 */
}

.results-bar-fill {
    height: 100%;
    transition: all 0.5s ease;
}

/* Matrix Preview Canvas */
#matrix-preview-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Status badges */
.badge-draft { background-color: rgb(243 244 246); color: rgb(55 65 81); }
.badge-archived { background-color: rgb(254 226 226); color: rgb(153 27 27); }

.badge-audio { background-color: rgb(224 231 255); color: rgb(67 56 202); }

.badge-permanent { background-color: rgb(236 253 245); color: rgb(4 120 87); }
.badge-upcoming { background-color: rgb(254 249 195); color: rgb(161 98 7); }

.badge-needs-scan { background-color: rgb(255 237 213); color: rgb(194 65 12); }
.badge-scanned { background-color: rgb(204 251 241); color: rgb(15 118 110); }
.env-num { display:block; width:100%; margin-top:2px; background:#fff; border:1px solid #d1d5db; border-radius:4px; padding:3px 6px; color:#111827; }

.badge-processing { background-color: rgb(254 243 199); color: rgb(180 83 9); }
.badge-failed { background-color: rgb(254 226 226); color: rgb(153 27 27); }
.badge-vps { background-color: rgb(220 252 231); color: rgb(22 101 52); }

/* ── Dreaming portal ─────────────────────────────────────────── */
.dream-card { background: white; border-radius: 0.75rem; box-shadow: 0 1px 3px rgba(0,0,0,.08); padding: 1.25rem; }
.dream-photo-preview { aspect-ratio: 4 / 3; background: rgb(243 244 246); border-radius: 0.5rem; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.dream-photo-preview img { width: 100%; height: 100%; object-fit: contain; }
.dream-tab { padding: 0.5rem 0.9rem; font-size: 0.875rem; color: rgb(75 85 99); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.dream-tab:hover { color: rgb(17 24 39); }
.dream-tab.active { color: rgb(13 148 136); border-bottom-color: rgb(13 148 136); font-weight: 500; }
.dream-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.dream-tile { border: 1px solid rgb(229 231 235); border-radius: 0.6rem; overflow: hidden; background: white; display: flex; flex-direction: column; }
.dream-tile-img { aspect-ratio: 4 / 3; background: rgb(243 244 246); display: flex; align-items: center; justify-content: center; color: rgb(156 163 175); }
.dream-tile-img img { width: 100%; height: 100%; object-fit: cover; }
.dream-tile audio { width: 100%; height: 32px; }
.badge-pending { background-color: rgb(254 243 199); color: rgb(180 83 9); }
.badge-ready { background-color: rgb(220 252 231); color: rgb(22 101 52); }
.badge-root { background-color: rgb(224 231 255); color: rgb(67 56 202); }
/* Above the portal detail overlay (appended to <body> after these), so it can open them. */
#dream-create-modal, #dream-detail-modal { z-index: 60; }
.badge-dreaming { background-color: rgb(204 251 241); color: rgb(15 118 110); }
.badge-guest { background-color: rgb(237 233 254); color: rgb(91 33 182); }
.badge-decision { background-color: rgb(254 249 195); color: rgb(133 77 14); }
.badge-dwelling { background-color: rgb(220 252 231); color: rgb(22 101 52); }

/* Edit matrix: scene toolbar (view, overlay, visibility, gizmo) floating on the canvas, tabbed sidebar */
.env-bar { display:flex; flex-wrap:wrap; align-items:center; gap:4px; background:rgba(17,24,39,.8); backdrop-filter:blur(6px); border:1px solid rgba(255,255,255,.08); border-radius:10px; padding:4px; color:#e5e7eb; font-size:12px; z-index:5; }
.env-seg { display:flex; background:rgba(255,255,255,.06); border-radius:7px; padding:2px; }
.env-seg button, .env-tool { padding:4px 10px; border-radius:6px; color:#cbd5e1; white-space:nowrap; }
.env-seg button:hover:not(:disabled), .env-tool:hover { color:#fff; background:rgba(255,255,255,.08); }
.env-seg button.is-on, .env-tool.is-on { background:#1E7FB8; color:#fff; }
.env-seg button:disabled, .env-tool:disabled { opacity:.35; cursor:not-allowed; background:none; }
.env-chip { position:relative; display:inline-flex; align-items:center; gap:6px; padding:4px 8px; border-radius:6px; cursor:pointer; color:#9ca3af; user-select:none; white-space:nowrap; }
.env-chip:hover { color:#fff; }
.env-chip input { position:absolute; opacity:0; width:0; height:0; }
.env-chip:has(input:checked) { background:rgba(46,155,214,.45); color:#fff; }
.env-chip:has(input:focus-visible) { outline:2px solid #5cafdf; }
.env-chip.is-disabled { opacity:.35; pointer-events:none; }
.env-sep { width:1px; align-self:stretch; margin:2px 2px; background:rgba(255,255,255,.12); }
.env-range { width:84px; accent-color:#5cafdf; }
.env-tab { flex:1; padding:10px 6px; font-size:13px; color:#6b7280; border-bottom:2px solid transparent; }
.env-tab:hover { color:#374151; }
.env-tab.is-on { color:#186a9b; border-color:#1E7FB8; font-weight:600; background:#f9fafb; }
.env-card { background:#fff; border:1px solid #e5e7eb; border-radius:10px; padding:12px; }

/* Creator panel: a portal's publication status (draft → review → published; changes / archived) */
.badge-st-draft { background-color: rgb(243 244 246); color: rgb(55 65 81); }
.badge-st-review { background-color: rgb(254 243 199); color: rgb(146 64 14); }
.badge-st-changes { background-color: rgb(255 237 213); color: rgb(194 65 12); }
.badge-st-published { background-color: rgb(220 252 231); color: rgb(22 101 52); }
.badge-st-archived { background-color: rgb(254 226 226); color: rgb(153 27 27); }
.badge-cr-pending { background-color: rgb(254 243 199); color: rgb(146 64 14); }
.badge-cr-approved { background-color: rgb(220 252 231); color: rgb(22 101 52); }
.badge-cr-rejected { background-color: rgb(254 226 226); color: rgb(153 27 27); }
.badge-cr-revoked { background-color: rgb(229 231 235); color: rgb(55 65 81); }
.badge-cr-none { background-color: rgb(243 244 246); color: rgb(107 114 128); }
/* A creator's portal in review / published: shown read-only (the backend refuses changes anyway: 409 LOCKED) */
.portal-readonly .replace-file-btn, .portal-readonly .delete-design-btn, .portal-readonly .vote-design-btn,
.portal-readonly #portal-dream-section button:not(.dream-view-3d) { display: none !important; }
.cp-answer dt { font-size: 0.75rem; color: rgb(107 114 128); }
.cp-answer dd { font-size: 0.875rem; color: rgb(31 41 55); margin-bottom: 0.5rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.cp-check { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; }
.cp-check .fa-circle-check { color: rgb(22 163 74); }
.cp-check .fa-circle-xmark { color: rgb(220 38 38); }
