/* ============================================
   ULTIMATE INDUSTRIAL CONFIGURATOR
   Premium B2B Visual System - Light Industrial
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ============================================
   CSS VARIABLES - Light Industrial Palette
   ============================================ */
:root {
    /* Background - Soft Neutral Gradients */
    --bg-gradient: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 50%, #dcdce2 100%);
    --bg-primary: #f0f0f3;
    --bg-secondary: #fafafa;

    /* Surface Colors - Ultra Liquid Glass */
    --surface-glass: rgba(255, 255, 255, 0.25);
    --surface-glass-hover: rgba(255, 255, 255, 0.35);
    --surface-glass-active: rgba(255, 255, 255, 0.45);
    --surface-elevated: rgba(255, 255, 255, 0.4);

    /* Glass Effects */
    --glass-blur: 60px;
    --glass-saturation: 200%;
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shine: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, transparent 50%, rgba(255, 255, 255, 0.1) 100%);

    /* Accent Colors */
    --accent-primary: #2563eb;
    --accent-primary-soft: rgba(37, 99, 235, 0.15);
    --accent-secondary: #0891b2;
    --accent-success: #059669;
    --accent-warning: #d97706;
    --accent-danger: #dc2626;

    /* Text Colors */
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a5c;
    --text-tertiary: #6b6b7d;
    --text-muted: #9898a8;

    /* Border Colors */
    --border-subtle: rgba(255, 255, 255, 0.3);
    --border-medium: rgba(255, 255, 255, 0.5);
    --border-strong: rgba(255, 255, 255, 0.7);

    /* Ultra Premium Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.06);
    --shadow-glass:
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 32px 64px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        inset 0 -1px 0 rgba(255, 255, 255, 0.2);
    --shadow-glass-hover:
        0 16px 48px rgba(0, 0, 0, 0.15),
        0 48px 96px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(255, 255, 255, 0.3);

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-medium: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-gradient);
    color: var(--text-primary);
    line-height: 1.5;
    overflow: hidden;
    height: 100vh;
}

/* ============================================
   LAYOUT - Floating Panel Over 3D
   ============================================ */
.app-container {
    position: relative;
    height: 100vh;
    width: 100vw;
}

/* 3D Viewport - Full Screen */
.viewport-panel {
    position: absolute;
    inset: 0;
    z-index: 1;
}

#three-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Vignette overlay */
.viewport-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.08) 100%);
    z-index: 2;
}

/* ============================================
   BRANDING - CADEAZY × REEL POWER
   Confident, Hero-Scale Co-Branding
   ============================================ */
.branding {
    position: fixed;
    top: var(--spacing-xl);
    left: var(--spacing-xl);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
    /* Single boundary container for entire branding */
    padding: var(--spacing-md) var(--spacing-xl);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-lg);
}

.brand-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

/* Hero-scale logos - remove individual backgrounds */
.brand-logo {
    height: 28px;
    width: auto;
    object-fit: contain;
    /* Remove the image background boxes */
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.brand-icon {
    height: 24px;
}

.brand-text {
    height: 36px;
}

.brand-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

/* Clean, visible separator */
.branding-separator {
    color: var(--text-secondary);
    font-weight: 300;
    font-size: 0.75rem;
    opacity: 0.5;
}


/* ============================================
   VIEWPORT OVERLAY INFO
   ============================================ */
.viewport-overlay {
    position: fixed;
    bottom: var(--spacing-xl);
    left: var(--spacing-xl);
    z-index: 10;
    pointer-events: none;
}

.viewport-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    text-shadow: 0 2px 20px rgba(255, 255, 255, 0.5);
}

.viewport-subtitle {
    font-size: 1rem;
    color: var(--text-tertiary);
    margin-top: var(--spacing-xs);
    font-weight: 400;
}

/* ============================================
   FENCING CONTROL - Standalone Left Panel
   ============================================ */
.fencing-control {
    position: fixed;
    left: var(--spacing-xl);
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    padding: var(--spacing-md) var(--spacing-lg);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: var(--shadow-lg);
}

.fencing-checkbox {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    cursor: pointer;
    user-select: none;
}

.fencing-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.fencing-checkmark {
    position: relative;
    height: 24px;
    width: 24px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.fencing-checkbox:hover .fencing-checkmark {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.fencing-checkbox input:checked~.fencing-checkmark {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.fencing-checkmark::after {
    content: '';
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.fencing-checkbox input:checked~.fencing-checkmark::after {
    display: block;
}

.fencing-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* ============================================
   VIEW CONTROLS - Floating Quick Actions
   ============================================ */
.view-controls {
    position: fixed;
    bottom: var(--spacing-xl);
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    gap: var(--spacing-xs);
    padding: 6px;
    /* Ultra-subtle glass blend */
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 200px;
    /* Fully rounded pill shape */
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transition: all var(--transition-medium);
}

.view-controls:hover {
    background: rgba(255, 255, 255, 0.6);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transform: translateX(-50%) translateY(-2px);
}

.view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 50%;
    color: var(--text-tertiary);
    /* More subtle initially */
    cursor: pointer;
    transition: all var(--transition-fast);
}

.view-btn:hover {
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-primary);
    transform: scale(1.05);
}

.view-btn:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.6);
}

.view-btn svg {
    width: 18px;
    height: 18px;
    opacity: 0.8;
}

.view-btn:hover svg {
    opacity: 1;
}

/* Unit toggle */
.unit-toggle {
    position: fixed;
    top: var(--spacing-xl);
    right: calc(420px + var(--spacing-xl));
    left: auto;
    bottom: auto;
    transform: none;
    z-index: 10;
    display: flex;
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.unit-btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.unit-btn:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.03);
}

.unit-btn.active {
    background: var(--accent-primary);
    color: white;
}

/* ============================================
   CONFIG PANEL - ULTRA LIQUID GLASS
   Premium Frosted Crystal Effect
   ============================================ */
.config-panel {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    bottom: var(--spacing-lg);
    width: 420px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    /* Ultra Liquid Glass - Deep Frosted Crystal */
    background: linear-gradient(165deg,
            rgba(255, 255, 255, 0.35) 0%,
            rgba(255, 255, 255, 0.15) 40%,
            rgba(255, 255, 255, 0.25) 100%);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-xl);
    /* Multi-layer Prismatic Shadow */
    box-shadow: var(--shadow-glass);
    overflow: hidden;
    transition: box-shadow var(--transition-medium), transform var(--transition-medium);
}

/* Prismatic Shine Overlay */
.config-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.4) 0%,
            rgba(255, 255, 255, 0.1) 40%,
            transparent 100%);
    pointer-events: none;
    z-index: 1;
}

/* Rainbow Edge Glow */
.config-panel::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg,
            rgba(99, 102, 241, 0.15) 0%,
            rgba(139, 92, 246, 0.1) 25%,
            rgba(236, 72, 153, 0.08) 50%,
            rgba(34, 211, 238, 0.1) 75%,
            rgba(59, 130, 246, 0.12) 100%);
    border-radius: calc(var(--radius-xl) + 2px);
    z-index: -1;
    opacity: 0.6;
    filter: blur(8px);
}

.config-panel:hover {
    box-shadow: var(--shadow-glass-hover);
    transform: translateY(-2px);
}

/* Panel Header - Crystal Top */
.panel-header {
    position: relative;
    padding: var(--spacing-lg) var(--spacing-xl);
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.5) 0%,
            rgba(255, 255, 255, 0.2) 100%);
    z-index: 2;
}

/* Header Shine Line */
.panel-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.8) 50%,
            transparent 100%);
}

.panel-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.panel-progress {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 2px;
    transition: width var(--transition-slow);
    width: 0%;
}

.progress-text {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    font-weight: 500;
}

/* Sections Container */
.sections-container {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md);
}

.sections-container::-webkit-scrollbar {
    width: 6px;
}

.sections-container::-webkit-scrollbar-track {
    background: transparent;
}

.sections-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

.sections-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* ============================================
   CONFIG SECTIONS - Ultra Liquid Glass Cards
   ============================================ */
.config-section {
    position: relative;
    background: linear-gradient(145deg,
            rgba(255, 255, 255, 0.4) 0%,
            rgba(255, 255, 255, 0.15) 50%,
            rgba(255, 255, 255, 0.25) 100%);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-md);
    overflow: hidden;
    transition: all var(--transition-medium);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.06),
        0 1px 4px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        inset 0 -1px 0 rgba(255, 255, 255, 0.2);
}

/* Section Shine Overlay */
.config-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.35) 0%,
            transparent 100%);
    pointer-events: none;
    z-index: 0;
}

.config-section:hover {
    background: linear-gradient(145deg,
            rgba(255, 255, 255, 0.55) 0%,
            rgba(255, 255, 255, 0.25) 50%,
            rgba(255, 255, 255, 0.35) 100%);
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.1),
        0 4px 12px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        inset 0 -1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-2px) scale(1.005);
}

.config-section.active {
    background: linear-gradient(145deg,
            rgba(255, 255, 255, 0.6) 0%,
            rgba(240, 245, 255, 0.3) 50%,
            rgba(255, 255, 255, 0.4) 100%);
    border-color: rgba(37, 99, 235, 0.35);
    box-shadow:
        0 12px 48px rgba(37, 99, 235, 0.15),
        0 4px 16px rgba(37, 99, 235, 0.1),
        0 0 0 1px rgba(37, 99, 235, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        inset 0 -1px 0 rgba(37, 99, 235, 0.1);
}

/* Section Header */
.section-header {
    display: flex;
    align-items: center;
    padding: var(--spacing-md);
    cursor: pointer;
    user-select: none;
    transition: background var(--transition-fast);
}

.section-header:hover {
    background: rgba(0, 0, 0, 0.02);
}

.section-number {
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin-right: var(--spacing-md);
    transition: all var(--transition-fast);
}

.config-section.active .section-number,
.config-section.completed .section-number {
    background: var(--accent-primary);
    color: white;
}

.section-info {
    flex: 1;
}

.section-title {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.section-status {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.section-toggle {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.config-section.expanded .section-toggle {
    transform: rotate(180deg);
}

/* Section Content */
.section-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow);
}

.config-section.expanded .section-content {
    max-height: 1000px;
}

.section-body {
    padding: 0 var(--spacing-md) var(--spacing-md);
}

/* ============================================
   MACHINE TYPE CARDS
   ============================================ */
.machine-type-grid {
    display: grid;
    gap: var(--spacing-sm);
}

.machine-type-card {
    position: relative;
    background: rgba(255, 255, 255, 0.6);
    border: 2px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    cursor: pointer;
    transition: all var(--transition-medium);
    overflow: hidden;
}

.machine-type-card:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.machine-type-card.selected {
    border-color: var(--accent-primary);
    background: rgba(37, 99, 235, 0.06);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.machine-type-card.selected .machine-type-icon {
    color: var(--accent-primary);
}

.machine-type-icon {
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
    color: var(--text-tertiary);
    transition: color var(--transition-fast);
}

.machine-type-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.machine-type-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ============================================
   FORM CONTROLS
   ============================================ */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
}

.form-value {
    font-family: var(--font-mono);
    color: var(--accent-primary);
    font-weight: 600;
    cursor: text;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    min-width: 60px;
    text-align: right;
    display: inline-block;
}

/* Editable value hover state */
.form-value:hover {
    background: rgba(37, 99, 235, 0.08);
}

/* Editable value focus/edit state */
.form-value:focus,
.form-value.editable-value:focus {
    outline: none;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.95) 0%,
            rgba(255, 255, 255, 0.85) 100%);
    border: 1px solid rgba(37, 99, 235, 0.4);
    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 1);
    padding: 4px 8px;
    margin: -2px;
}

/* Text Input - Liquid Glass */
.form-input {
    width: 100%;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.9) 0%,
            rgba(255, 255, 255, 0.7) 100%);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        0 2px 4px rgba(0, 0, 0, 0.02);
}

.form-input:hover {
    border-color: rgba(255, 255, 255, 0.9);
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.98) 0%,
            rgba(255, 255, 255, 0.85) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 4px 8px rgba(0, 0, 0, 0.04);
}

.form-input:focus {
    outline: none;
    border-color: rgba(37, 99, 235, 0.5);
    background: rgba(255, 255, 255, 0.98);
    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 1),
        0 4px 12px rgba(37, 99, 235, 0.08);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* Select - Liquid Glass */
.form-select {
    width: 100%;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.9) 0%,
            rgba(255, 255, 255, 0.7) 100%);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.875rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6b7d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    transition: all var(--transition-fast);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        0 2px 4px rgba(0, 0, 0, 0.02);
}

.form-select:hover {
    border-color: rgba(255, 255, 255, 0.9);
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 4px 8px rgba(0, 0, 0, 0.04);
}

.form-select:focus {
    outline: none;
    border-color: rgba(37, 99, 235, 0.5);
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 1),
        0 4px 12px rgba(37, 99, 235, 0.08);
}

/* ============================================
   TOGGLE SWITCH - Liquid Glass
   ============================================ */
.toggle-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) 0;
}

.toggle-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 26px;
    transition: all var(--transition-fast);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background: white;
    border-radius: 50%;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(22px);
}

.toggle-switch:hover .toggle-slider {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Range Slider - Liquid Glass */
.range-slider {
    position: relative;
    padding-top: var(--spacing-sm);
}

.range-input {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(180deg,
            rgba(0, 0, 0, 0.08) 0%,
            rgba(0, 0, 0, 0.12) 100%);
    border-radius: 4px;
    cursor: pointer;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

.range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 1) 0%,
            rgba(245, 245, 247, 1) 100%);
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    cursor: grab;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.15),
        0 4px 16px rgba(37, 99, 235, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 1);
    transition: transform var(--transition-fast);
}

.range-input::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.range-input::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(0.95);
}

.range-input::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: white;
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    cursor: grab;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.range-limits {
    display: flex;
    justify-content: space-between;
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: var(--spacing-xs);
    font-family: var(--font-mono);
}

/* Inline Inputs */
.input-row {
    display: flex;
    gap: var(--spacing-md);
}

.input-row .form-group {
    flex: 1;
}

/* Toggle Switch */
.toggle-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) 0;
}

.toggle-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    transition: all var(--transition-fast);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    transition: all var(--transition-fast);
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--accent-primary);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(20px);
}

/* Button Group */
.button-group {
    display: flex;
    gap: 2px;
    background: rgba(0, 0, 0, 0.06);
    padding: 2px;
    border-radius: var(--radius-md);
}

.btn-option {
    flex: 1;
    padding: var(--spacing-sm) var(--spacing-md);
    background: transparent;
    border: none;
    border-radius: calc(var(--radius-md) - 2px);
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-option:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.5);
}

.btn-option.active {
    background: white;
    color: var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

/* ============================================
   BOTTOM ACTION BAR
   ============================================ */
.action-bar {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.4);
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.3) 0%,
            rgba(255, 255, 255, 0.15) 100%);
}

/* ============================================
   LIQUID GLASS SUBMIT BUTTON
   ============================================ */
.btn-submit-glass {
    position: relative;
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    /* Ultra Liquid Glass Background */
    background: linear-gradient(145deg,
            rgba(255, 255, 255, 0.5) 0%,
            rgba(255, 255, 255, 0.2) 50%,
            rgba(255, 255, 255, 0.35) 100%);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    /* Glass Shadow */
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.1),
        0 4px 12px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(255, 255, 255, 0.3);
    overflow: hidden;
    z-index: 1;
}

/* Prismatic Shine Overlay */
.btn-submit-glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.5) 0%,
            rgba(255, 255, 255, 0.15) 50%,
            transparent 100%);
    pointer-events: none;
    z-index: 1;
}

/* Rainbow Glow Effect */
.btn-submit-glass::after {
    content: '';
    position: absolute;
    inset: -3px;
    background: linear-gradient(135deg,
            rgba(34, 211, 238, 0.4) 0%,
            rgba(59, 130, 246, 0.3) 25%,
            rgba(139, 92, 246, 0.25) 50%,
            rgba(236, 72, 153, 0.2) 75%,
            rgba(34, 211, 238, 0.35) 100%);
    border-radius: calc(var(--radius-lg) + 3px);
    z-index: -1;
    opacity: 0;
    filter: blur(12px);
    transition: opacity var(--transition-medium);
}

.btn-submit-glass:hover {
    background: linear-gradient(145deg,
            rgba(255, 255, 255, 0.65) 0%,
            rgba(255, 255, 255, 0.35) 50%,
            rgba(255, 255, 255, 0.5) 100%);
    border-color: rgba(255, 255, 255, 0.9);
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.15),
        0 8px 24px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 1),
        inset 0 -1px 0 rgba(255, 255, 255, 0.4);
}

.btn-submit-glass:hover::after {
    opacity: 1;
}

.btn-submit-glass:active {
    transform: translateY(-1px) scale(1.01);
}

.btn-submit-glass svg {
    width: 20px;
    height: 20px;
    stroke: var(--accent-primary);
    z-index: 2;
    position: relative;
}

.btn-primary {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    background: linear-gradient(135deg, var(--accent-primary) 0%, #1d4ed8 100%);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: var(--font-primary);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary svg {
    width: 18px;
    height: 18px;
}

/* ============================================
   VALIDATION STATES
   ============================================ */
.validation-message {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(217, 119, 6, 0.1);
    border: 1px solid rgba(217, 119, 6, 0.3);
    border-radius: var(--radius-md);
    margin-top: var(--spacing-sm);
    font-size: 0.8125rem;
    color: var(--accent-warning);
}

.validation-message.error {
    background: rgba(220, 38, 38, 0.1);
    border-color: rgba(220, 38, 38, 0.3);
    color: var(--accent-danger);
}

.validation-message.success {
    background: rgba(5, 150, 105, 0.1);
    border-color: rgba(5, 150, 105, 0.3);
    color: var(--accent-success);
}

/* ============================================
   LOADER
   ============================================ */
.scene-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-gradient);
    z-index: 200;
    transition: opacity var(--transition-slow);
}

.scene-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loader-text {
    margin-top: var(--spacing-md);
    color: var(--text-tertiary);
    font-size: 0.9375rem;
    font-weight: 500;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    body {
        background: white;
    }

    .viewport-panel,
    .action-bar,
    .section-toggle,
    .branding {
        display: none !important;
    }

    .config-panel {
        position: static;
        width: 100%;
        border: none;
        box-shadow: none;
        background: transparent;
    }

    .config-section {
        break-inside: avoid;
        border: 1px solid #ddd;
        margin-bottom: 1rem;
        background: white;
    }

    .section-content {
        max-height: none !important;
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    .config-panel {
        width: 360px;
    }
}

@media (max-width: 768px) {
    .config-panel {
        position: fixed;
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 60vh;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    }

    .branding {
        top: var(--spacing-md);
        right: var(--spacing-md);
    }

    .viewport-overlay {
        bottom: 65vh;
        left: var(--spacing-md);
    }

    .viewport-title {
        font-size: 1.75rem;
    }
}

/* ============================================
   PRE-CONFIGURED CONFIGS SECTION
   Premium Preset Selection Grid
   ============================================ */
.preconfig-section .section-number.preconfig-icon {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: white;
    font-size: 1rem;
}

.preconfig-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-sm);
}

.preconfig-loading {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-tertiary);
    padding: var(--spacing-lg);
    font-size: 0.875rem;
}

.preconfig-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-md);
    min-height: 72px;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.85) 0%,
            rgba(255, 255, 255, 0.65) 100%);
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-medium);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    overflow: hidden;
}

.preconfig-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.5) 0%,
            transparent 100%);
    pointer-events: none;
}

.preconfig-btn:hover {
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.95) 0%,
            rgba(255, 255, 255, 0.8) 100%);
    border-color: rgba(37, 99, 235, 0.3);
    transform: translateY(-2px);
    box-shadow:
        0 8px 24px rgba(37, 99, 235, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 1);
}

.preconfig-btn.selected {
    background: linear-gradient(135deg,
            rgba(37, 99, 235, 0.12) 0%,
            rgba(8, 145, 178, 0.08) 100%);
    border-color: var(--accent-primary);
    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.15),
        0 8px 24px rgba(37, 99, 235, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.preconfig-btn.selected .preconfig-number {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: white;
    transform: scale(1.1);
}

.preconfig-number {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 50%;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-secondary);
    transition: all var(--transition-medium);
}

.preconfig-label {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    text-align: center;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preconfig-btn.selected .preconfig-label {
    color: var(--accent-primary);
    font-weight: 500;
}

/* Other button styling */
.preconfig-btn.other-btn {
    background: linear-gradient(180deg,
            rgba(240, 240, 243, 0.9) 0%,
            rgba(230, 230, 235, 0.8) 100%);
    border-style: dashed;
    border-color: rgba(0, 0, 0, 0.12);
}

.preconfig-btn.other-btn:hover {
    background: linear-gradient(180deg,
            rgba(250, 250, 253, 0.95) 0%,
            rgba(240, 240, 243, 0.9) 100%);
    border-color: var(--accent-primary);
}

.preconfig-btn.other-btn .preconfig-number {
    background: transparent;
    color: var(--text-tertiary);
    font-size: 1.25rem;
}

.preconfig-btn.other-btn.selected {
    background: linear-gradient(135deg,
            rgba(37, 99, 235, 0.08) 0%,
            rgba(8, 145, 178, 0.05) 100%);
    border-style: solid;
}

/* Tooltip for config names */
.preconfig-btn[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(26, 26, 46, 0.95);
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    border-radius: var(--radius-sm);
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.preconfig-btn[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(26, 26, 46, 0.95);
    z-index: 100;
}

/* Responsive grid */
@media (max-width: 480px) {
    .preconfig-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-xs);
    }

    .preconfig-btn {
        padding: var(--spacing-sm);
        min-height: 60px;
    }

    .preconfig-number {
        width: 28px;
        height: 28px;
        font-size: 0.875rem;
    }

    .preconfig-label {
        font-size: 0.625rem;
    }
}