/**
 * Endotek Configurator - Styles
 * Design: Technical Blueprint meets Modern UI
 */

/* ========================================
   CSS Variables & Reset
======================================== */
:root {
    /* Colors - Dark Technical Theme */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-card: #15151f;
    --bg-hover: #1e1e2a;
    
    /* Accent Colors */
    --accent-primary: #e63946;
    --accent-secondary: #ff6b6b;
    --accent-tertiary: #ff8585;
    --accent-glow: rgba(230, 57, 70, 0.4);
    
    /* Technical Colors */
    --tech-blue: #4cc9f0;
    --tech-cyan: #4ecdc4;
    --tech-green: #06d6a0;
    --tech-yellow: #ffd93d;
    --tech-grid: rgba(76, 201, 240, 0.08);
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-tertiary: rgba(255, 255, 255, 0.45);
    --text-muted: rgba(255, 255, 255, 0.25);
    
    /* Borders */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --border-active: var(--accent-primary);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px var(--accent-glow);
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    
    /* Typography */
    --font-display: 'Space Mono', monospace;
    --font-body: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.4s ease;
    --transition-spring: 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Layout */
    --header-height: 64px;
    --panel-width: 360px;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* ========================================
   Background Effects
======================================== */
.bg-grid {
    position: fixed;
    inset: 0;
    background-image: 
        linear-gradient(var(--tech-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--tech-grid) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(40px, 40px); }
}

.bg-gradient {
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(230, 57, 70, 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 100% 50%, rgba(76, 201, 240, 0.08), transparent),
        radial-gradient(ellipse 60% 40% at 0% 80%, rgba(230, 57, 70, 0.08), transparent);
    pointer-events: none;
    z-index: 0;
}

/* ========================================
   Header (Configure Page)
======================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 var(--space-xl);
}

.header-configure .header-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
}

.back-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: all var(--transition-base);
}

.back-link:hover {
    color: var(--accent-primary);
    transform: translateX(-4px);
}

.header-title {
    display: flex;
    justify-content: center;
}

.product-badge {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1px;
    padding: var(--space-sm) var(--space-lg);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    text-transform: uppercase;
}

.header-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
}

/* ========================================
   Buttons
======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
    box-shadow: 0 4px 16px rgba(230, 57, 70, 0.3);
}

.btn-primary:hover {
    background: var(--accent-secondary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(230, 57, 70, 0.4);
}

.btn-ar {
    background: linear-gradient(135deg, #06d6a0, #34d399);
    color: white;
    box-shadow: 0 4px 16px rgba(6, 214, 160, 0.3);
}

.btn-ar:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(6, 214, 160, 0.4);
}

.btn-ghost {
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border-color);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

.btn-outline {
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    background: rgba(230, 57, 70, 0.1);
}

.btn-block {
    width: 100%;
}

/* ========================================
   App Homepage
======================================== */
.page-home {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

.app-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    background: rgba(18, 18, 26, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

/* App Header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.app-logo {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.logo-mark {
    width: 40px;
    height: 40px;
    color: var(--accent-primary);
}

.logo-mark svg {
    width: 100%;
    height: 100%;
}

.logo-info {
    display: flex;
    flex-direction: column;
}

.logo-name {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.logo-sub {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    letter-spacing: 1px;
}

.app-status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-md);
    background: rgba(6, 214, 160, 0.1);
    border-radius: var(--radius-full);
}

.status-dot {
    width: 6px;
    height: 6px;
    background: var(--tech-green);
    border-radius: 50%;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(6, 214, 160, 0.4); }
    50% { opacity: 0.8; box-shadow: 0 0 0 4px rgba(6, 214, 160, 0); }
}

.status-text {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--tech-green);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* App Main */
.app-main {
    flex: 1;
    padding: var(--space-lg);
    overflow-y: auto;
}

.section-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--space-md);
}

.section-label-mt {
    margin-top: var(--space-xl);
}

.label-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* Products List */
.products-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.product-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    animation: itemSlideIn 0.4s ease backwards;
    animation-delay: var(--delay);
}

@keyframes itemSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
}

.product-item:hover {
    background: var(--bg-hover);
    border-color: var(--accent, var(--accent-primary));
    transform: translateX(4px);
}

.product-item.touching {
    transform: scale(0.98);
    opacity: 0.9;
}

.product-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent, var(--accent-primary)), color-mix(in srgb, var(--accent, var(--accent-primary)) 70%, white));
    border-radius: var(--radius-md);
    font-size: 1.2rem;
    color: white;
    flex-shrink: 0;
}

.product-info {
    flex: 1;
    min-width: 0;
}

.product-name {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-desc {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-arrow {
    color: var(--text-muted);
    transition: all var(--transition-base);
}

.product-item:hover .product-arrow {
    color: var(--accent, var(--accent-primary));
    transform: translateX(4px);
}

/* Recent Configs */
.recent-configs {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xl);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.empty-state i {
    font-size: 1.5rem;
    opacity: 0.5;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-card);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    animation: itemSlideIn 0.3s ease backwards;
    animation-delay: var(--delay);
}

.recent-item:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

.recent-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

.recent-info {
    flex: 1;
    min-width: 0;
}

.recent-name {
    font-size: 0.85rem;
    font-weight: 500;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* App Footer */
.app-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.footer-text {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.footer-version {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    padding: 2px 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

/* Text gradient helper */
.text-gradient {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-tertiary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   Configure Layout
======================================== */
.page-configure {
    height: 100vh;
    overflow: hidden;
}

.configure-layout {
    display: grid;
    grid-template-columns: var(--panel-width) 1fr 320px;
    height: calc(100vh - var(--header-height));
    margin-top: var(--header-height);
}

/* Left Panel - Form */
.panel-form {
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    overflow: hidden;
}

.panel-scroll {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--bg-tertiary) transparent;
}

.panel-scroll::-webkit-scrollbar {
    width: 6px;
}

.panel-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.panel-scroll::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
}

/* Groups Navigation */
.groups-nav {
    display: flex;
    gap: var(--space-xs);
    padding: var(--space-md);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
    overflow-x: auto;
}

.group-tab {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-tertiary);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    white-space: nowrap;
    transition: all var(--transition-base);
}

.group-tab:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
}

.group-tab.active {
    color: var(--accent-primary);
    background: rgba(230, 57, 70, 0.1);
    border-color: rgba(230, 57, 70, 0.2);
}

/* Config Form */
.config-form {
    padding: var(--space-md);
}

.form-group-section {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.form-group-section:last-child {
    border-bottom: none;
}

.form-group-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: var(--space-md);
}

.form-group {
    margin-bottom: var(--space-md);
    animation: fieldFadeIn 0.3s ease backwards;
}

@keyframes fieldFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.form-group.hidden {
    display: none;
}

.form-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.form-unit {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
}

.form-input {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.1);
}

.form-input::-webkit-inner-spin-button,
.form-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

/* Number Input with Controls */
.input-number-wrap {
    display: flex;
    align-items: stretch;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-base);
}

.input-number-wrap:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.1);
}

.input-number-wrap .form-input {
    border: none;
    background: transparent;
    text-align: center;
}

.input-number-wrap .form-input:focus {
    box-shadow: none;
}

.input-number-btn {
    width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    background: var(--bg-secondary);
    border: none;
    transition: all var(--transition-base);
}

.input-number-btn:hover {
    color: var(--accent-primary);
    background: var(--bg-hover);
}

/* Select */
.form-select {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    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='%23666' 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;
}

.form-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.1);
}

/* Checkbox */
.checkbox-wrap {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
    cursor: pointer;
}

.checkbox-input {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
}

.checkbox-custom i {
    font-size: 0.7rem;
    color: white;
    opacity: 0;
    transform: scale(0.5);
    transition: all var(--transition-base);
}

.checkbox-input:checked + .checkbox-custom {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.checkbox-input:checked + .checkbox-custom i {
    opacity: 1;
    transform: scale(1);
}

.checkbox-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Radio Visual (Battuta Selector) */
.radio-visual-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.radio-visual-item {
    flex: 1;
    min-width: 50px;
}

.radio-visual-input {
    display: none;
}

.radio-visual-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-sm) var(--space-xs);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

.radio-visual-label:hover {
    border-color: var(--border-hover);
    background: var(--bg-hover);
}

.radio-visual-input:checked + .radio-visual-label {
    background: rgba(230, 57, 70, 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.radio-visual-value {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 600;
}

.radio-visual-sublabel {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Panel Summary */
.panel-summary {
    padding: var(--space-md);
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

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

.summary-label {
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

.summary-value {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent-primary);
}

/* ========================================
   3D Preview Panel
======================================== */
.panel-preview {
    position: relative;
    background: var(--bg-primary);
    overflow: hidden;
}

.preview-container {
    position: absolute;
    inset: 0;
}

#canvas3d {
    width: 100%;
    height: 100%;
    display: block;
}

.preview-controls {
    position: absolute;
    bottom: var(--space-lg);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs);
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.preview-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.preview-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.preview-btn.active {
    color: var(--accent-primary);
    background: rgba(230, 57, 70, 0.1);
}

.preview-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 var(--space-xs);
}

/* Dimensions Overlay */
.preview-dimensions {
    position: absolute;
    inset: var(--space-xl);
    pointer-events: none;
}

.dim {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dim-width {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
}

.dim-height {
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 60%;
    flex-direction: column;
}

.dim-line {
    position: absolute;
    background: var(--tech-cyan);
    opacity: 0.5;
}

.dim-width .dim-line {
    height: 1px;
    width: 100%;
}

.dim-height .dim-line {
    width: 1px;
    height: 100%;
}

.dim-value {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--tech-cyan);
    background: var(--bg-primary);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(78, 205, 196, 0.3);
}

/* Loading Overlay */
.preview-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    transition: opacity var(--transition-slow);
}

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

.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

.loader-ring {
    width: 48px;
    height: 48px;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loader span {
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

/* ========================================
   Info Panel
======================================== */
.panel-info {
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    padding: var(--space-lg);
    overflow-y: auto;
}

.info-section {
    margin-bottom: var(--space-xl);
}

.info-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.info-title i {
    color: var(--accent-primary);
}

.specs-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.spec-item {
    display: flex;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.spec-item:last-child {
    border-bottom: none;
}

.spec-label {
    color: var(--text-tertiary);
}

.spec-value {
    font-family: var(--font-mono);
    font-weight: 500;
    color: var(--text-primary);
}

/* Quote Diagram */
.quotes-visual {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

.quote-diagram {
    width: 100%;
    height: auto;
}

/* Export Grid */
.export-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: var(--space-md);
}

.export-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.25s ease;
}

.export-card:hover {
    background: var(--bg-hover);
    border-color: rgba(255,255,255,0.15);
    transform: translateY(-2px);
}

.export-card:active {
    transform: translateY(0) scale(0.98);
}

.export-card-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: white;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.export-card-format {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.export-card-desc {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.export-pdf-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px;
    background: linear-gradient(135deg, #dc2626, #ef4444);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.3);
}

.export-pdf-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.4);
}

.export-pdf-btn i {
    font-size: 16px;
}

/* ========================================
   Modal
======================================== */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transform: scale(0.95) translateY(20px);
    transition: transform var(--transition-spring);
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

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

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.modal-close:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.modal-body {
    padding: var(--space-lg);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

/* ========================================
   Toast Notifications
======================================== */
.toast-container {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    z-index: 1100;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
}

.toast.toast-out {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.toast-success {
    border-color: var(--tech-green);
}

.toast-success .toast-icon {
    color: var(--tech-green);
}

.toast-error {
    border-color: var(--accent-primary);
}

.toast-error .toast-icon {
    color: var(--accent-primary);
}

.toast-icon {
    font-size: 1.1rem;
}

.toast-message {
    font-size: 0.9rem;
}

/* ========================================
   Responsive
======================================== */
@media (max-width: 1200px) {
    .configure-layout {
        grid-template-columns: var(--panel-width) 1fr;
    }
    
    .panel-info {
        display: none;
    }
}

@media (max-width: 768px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-visual {
        display: none;
    }
    
    .configure-layout {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr;
    }
    
    .panel-form {
        order: 2;
        border-right: none;
        border-top: 1px solid var(--border-color);
    }
    
    .panel-preview {
        order: 1;
    }
    
    .header-actions span {
        display: none;
    }
}
