/* --- AEGISEYE AI - DESIGN SYSTEM & CORE STYLING --- */

:root {
    /* Color Palette */
    --slate-950: #020617;
    --slate-900: #0b1329;
    --slate-850: #111e38;
    --slate-800: #1b2a47;
    --slate-700: #2e3f5f;
    --slate-600: #475a80;
    --slate-400: #8da2c4;
    --slate-200: #cbd5e1;
    --white: #ffffff;

    /* Accent & Glow Colors */
    --cyan-500: #00f0ff;
    --cyan-600: #00c8db;
    --cyan-900: rgba(0, 240, 255, 0.15);
    
    --indigo-500: #7000ff;
    --indigo-400: #8f43ff;
    --indigo-950: #160a33;

    --amber-500: #ff9f00;
    --amber-600: #d68100;
    --amber-950: #2b1d03;

    --rose-500: #ff0055;
    --rose-600: #d10041;
    --rose-950: #2b0412;

    --green-500: #00e676;
    --green-600: #00b050;
    --green-950: #022413;

    /* Fonts & Radii */
    --font-heading: 'Outfit', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 26px;
    
    /* Shadows */
    --glow-cyan: 0 0 15px rgba(0, 240, 255, 0.3);
    --glow-rose: 0 0 15px rgba(255, 0, 85, 0.4);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    --border-glass: 1px solid rgba(255, 255, 255, 0.07);
}

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

body {
    background-color: var(--slate-950);
    color: var(--slate-200);
    font-family: var(--font-body);
    overflow-x: hidden;
    height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--white);
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--slate-950);
}
::-webkit-scrollbar-thumb {
    background: var(--slate-800);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--slate-700);
}

/* Utility classes */
.text-cyan { color: var(--cyan-500); text-shadow: var(--glow-cyan); }
.text-green { color: var(--green-500); }
.text-amber { color: var(--amber-500); }
.text-rose { color: var(--rose-500); text-shadow: var(--glow-rose); }
.w-full { width: 100%; }

/* --- APP CONTAINER LAYOUT --- */
.app-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: 100vh;
    width: 100vw;
}

/* --- SIDEBAR --- */
.sidebar {
    background-color: var(--slate-900);
    border-right: var(--border-glass);
    display: flex;
    flex-direction: column;
    padding: 24px;
    height: 100%;
}

.sidebar-header {
    margin-bottom: 36px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--cyan-500);
    filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.6));
}

.logo-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 800;
    color: var(--white);
    display: block;
    line-height: 1.1;
}

.logo-subtitle {
    font-size: 11px;
    color: var(--slate-400);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-item {
    background: none;
    border: none;
    outline: none;
    color: var(--slate-400);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.nav-item:hover {
    color: var(--white);
    background-color: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
    color: var(--white);
    background-color: var(--indigo-950);
    box-shadow: inset 0 0 10px rgba(112, 0, 255, 0.2);
    border: 1px solid rgba(112, 0, 255, 0.3);
}

.nav-icon {
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
}

.nav-item:hover .nav-icon {
    transform: translateX(2px);
}

.nav-item.active .nav-icon {
    color: var(--cyan-500);
    filter: drop-shadow(0 0 5px rgba(0, 240, 255, 0.5));
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 20px;
    border-top: 1px solid var(--slate-800);
}

.status-indicator-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--slate-400);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: relative;
}

.pulse-dot.green {
    background-color: var(--green-500);
    box-shadow: 0 0 8px var(--green-500);
}

.pulse-dot.green::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--green-500);
    animation: pulse 1.8s infinite ease-in-out;
}

.legal-disclaimer {
    font-size: 11px;
    color: var(--slate-400);
    background-color: var(--slate-950);
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--slate-800);
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.4;
}

.disclaimer-icon {
    width: 14px;
    height: 14px;
    color: var(--cyan-600);
    flex-shrink: 0;
    margin-top: 1px;
}

/* --- MAIN CONTENT AREA --- */
.main-content {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    padding: 30px;
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--slate-850);
}

#view-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.header-subtitle {
    font-size: 13px;
    color: var(--slate-400);
}

.header-stats {
    display: flex;
    align-items: center;
    background-color: var(--slate-900);
    border: var(--border-glass);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-glass);
}

.quick-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.quick-stat-label {
    font-size: 10px;
    color: var(--slate-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.quick-stat-value {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
}

.quick-stat-divider {
    width: 1px;
    height: 28px;
    background-color: var(--slate-800);
    margin: 0 20px;
}

/* Tabs Toggle */
.tab-view {
    display: none;
    flex-grow: 1;
}

.tab-view.active {
    display: block;
}

/* --- TAB 1: LIVE MONITOR GRID --- */
.live-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    height: calc(100vh - 150px);
}

.feed-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 0;
}

/* Camera Tabs */
.camera-selectors {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.cam-select-btn {
    background-color: var(--slate-900);
    border: 1px solid var(--slate-800);
    color: var(--slate-400);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.cam-select-btn:hover {
    color: var(--white);
    background-color: var(--slate-850);
}

.cam-select-btn.active {
    background-color: var(--slate-800);
    color: var(--white);
    border-color: var(--cyan-500);
    box-shadow: var(--glow-cyan);
}

.cam-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.cam-indicator.online {
    background-color: var(--green-500);
    box-shadow: 0 0 6px var(--green-500);
}

.cam-indicator.warning {
    background-color: var(--amber-500);
    box-shadow: 0 0 6px var(--amber-500);
    animation: flash 1s infinite alternate;
}

/* Video Viewer */
.video-container {
    background-color: rgba(11, 19, 41, 0.75);
    border: var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    backdrop-filter: blur(10px);
}

.video-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.camera-info-badge {
    background-color: var(--slate-800);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    color: var(--white);
    border: 1px solid var(--slate-700);
}

.video-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    color: var(--slate-400);
}

.rec-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: rgba(255, 0, 85, 0.15);
    color: var(--rose-500);
    font-weight: 700;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 0, 85, 0.2);
}

.rec-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--rose-500);
    animation: flash 1s infinite alternate;
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    background-color: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 16/9;
}

#video-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.detection-overlay-notice {
    position: absolute;
    bottom: 16px;
    left: 16px;
    background-color: rgba(2, 6, 23, 0.85);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    border: 1px solid var(--slate-800);
    color: var(--slate-200);
    transition: all 0.3s ease;
}

.detection-overlay-notice.active {
    background-color: var(--rose-950);
    border-color: var(--rose-500);
    color: var(--rose-500);
    box-shadow: var(--glow-rose);
    font-weight: 700;
}

/* Sim Controls */
.simulation-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--slate-900);
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--slate-800);
}

.sim-select-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.sim-dropdown {
    background-color: var(--slate-950);
    border: 1px solid var(--slate-800);
    color: var(--white);
    font-family: var(--font-body);
    font-size: 13px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sim-dropdown:focus {
    border-color: var(--cyan-600);
    box-shadow: var(--glow-cyan);
}

.action-btn {
    background: linear-gradient(135deg, var(--indigo-500) 0%, var(--indigo-400) 100%);
    border: none;
    color: var(--white);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 13px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(112, 0, 255, 0.4);
    transition: all 0.2s ease;
}

.action-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn.btn-outline {
    background: none;
    border: 1px solid var(--slate-700);
    color: var(--slate-200);
    box-shadow: none;
}

.action-btn.btn-outline:hover {
    background-color: var(--slate-800);
    border-color: var(--slate-400);
}

.action-btn.btn-danger-outline {
    background: none;
    border: 1px solid rgba(255, 0, 85, 0.3);
    color: var(--rose-500);
    box-shadow: none;
}

.action-btn.btn-danger-outline:hover {
    background-color: var(--rose-950);
    border-color: var(--rose-500);
}

.action-btn.btn-success {
    background: linear-gradient(135deg, var(--green-600) 0%, var(--green-500) 100%);
    box-shadow: 0 4px 15px rgba(0, 230, 118, 0.3);
}

.btn-icon {
    width: 14px;
    height: 14px;
}

.sim-speed-selector {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sim-speed-label {
    font-size: 12px;
    color: var(--slate-400);
}

.range-slider {
    -webkit-appearance: none;
    width: 120px;
    height: 6px;
    border-radius: 3px;
    background: var(--slate-800);
    outline: none;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--cyan-500);
    cursor: pointer;
    box-shadow: var(--glow-cyan);
    transition: transform 0.1s ease;
}

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

.sim-speed-value {
    font-size: 12px;
    font-weight: 700;
    color: var(--cyan-500);
    width: 32px;
}

/* Console logs */
.console-card {
    background-color: var(--slate-900);
    border: var(--border-glass);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;
    min-height: 120px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 13px;
    color: var(--slate-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.clear-btn {
    background: none;
    border: none;
    color: var(--slate-400);
    font-size: 11px;
    cursor: pointer;
}

.clear-btn:hover {
    color: var(--white);
}

.console-log-area {
    background-color: #030816;
    border-radius: var(--radius-sm);
    padding: 12px;
    font-family: monospace;
    font-size: 11px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    height: 110px;
}

.log-line {
    line-height: 1.4;
}

.log-line.info { color: var(--slate-400); }
.log-line.warning { color: var(--amber-500); }
.log-line.error { color: var(--rose-500); font-weight: 700; }
.log-line.success { color: var(--green-500); }

/* --- ALERTS COLUMN --- */
.alert-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.alerts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--slate-850);
    padding-bottom: 12px;
}

.alerts-header h2 {
    font-size: 18px;
}

.alert-count-badge {
    background-color: var(--rose-950);
    border: 1px solid var(--rose-600);
    color: var(--rose-500);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 12px;
}

.alerts-queue {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    flex-grow: 1;
}

/* Alert Card */
.alert-card {
    background-color: var(--slate-900);
    border: 1px solid var(--slate-800);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.3s ease;
}

.alert-card:hover {
    border-color: var(--slate-700);
    transform: translateX(-2px);
}

.alert-card.critical {
    border-left: 4px solid var(--rose-500);
}

.alert-card.warning {
    border-left: 4px solid var(--amber-500);
}

.alert-card.medium {
    border-left: 4px solid var(--indigo-500);
}

.alert-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.severity-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
}

.severity-badge.critical {
    background-color: rgba(255, 0, 85, 0.15);
    color: var(--rose-500);
}

.severity-badge.warning {
    background-color: rgba(255, 159, 0, 0.15);
    color: var(--amber-500);
}

.severity-badge.medium {
    background-color: rgba(112, 0, 255, 0.15);
    color: var(--indigo-400);
}

.alert-time {
    font-size: 11px;
    color: var(--slate-400);
}

.alert-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--white);
}

.alert-details {
    font-size: 12px;
    color: var(--slate-400);
    line-height: 1.4;
}

.alert-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--slate-400);
    background-color: var(--slate-950);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    margin-top: 6px;
}

.alert-card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--slate-850);
    padding-top: 10px;
    margin-top: 2px;
}

.btn-play-clip {
    background-color: var(--slate-800);
    border: 1px solid var(--slate-700);
    color: var(--white);
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-play-clip:hover {
    background-color: var(--slate-700);
    border-color: var(--slate-600);
}

.alert-feedback-btns {
    display: flex;
    gap: 6px;
}

.btn-feedback {
    width: 26px;
    height: 26px;
    border-radius: 4px;
    border: none;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-feedback.correct {
    background-color: rgba(0, 230, 118, 0.1);
    color: var(--green-500);
    border: 1px solid rgba(0, 230, 118, 0.2);
}

.btn-feedback.correct:hover {
    background-color: var(--green-500);
    color: var(--slate-950);
}

.btn-feedback.incorrect {
    background-color: rgba(255, 0, 85, 0.1);
    color: var(--rose-500);
    border: 1px solid rgba(255, 0, 85, 0.2);
}

.btn-feedback.incorrect:hover {
    background-color: var(--rose-500);
    color: var(--white);
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.5; }
    50% { transform: scale(1.8); opacity: 0; }
    100% { transform: scale(0.95); opacity: 0; }
}

@keyframes flash {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

.anim-pulse-card {
    animation: criticalGlow 2.5s infinite alternate;
}

@keyframes criticalGlow {
    from { box-shadow: 0 0 4px rgba(255, 0, 85, 0.1); }
    to { box-shadow: 0 0 16px rgba(255, 0, 85, 0.3); border-color: rgba(255, 0, 85, 0.4); }
}

/* --- TAB 2: ANALYTICS --- */
.analytics-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
}

.analytics-card {
    background-color: var(--slate-900);
    border: var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-glass);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card-subtitle {
    font-size: 12px;
    color: var(--slate-400);
    margin-top: 2px;
}

.map-controls {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 11px;
    border-radius: var(--radius-sm);
    box-shadow: none;
}

.btn-sm.active {
    background: var(--cyan-600);
    color: var(--slate-950);
}

.heatmap-canvas-container {
    width: 100%;
    background-color: #020712;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--slate-850);
}

#heatmap-canvas {
    width: 100%;
    height: auto;
    display: block;
}

.heatmap-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 11px;
    color: var(--slate-400);
    background-color: var(--slate-950);
    padding: 12px;
    border-radius: var(--radius-md);
}

.legend-gradient {
    height: 12px;
    border-radius: var(--radius-sm);
    background: linear-gradient(90deg, rgba(0, 240, 255, 0.5), rgba(0, 230, 118, 0.7), rgba(255, 159, 0, 0.8), rgba(255, 0, 85, 0.9));
}

.legend-labels {
    display: flex;
    justify-content: space-between;
}

.analytics-sidebar-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.metric-card {
    min-height: 200px;
}

.chart-container {
    background-color: #030816;
    border-radius: var(--radius-md);
    padding: 16px;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--slate-850);
}

.svg-chart {
    width: 100%;
    height: 100%;
}

.chart-text {
    font-family: var(--font-body);
    font-size: 4px;
    fill: var(--slate-400);
}

.chart-text.label {
    font-weight: 600;
    fill: var(--slate-200);
}

.chart-text.val {
    font-weight: 700;
    fill: var(--white);
}

.chart-text.axis {
    font-size: 3.5px;
    fill: var(--slate-600);
}

/* --- TAB 3: CAMERA MANAGEMENT --- */
.camera-management-panel {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
}

.section-title-with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.camera-total-count {
    font-size: 12px;
    background-color: var(--slate-800);
    padding: 4px 10px;
    border-radius: 12px;
    color: var(--cyan-500);
    font-weight: 700;
    border: 1px solid var(--slate-700);
}

.camera-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.camera-setup-card {
    background-color: var(--slate-900);
    border: 1px solid var(--slate-800);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: border-color 0.2s ease;
}

.camera-setup-card.alert-active {
    border-color: rgba(255, 159, 0, 0.4);
    box-shadow: 0 0 10px rgba(255, 159, 0, 0.15);
}

.camera-setup-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.camera-index {
    font-size: 10px;
    font-weight: 700;
    color: var(--slate-400);
    background-color: var(--slate-950);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 4px;
}

.camera-setup-header h4 {
    font-size: 14px;
    font-weight: 700;
}

.badge-status {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
}

.badge-status.online {
    background-color: rgba(0, 230, 118, 0.1);
    color: var(--green-500);
}

.badge-status.warning-badge {
    background-color: rgba(255, 159, 0, 0.15);
    color: var(--amber-500);
}

.camera-setup-details {
    font-size: 11px;
    color: var(--slate-400);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.camera-setup-details p {
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.camera-setup-details strong {
    color: var(--slate-200);
}

.camera-setup-actions {
    display: flex;
    gap: 8px;
    border-top: 1px solid var(--slate-850);
    padding-top: 12px;
}

.camera-add-card {
    background-color: var(--slate-900);
    border: var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-glass);
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: fit-content;
}

.camera-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 11px;
    color: var(--slate-400);
    font-weight: 600;
}

.form-group input, .form-group select {
    background-color: var(--slate-950);
    border: 1px solid var(--slate-800);
    color: var(--white);
    font-family: var(--font-body);
    font-size: 13px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color 0.2s ease;
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--cyan-600);
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-group.half {
    width: 50%;
}

/* --- TAB 4: SAAS & ROI CALCULATOR --- */
.saas-container {
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

.saas-header {
    text-align: center;
    margin-bottom: 30px;
}

.saas-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.saas-card {
    background-color: var(--slate-900);
    border: var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-glass);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.calculator-controls {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.calc-control-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.calc-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calc-control-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--slate-200);
}

.calc-control-bubble {
    font-size: 12px;
    font-weight: 700;
    background-color: var(--slate-950);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--slate-800);
    color: var(--white);
}

.calc-control-bubble.highlight {
    color: var(--amber-500);
    border-color: var(--amber-600);
    background-color: var(--amber-950);
}

.font-slider {
    width: 100%;
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--slate-600);
}

.business-info-notice {
    background-color: rgba(0, 240, 255, 0.05);
    border: 1px solid rgba(0, 240, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 14px;
    font-size: 11px;
    line-height: 1.5;
    color: var(--slate-400);
    display: flex;
    gap: 10px;
}

.info-icon {
    width: 16px;
    height: 16px;
    color: var(--cyan-500);
    flex-shrink: 0;
    margin-top: 1px;
}

/* Results Card */
.roi-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.roi-item {
    background-color: var(--slate-950);
    border: 1px solid var(--slate-850);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
}

.roi-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--slate-400);
    margin-bottom: 6px;
}

.roi-val {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 2px;
}

.roi-val.text-indigo {
    color: var(--indigo-400);
    text-shadow: 0 0 10px rgba(143, 67, 255, 0.2);
}

.roi-desc {
    font-size: 11px;
    color: var(--slate-600);
}

.roi-net-savings {
    background: linear-gradient(135deg, var(--indigo-950) 0%, rgba(2, 6, 23, 0.8) 100%);
    border: 1px solid rgba(112, 0, 255, 0.3);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    box-shadow: inset 0 0 20px rgba(112, 0, 255, 0.1);
}

.net-savings-title {
    font-size: 12px;
    color: var(--slate-400);
    margin-bottom: 4px;
}

.net-savings-value {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 800;
    color: var(--green-500);
    margin-bottom: 4px;
    text-shadow: 0 0 10px rgba(0, 230, 118, 0.2);
}

.net-savings-annual {
    font-size: 12px;
    color: var(--slate-400);
    font-weight: 600;
}

.pricing-tiers {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pricing-tiers h4 {
    font-size: 12px;
    color: var(--slate-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tier-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.tier-col {
    background-color: var(--slate-950);
    border: 1px solid var(--slate-850);
    padding: 10px 8px;
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 10px;
    transition: all 0.2s ease;
}

.tier-col.active {
    border-color: var(--indigo-500);
    background-color: rgba(112, 0, 255, 0.1);
}

.tier-name {
    color: var(--slate-400);
    margin-bottom: 2px;
}

.tier-col.active .tier-name {
    color: var(--white);
    font-weight: 600;
}

.tier-price {
    font-weight: 700;
    color: var(--slate-200);
}

.tier-col.active .tier-price {
    color: var(--cyan-500);
}

/* --- MODAL POPUP --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--slate-900);
    border: var(--border-glass);
    width: 90%;
    max-width: 680px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--slate-850);
}

.modal-header h3 {
    font-size: 16px;
}

.close-modal {
    background: none;
    border: none;
    color: var(--slate-400);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.close-modal:hover {
    color: var(--white);
}

.modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-video-wrapper {
    position: relative;
    background-color: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 16/9;
}

#modal-video-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.modal-detection-banner {
    position: absolute;
    top: 16px;
    left: 16px;
    background-color: var(--rose-950);
    border: 1px solid var(--rose-500);
    color: var(--rose-500);
    font-weight: 700;
    font-size: 11px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    box-shadow: var(--glow-rose);
}

.modal-meta-info {
    font-size: 12px;
    color: var(--slate-400);
    background-color: var(--slate-950);
    padding: 16px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid var(--slate-850);
}

.modal-meta-info strong {
    color: var(--white);
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background-color: var(--slate-950);
    border-top: 1px solid var(--slate-850);
}

.modal-footer-label {
    font-size: 12px;
    color: var(--slate-400);
}

.modal-feedback-actions {
    display: flex;
    gap: 10px;
}

/* --- MAP LAYOUT EDITOR TOOLBAR STYLES --- */
.map-editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(11, 19, 41, 0.6);
    border: 1px solid var(--slate-850);
    border-bottom: none;
    padding: 12px 20px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    backdrop-filter: blur(8px);
    margin-bottom: 0;
}

.heatmap-canvas-container.editing {
    border: 2px dashed var(--indigo-400);
    box-shadow: 0 0 20px rgba(143, 67, 255, 0.25);
}

.editor-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--slate-850);
    border: 1px solid var(--slate-800);
    color: var(--slate-400);
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.editor-btn:hover {
    background-color: var(--slate-800);
    border-color: var(--slate-700);
    color: var(--white);
}

.editor-btn.active {
    background: linear-gradient(135deg, var(--indigo-500) 0%, var(--indigo-400) 100%);
    border-color: var(--indigo-400);
    color: var(--white);
    box-shadow: 0 0 15px rgba(143, 67, 255, 0.3);
}

.editor-btn.btn-success {
    background: linear-gradient(135deg, var(--green-600) 0%, var(--green-500) 100%);
    border-color: var(--green-500);
    color: var(--slate-950);
    font-weight: 700;
}

.editor-btn.btn-success:hover {
    filter: brightness(1.1);
    box-shadow: 0 0 15px rgba(0, 230, 118, 0.3);
}

.editor-btn.btn-indigo {
    background-color: var(--indigo-950);
    border-color: rgba(143, 67, 255, 0.3);
    color: var(--slate-200);
}

.editor-btn.btn-indigo:hover {
    background-color: rgba(143, 67, 255, 0.15);
    border-color: var(--indigo-400);
    color: var(--white);
}

.editor-btn.btn-cyan {
    background-color: var(--cyan-900);
    border-color: rgba(0, 240, 255, 0.3);
    color: var(--cyan-500);
}

.editor-btn.btn-cyan:hover {
    background-color: rgba(0, 240, 255, 0.15);
    border-color: var(--cyan-500);
    color: var(--white);
}

.editor-btn.btn-danger {
    background-color: var(--rose-950);
    border-color: rgba(255, 0, 85, 0.3);
    color: var(--rose-500);
}

.editor-btn.btn-danger:hover {
    background-color: rgba(255, 0, 85, 0.15);
    border-color: var(--rose-500);
    color: var(--white);
}

.editor-btn.btn-slate-outline {
    background-color: transparent;
    border-color: var(--slate-800);
    color: var(--slate-400);
}

.editor-btn.btn-slate-outline:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--slate-700);
    color: var(--white);
}
