:root {
    --bg-color: #050508;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --accent-color: #40E0D0;
    --accent-glow: rgba(64, 224, 208, 0.5);
    
    --glass-bg: rgba(20, 20, 30, 0.4);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow: hidden; /* Canvas takes full screen */
    width: 100vw;
    height: 100vh;
}

#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
}

#astrometry-overlay {
    position: absolute;
    inset: 0;
    z-index: 8;
    pointer-events: none;
    --astrometry-color: #34f5ff;
    --astrometry-thickness: 1.5;
}

#astrometry-svg {
    width: 100%;
    height: 100%;
}

.astrometry-marker {
    color: var(--astrometry-color);
}

.astrometry-marker line,
.astrometry-marker circle {
    stroke: currentColor;
    stroke-width: var(--astrometry-thickness);
    fill: none;
    opacity: 0.96;
    vector-effect: non-scaling-stroke;
}

.astrometry-marker text {
    fill: currentColor;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    letter-spacing: 0.02em;
    paint-order: stroke;
    stroke: rgba(0, 0, 0, 0.7);
    stroke-width: 2.2px;
    stroke-linejoin: round;
}

/* Glassmorphism Panel Utilities */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 16px;
    padding: 1.5rem;
    pointer-events: auto; /* Re-enable clicks on panels */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-panel:hover {
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Sidebar scrollbar */
#sidebar::-webkit-scrollbar {
    width: 4px;
}

#sidebar::-webkit-scrollbar-track {
    background: transparent;
}

#sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

#sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Header */
header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.highlight {
    color: var(--accent-color);
    text-shadow: 0 0 20px var(--accent-glow);
}

header p {
    color: var(--text-secondary);
    font-weight: 300;
    line-height: 1.5;
}

/* Controls */
.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.accordion-root {
    gap: 0.75rem;
}

.accordion-section {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(6, 6, 12, 0.28);
    overflow: hidden;
}

.accordion-trigger {
    width: 100%;
    border: 0;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 0.9rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.accordion-trigger:hover {
    background: rgba(255, 255, 255, 0.08);
}

.accordion-trigger:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: -2px;
}

.accordion-icon {
    width: 0.55rem;
    height: 0.55rem;
    border-right: 2px solid var(--accent-color);
    border-bottom: 2px solid var(--accent-color);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    margin-right: 0.2rem;
}

.accordion-section.is-open .accordion-icon {
    transform: rotate(225deg);
}

.accordion-panel {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
    padding: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.accordion-panel[hidden] {
    display: none;
}

label {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

select {
    appearance: none;
    background-color: rgba(0, 0, 0, 0.3);
    color: white;
    border: 1px solid var(--glass-border);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

select:hover, select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 15px var(--accent-glow);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color), #00897B);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px var(--accent-glow);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
}

.btn-secondary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.animation-toggle-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.55rem;
}

.anim-toggle-btn {
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-radius: 9px;
    padding: 0;
    aspect-ratio: 1 / 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.anim-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.28);
}


.anim-toggle-btn.is-active,
.anim-toggle-btn[aria-pressed="true"] {
    background: rgba(64, 224, 208, 0.18);
    border-color: rgba(64, 224, 208, 0.7);
    box-shadow: 0 0 0 1px rgba(64, 224, 208, 0.2), 0 0 18px rgba(64, 224, 208, 0.2);
}

.animation-recording-panel {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-top: 0.35rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.animation-record-button {
    gap: 0.75rem;
    justify-content: flex-start;
}

.animation-record-button.is-recording {
    background: rgba(255, 94, 94, 0.16);
    border-color: rgba(255, 94, 94, 0.5);
    color: #ffd9d9;
}

.animation-record-button.is-processing {
    opacity: 0.7;
    cursor: progress;
}

.animation-record-button__key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.8rem;
    height: 1.8rem;
    border-radius: 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.08em;
}

.animation-record-status {
    font-size: 0.78rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.62);
}

body.recording-ui-hidden #sidebar,
body.recording-ui-hidden #menu-toggle,
body.recording-ui-hidden #loader,
body.recording-ui-hidden #image-inspector-modal {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.anim-toggle-btn[aria-pressed="true"] {
    background: linear-gradient(135deg, rgba(125, 66, 255, 0.42), rgba(81, 45, 168, 0.65));
    border-color: rgba(179, 151, 255, 0.95);
    box-shadow: 0 0 0 1px rgba(179, 151, 255, 0.4);
}

.anim-toggle-btn:active {
    transform: translateY(1px);
}

.animation-advanced-controls,
.animation-spin-controls {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-top: 0.15rem;
    padding-top: 0.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Sliders */
.slider-group label {
    display: flex;
    justify-content: space-between;
}

.slider-group span {
    color: var(--accent-color);
    font-weight: 600;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    margin-top: 0.5rem;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-primary);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    transition: transform 0.1s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}


/* Loading Overlay */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-color);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.loader-panel {
    width: min(520px, calc(100vw - 3rem));
    padding: 2rem 2.2rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(14, 14, 24, 0.92), rgba(6, 6, 12, 0.9));
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.loader-title {
    color: var(--accent-color);
    font-size: clamp(1.4rem, 2vw, 1.7rem);
    font-weight: 600;
    letter-spacing: 0.01em;
}

.loader-progress {
    margin-top: 1rem;
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.loader-progress-fill {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #40E0D0 0%, #80FFE8 100%);
    box-shadow: 0 0 22px rgba(64, 224, 208, 0.35);
    transition: width 0.25s ease;
}

.loader-meta {
    margin-top: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.loader-status {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.92rem;
    line-height: 1.5;
}

.loader-percent {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.08em;
}

.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Toggle Switch */
.toggle-group {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 22px;
}

.switch .slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-primary);
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent-color);
}

input:checked + .slider:before {
    transform: translateX(18px);
}

/* Small switch variant for inline use */
.switch-sm {
    width: 32px;
    height: 18px;
}

.switch-sm .slider {
    border-radius: 18px;
}

.switch-sm .slider:before {
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
}

.switch-sm input:checked + .slider:before {
    transform: translateX(14px);
}

/* RGB toggle inline layout */
.rgb-toggle-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 4px;
    vertical-align: middle;
}

.rgb-toggle-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1px;
    background: linear-gradient(90deg, #ff7b54, #ffd166, #4ecdc4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Collapsible RGB depth panel */
.rgb-depth-panel {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: max-height 0.35s ease, opacity 0.3s ease, transform 0.3s ease,
                margin 0.35s ease, padding 0.35s ease;
    margin: 0;
    padding: 0 0.75rem;
    border-left: 2px solid transparent;
    border-radius: 4px;
}

.rgb-depth-panel.rgb-panel-open {
    max-height: 220px;
    opacity: 1;
    transform: translateY(0);
    margin: 0.25rem 0;
    padding: 0.5rem 0.75rem;
    border-left-color: rgba(255, 255, 255, 0.1);
}

.mesh-brush-subsection {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-top: 0.4rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mesh-brush-heading {
    font-size: 0.74rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
}

.mesh-brush-panel {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: max-height 0.35s ease, opacity 0.3s ease, transform 0.3s ease,
                margin 0.35s ease, padding 0.35s ease;
    margin: 0;
    padding: 0 0.75rem;
    border-left: 2px solid transparent;
}

.mesh-brush-panel.mesh-brush-panel-open {
    max-height: 420px;
    opacity: 1;
    transform: translateY(0);
    margin: 0.1rem 0;
    padding: 0.55rem 0.75rem;
    border-left-color: rgba(255, 255, 255, 0.1);
}

.mesh-brush-tip {
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.58);
    line-height: 1.35;
}

.color-depth-picker-group {
    gap: 0.75rem;
}

.color-picker-row {
    display: grid;
    grid-template-columns: minmax(72px, 88px) minmax(0, 1fr);
    gap: 0.75rem;
    align-items: center;
}

input[type="color"] {
    width: 100%;
    min-height: 46px;
    padding: 0;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 4px;
}

input[type="color"]::-webkit-color-swatch {
    border: 0;
    border-radius: 7px;
}

.picker-status {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.58);
}

.parallax-add-layer-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.parallax-add-layer-btn-square {
    width: auto !important;
    flex-shrink: 0;
    padding: 0 !important;
    width: 2.75rem !important;
    height: 2.75rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: inherit;
}

.parallax-tip {
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.58);
    line-height: 1.35;
}

.parallax-layer-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.parallax-layer-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.parallax-layer-card:hover {
    border-color: rgba(150, 210, 255, 0.38);
    background: rgba(255, 255, 255, 0.06);
}

.parallax-layer-card.is-selected {
    border-color: rgba(122, 196, 255, 0.72);
    background: rgba(80, 170, 255, 0.12);
    box-shadow: inset 0 0 0 1px rgba(140, 210, 255, 0.32);
}

.parallax-layer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    cursor: pointer;
}

.parallax-layer-header:focus-visible {
    outline: 2px solid rgba(122, 196, 255, 0.95);
    outline-offset: 2px;
    border-radius: 8px;
}

.parallax-layer-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.parallax-layer-title {
    font-size: 0.75rem;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.74);
}

.parallax-layer-delete-btn,
.parallax-layer-expand-btn,
.parallax-layer-view-btn {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 210, 210, 0.85);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.parallax-layer-expand-btn {
    color: rgba(255, 255, 255, 0.78);
}

.parallax-layer-view-btn {
    color: rgba(190, 228, 255, 0.9);
}

.parallax-layer-expand-btn svg,
.parallax-layer-delete-btn svg,
.parallax-layer-view-btn svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
}

.parallax-layer-expand-btn svg,
.parallax-layer-view-btn svg {
    fill: none;
}

.parallax-layer-card.is-expanded .parallax-layer-expand-btn svg {
    transform: rotate(180deg);
}

.parallax-layer-expand-btn svg {
    transition: transform 0.2s ease;
}

.parallax-layer-expand-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.34);
}

.parallax-layer-view-btn:hover:not(:disabled) {
    background: rgba(80, 170, 255, 0.2);
    border-color: rgba(120, 200, 255, 0.5);
}

.parallax-layer-delete-btn:hover:not(:disabled) {
    background: rgba(255, 90, 90, 0.2);
    border-color: rgba(255, 120, 120, 0.5);
}

.parallax-layer-view-btn:disabled,
.parallax-layer-expand-btn:disabled,
.parallax-layer-delete-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.parallax-layer-body {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    padding-top: 0.1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.parallax-layer-card .slider-group label {
    font-size: 0.76rem;
    letter-spacing: 0.08em;
}

.parallax-eraser-subsection {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.astrometry-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.32);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    padding: 0.68rem 0.82rem;
    font-size: 0.92rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.astrometry-input:focus {
    border-color: rgba(64, 224, 208, 0.72);
    box-shadow: 0 0 0 2px rgba(64, 224, 208, 0.18);
}

.astrometry-status {
    font-size: 0.79rem;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.35;
}

.astrometry-hint {
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.35;
}

.astrometry-style-grid {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.85rem 0;
}

.astrometry-results-label {
    font-size: 0.74rem;
    letter-spacing: 0.12em;
}

.astrometry-results-list {
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 0.22rem;
}

.astrometry-results-list::-webkit-scrollbar {
    width: 4px;
}

.astrometry-results-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.22);
    border-radius: 999px;
}

.astrometry-item {
    display: flex;
    gap: 0.58rem;
    align-items: flex-start;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.48rem 0.58rem;
}

.astrometry-item input[type="checkbox"] {
    margin-top: 0.2rem;
}

.astrometry-item-content {
    display: flex;
    flex-direction: column;
    gap: 0.32rem;
    width: 100%;
}

.astrometry-item-main {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.3;
}

.astrometry-item-sub {
    font-size: 0.71rem;
    color: rgba(255, 255, 255, 0.56);
    line-height: 1.3;
}

.astrometry-item-offset {
    display: flex;
    flex-direction: column;
    gap: 0.24rem;
}

.astrometry-item-offset-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
}

.astrometry-item-offset-value {
    font-size: 0.67rem;
    color: rgba(255, 255, 255, 0.75);
    font-variant-numeric: tabular-nums;
}

.astrometry-item-offset-slider {
    width: 100%;
}

.astrometry-empty {
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.55);
}

@media (max-width: 640px) {
    .color-picker-row {
        grid-template-columns: 1fr;
    }
}

/* ---- Image Inspector Modal ---- */
.inspector-backdrop {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: inspector-fade-in 0.18s ease;
}

.inspector-backdrop[hidden] {
    display: none;
}

@keyframes inspector-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.inspector-panel {
    background: rgba(14, 14, 22, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    width: min(860px, 90vw);
    max-height: 90vh;
    overflow: hidden;
}

.inspector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.inspector-tabs {
    display: flex;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.25rem;
}

.inspector-tab {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.55);
    font-family: 'Outfit', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.35rem 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.inspector-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.inspector-tab.is-active {
    background: var(--accent-color);
    color: #fff;
}

.inspector-close {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: var(--text-primary);
    width: 2.1rem;
    height: 2.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s ease;
    flex-shrink: 0;
}

.inspector-close:hover {
    background: rgba(255, 255, 255, 0.16);
}

.inspector-image-pane {
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    min-height: 0;
    position: relative;
}

.inspector-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    image-rendering: auto;
}

.inspector-empty {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.4);
}

.inspector-label {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    text-align: center;
}
