/* ==========================================================================
   SeenLabs Premium Design System (Local - Screen Size Calculator)
   Glassmorphism, Gradients, and Micro-interactions
   ========================================================================== */

:root {
    /* Brand Gradients (Aurora) */
    --gradient-hero: linear-gradient(135deg, #0f172a 0%, #334155 50%, #475569 100%); /* Slate Theme */
    --gradient-glass: linear-gradient(145deg, rgba(255,255,255,0.7), rgba(255,255,255,0.3));
    
    /* Colors */
    --primary: #475569;
    --primary-dark: #334155;
    --accent: #f59e0b;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --bg-body: #f1f5f9;
    --surface: #ffffff;
    --border: #e2e8f0;
    
    /* Spacing & Layout */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --container-max: 1200px;
    
    /* Effects */
    --shadow-sm: 0 4px 6px -1px rgba(0,0,0,0.05);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
    --blur: blur(12px);
    --anim-fast: 0.2s ease;
}

/* Reset & Base */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Inter', -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Layout Utilities */
.container { max-width: var(--container-max); margin: 0 auto; padding: 0 1.5rem; }
.text-center { text-align: center; }
.hidden { display: none !important; }
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: 1fr; }
@media(min-width: 768px) { 
    .grid-2 { grid-template-columns: 1fr 1fr; } 
    .grid-3 { grid-template-columns: 1fr 1fr 1fr; }
}
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.gap-2 { gap: 0.5rem; }

/* Selection Cards (UI Replacement for Selects) */
.selection-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}
@media(min-width: 600px) {
    .selection-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
}

.selection-card {
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    user-select: none;
}

.selection-card:hover {
    border-color: var(--primary);
    background: #f8fafc;
}

.selection-card.selected {
    border-color: var(--primary); /* Blue/Slate usually, but let's make it distinct if needed */
    background: #eff6ff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    color: var(--primary-dark);
}

/* Dark Mode Adaptation */
[data-theme="dark"] .selection-card {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-muted);
}
[data-theme="dark"] .selection-card:hover {
    background: #1e293b;
    border-color: var(--primary);
    color: var(--text-main);
}
[data-theme="dark"] .selection-card.selected {
    background: rgba(59, 130, 246, 0.15); /* Low opacity blue */
    border-color: var(--primary);
    color: white;
}

.selection-icon { font-size: 1.5rem; display: block; margin-bottom: 0.25rem; }
.selection-label { font-weight: 600; font-size: 0.95rem; line-height: 1.2; }
.selection-sub { font-size: 0.75rem; opacity: 0.8; margin-top: 2px; }

/* ==========================================================================
   Components
   ========================================================================== */

/* Hero Section (Mesh) */
.hero {
    background: var(--gradient-hero);
    color: white;
    padding: 6rem 1.5rem;
    position: relative;
    overflow: hidden;
}
.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.hero p {
    font-size: 1.25rem;
    color: rgba(255,255,255,0.9);
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}
.card-glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: var(--blur);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow-glass);
}

/* Form Elements */
.form-group { margin-bottom: 1.5rem; }
.form-label { display: block; margin-bottom: 0.5rem; font-weight: 600; font-size: 0.95rem; }
.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: white;
    transition: all var(--anim-fast);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(71, 85, 105, 0.1);
}
input[type=range] { width: 100%; cursor: pointer; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all var(--anim-fast);
    cursor: pointer;
    border: none;
    font-size: 1rem;
}
.btn-primary {
    background: var(--accent); /* Orange accent for calculator */
    color: white;
    box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.3);
}
.btn-primary:hover {
    background: #d97706;
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(245, 158, 11, 0.4);
}
.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}
.btn-block { width: 100%; display: flex; }

/* Modal (Duplicated Styling) */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}
.modal-overlay.active {
    display: flex;
}
.modal-content {
    background: white;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-glass);
    text-align: center;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-input {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    margin: 1rem 0;
    font-size: 1rem;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ==========================================================================
   Standard Header & Modals
   ========================================================================== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.header__logo { display: flex; align-items: center; gap: 1rem; text-decoration: none; }
.header__logo-img { width: 36px; height: 36px; border-radius: 6px; }
.header__title-group { display: flex; flex-direction: column; gap: 2px; }
.header__brand { font-size: 0.6875rem; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.header__title { font-size: 1rem; font-weight: 700; color: var(--primary); }

.header__actions { display: flex; gap: 0.5rem; align-items: center; }

.btn--icon {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px;
    border-radius: 6px; border: 1px solid var(--border);
    background: transparent; color: var(--text-muted);
    cursor: pointer; transition: all 0.2s;
}
.btn--icon:hover { background: var(--bg-body); color: var(--primary); border-color: var(--primary); }

.theme-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px;
    border-radius: 6px; background: transparent;
    border: 1px solid var(--border);
    cursor: pointer; transition: all 0.2s; color: var(--text-muted);
}
.theme-toggle:hover { background: var(--bg-body); color: var(--primary); transform: rotate(15deg); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun { display: none; }

[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

/* Content Modals */
.modal {
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 100%; max-width: 600px;
    max-height: 85vh;
    display: flex; flex-direction: column;
    position: relative;
    border: 1px solid var(--border);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal__close {
    position: absolute; top: 1rem; right: 1rem;
    background: transparent; border: none;
    font-size: 1.5rem; color: var(--text-muted);
    cursor: pointer; padding: 0.5rem;
    line-height: 1; z-index: 10;
}
.modal__close:hover { color: var(--danger); }

.modal__title {
    padding: 1.5rem 1.5rem 1rem;
    font-size: 1.5rem; font-weight: 700;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
}

.faq-modal__content, .methodology-modal__content {
    padding: 1.5rem;
    overflow-y: auto;
}

.faq__item { margin-bottom: 1rem; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.faq__question {
    padding: 1rem; background: var(--bg-body);
    font-weight: 600; cursor: pointer; user-select: none;
    list-style: none; display: flex; justify-content: space-between; align-items: center;
}
.faq__question::after { content: '+'; font-size: 1.2rem; color: var(--text-muted); }
details[open] .faq__question::after { content: '-'; }
.faq__answer { padding: 1rem; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; }

.methodology-section { margin-bottom: 1.5rem; }
.methodology-section h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--primary); }
.methodology-section p, .methodology-section li { color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; }
.methodology-section ul { padding-left: 1.5rem; }
.methodology-section li { margin-bottom: 0.5rem; }

/* Dark Mode Overrides */
[data-theme="dark"] .header { background: rgba(30, 41, 59, 0.8); border-color: var(--border); }
[data-theme="dark"] .modal { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .faq__question { background: #0f172a; }
/* Dark Mode Overrides */
[data-theme="dark"] {
    --bg-body: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --surface: #1e293b;
    --border: #334155;
    --primary: #818cf8;
}

[data-theme="dark"] .card {
    background: var(--surface);
    border-color: var(--border);
}

[data-theme="dark"] .form-input, 
[data-theme="dark"] .form-select {
    background: #0f172a;
    border-color: #334155;
    color: var(--text-main);
}

[data-theme="dark"] .tool-card {
    background: var(--surface);
    border-color: var(--border);
}

[data-theme="dark"] .tool-card:hover {
    border-color: var(--primary);
    background: #1e293b; 
}

/* Room Simulator Dark Mode */
[data-theme="dark"] .room-simulator {
    border-color: var(--border);
}

[data-theme="dark"] .human-scale {
    filter: brightness(0.8);
}

/* Header & Modal Fixes */
[data-theme="dark"] .header {
    background: var(--surface);
    border-bottom-color: var(--border);
}

[data-theme="dark"] .header__logo-img {
    filter: brightness(0) invert(1);
}

[data-theme="dark"] .header__brand {
    color: var(--text-main);
}

[data-theme="dark"] .modal {
    background: var(--surface);
    border-color: var(--border);
}

[data-theme="dark"] .faq__question:hover {
    background: rgba(255,255,255,0.05);
}

[data-theme="dark"] .result-card {
    background: var(--surface);
    border-color: var(--border);
}

[data-theme="dark"] .result-value {
    color: var(--text-main);
}

[data-theme="dark"] .spec-item {
    background: rgba(255,255,255,0.03);
    border-color: var(--border);
}
/* ==========================================================================
   Room Simulator (Redesign)
   ========================================================================== */
.room-simulator {
    height: 400px; /* Base height */
    max-height: 50vh;
    background: #e2e8f0;
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.1);
    border-bottom: 20px solid #cbd5e1; /* Default floor */
    transition: all 0.5s ease;
}

/* Dynamic Backgrounds */
.room-simulator[data-env="indoor-normal"] { background: radial-gradient(circle at 50% 30%, #f1f5f9, #cbd5e1); border-bottom-color: #94a3b8; }
.room-simulator[data-env="indoor-dim"] { background: radial-gradient(circle at 50% 30%, #334155, #0f172a); border-bottom-color: #1e293b; }
.room-simulator[data-env="indoor-bright"] { background: radial-gradient(circle at 60% 20%, #ffffff, #e2e8f0); border-bottom-color: #cbd5e1; }
.room-simulator[data-env="window"] { background: linear-gradient(to right, #ffffff, #f0f9ff); border-bottom-color: #bfdbfe; }
.room-simulator[data-env="outdoor-shade"] { background: linear-gradient(to bottom, #dcfce7, #bbf7d0); border-bottom-color: #86efac; }


.scene-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 0px; /* Floor thickness handled by border */
    gap: 40px; /* Space between person and screen */
}

/* Human Reference */
.human-scale {
    height: 180px; /* Fixed reference height ~ 1.7m scaled */
    width: auto;
    opacity: 0.8;
    z-index: 10;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.2));
}
.human-scale svg { height: 100%; width: auto; display: block; }
.room-simulator[data-env="indoor-dim"] .human-scale { opacity: 0.5; filter: drop-shadow(2px 2px 8px rgba(0,0,0,0.5)); color: #94a3b8; }


/* Screen Object */
.screen-object {
    position: relative;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); /* Bouncy scaling */
    transform-origin: bottom center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.screen-bezel {
    border: 4px solid #111;
    border-radius: 4px;
    background: #000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1), 0 10px 15px rgba(0,0,0,0.1);
    transition: all 0.5s ease;
    /* Dimensions set by JS */
}

.screen-display {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.screen-display::after {
    content: ''; position: absolute; top:0; left:0; width:100%; height:100%;
    background: linear-gradient(rgba(255,255,255,0.2), transparent);
}

.room-simulator[data-env="window"] .screen-display { filter: brightness(1.2); }
.room-simulator[data-env="indoor-dim"] .screen-display { box-shadow: 0 0 30px rgba(37, 99, 235, 0.4); }

.screen-label {
    color: white; font-weight: bold; font-size: 10px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    white-space: nowrap;
}

.screen-stand {
    width: 30%;
    height: 40px;
    background: linear-gradient(to right, #334155, #475569);
    margin-top: -2px; /* Connect to bezel */
    z-index: 1;
}

.room-controls {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(4px);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Result Cards Redesign */
.result-card-primary {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border: 2px solid #e2e8f0;
    padding: 2rem;
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
}
.result-card-primary::before {
    content: '';
    position: absolute; top:0; left:0; width:100%; height:4px;
    background: var(--accent);
}

.text-huge { font-size: 3.5rem; font-weight: 800; line-height: 1; color: var(--text-main); letter-spacing: -2px; }
.text-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); font-weight: 700; margin-bottom: 0.5rem; }
.text-sub { font-size: 0.9rem; color: var(--text-muted); }

.badge-pill {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    background: #dcfce7;
    color: #166534;
    font-size: 0.8rem;
    font-weight: 600;
}
.badge-value {
    font-family: monospace;
    font-weight: 700;
    color: var(--primary);
    background: #e2e8f0;
    padding: 2px 6px;
    border-radius: 4px;
}
.range-labels {
    display: flex; justify-content: space-between;
    font-size: 0.75rem; color: var(--text-muted); margin-top: 5px;
}
