:root {
    --bg-main: #0a0e17;
    --card-bg: #141b2d;
    --card-border: #232e48;
    --accent: #0071e3;
    --accent-hover: #0077ed;
    --accent-glow: rgba(0, 113, 227, 0.35);
    --text-primary: #f5f5f7;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --success: #10b981;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 8px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    background: rgba(20, 27, 45, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--card-border);
    padding: 16px 32px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.logo-icon {
    font-size: 2.2rem;
}

.logo-area h1 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.tagline {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.network-badge {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 10px #10b981;
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

/* Layout */
.main-container {
    max-width: 1400px;
    width: 100%;
    margin: 32px auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    flex: 1;
}

@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 20px;
    letter-spacing: -0.01em;
    color: #ffffff;
}

/* Dropzone */
.dropzone {
    border: 2px dashed #334155;
    border-radius: var(--radius-md);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.25s ease;
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--accent);
    background: rgba(0, 113, 227, 0.06);
    transform: translateY(-2px);
}

.dz-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.dz-text {
    font-size: 1.05rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.dz-text .highlight {
    color: var(--accent);
    text-decoration: underline;
}

.dz-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* File Info Box */
.file-info-box {
    background: rgba(0, 113, 227, 0.1);
    border: 1px solid rgba(0, 113, 227, 0.3);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.file-name {
    font-weight: 600;
    color: #ffffff;
    word-break: break-all;
    font-size: 0.95rem;
}

.file-size {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 12px;
    white-space: nowrap;
}

.btn-remove {
    background: transparent;
    border: none;
    color: #ef4444;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    transition: transform 0.1s;
}

.btn-remove:hover {
    transform: scale(1.2);
}

/* Quick Samples */
.quick-samples {
    margin-top: 14px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #475569;
}

/* Scale Radio Options */
.settings-group {
    margin-bottom: 24px;
}

.setting-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.scale-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.radio-card {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.radio-card:hover {
    border-color: #3b82f6;
    background: rgba(255, 255, 255, 0.05);
}

.radio-card input[type="radio"] {
    margin-right: 14px;
    accent-color: var(--accent);
    transform: scale(1.2);
}

.radio-content strong {
    display: block;
    font-size: 0.95rem;
    color: #ffffff;
    margin-bottom: 2px;
}

.radio-content span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.custom-scale-row {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.custom-scale-row input {
    background: #0f172a;
    border: 1px solid var(--card-border);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    width: 100px;
    font-size: 0.95rem;
}

/* Switch Toggles */
.toggle-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 28px;
}

.toggle-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    cursor: pointer;
    user-select: none;
}

.toggle-item input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: #334155;
    border-radius: 24px;
    transition: background 0.25s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.25s ease;
}

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

.toggle-item input:checked + .toggle-slider::after {
    transform: translateX(20px);
}

.toggle-text strong {
    display: block;
    font-size: 0.92rem;
    color: #ffffff;
    margin-bottom: 2px;
}

.toggle-text span {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.35;
    display: block;
}

/* Convert Button */
.btn-primary {
    background: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    padding: 16px 28px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 6px 20px var(--accent-glow);
    width: 100%;
    margin-top: auto;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-primary:disabled {
    background: #334155;
    color: #64748b;
    cursor: not-allowed;
    box-shadow: none;
}

/* Progress Box */
.progress-box {
    margin-top: 20px;
}

.progress-bar-bg {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    height: 10px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    background: linear-gradient(90deg, #0071e3, #38bdf8);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-status-text {
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Right Panel: Placeholder */
.placeholder-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 30px 20px;
    text-align: center;
}

.phone-mockup {
    width: 180px;
    height: 280px;
    border: 3px solid #334155;
    border-radius: 32px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
    background: rgba(255, 255, 255, 0.01);
}

.phone-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.phone-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.phone-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.how-it-works {
    text-align: left;
    max-width: 440px;
    width: 100%;
}

.how-it-works h3 {
    font-size: 1rem;
    margin-bottom: 16px;
    color: #ffffff;
}

.step-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.step-num {
    background: rgba(0, 113, 227, 0.2);
    color: #38bdf8;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* Right Panel: Active Results */
.qr-showcase {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
}

@media (max-width: 600px) {
    .qr-showcase {
        flex-direction: column;
        text-align: center;
    }
}

.qr-frame {
    background: #ffffff;
    border-radius: 12px;
    padding: 12px;
    flex-shrink: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.qr-frame img {
    display: block;
    width: 160px;
    height: 160px;
}

.qr-instructions {
    flex: 1;
}

.qr-badge {
    background: rgba(0, 113, 227, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 20px;
    padding: 3px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 8px;
}

.qr-instructions h3 {
    font-size: 1.15rem;
    margin-bottom: 6px;
    color: #ffffff;
}

.qr-instructions p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 12px;
}

.direct-link {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.direct-link a {
    color: var(--accent);
    text-decoration: underline;
    word-break: break-all;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

@media (max-width: 600px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.metric-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 14px 10px;
    text-align: center;
}

.metric-val {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 4px;
}

.metric-lbl {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* 3D Preview Section */
.preview-3d-section {
    background: #000000;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 24px;
}

.preview-header {
    background: #111827;
    padding: 8px 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #1f2937;
}

.preview-control-hint {
    color: var(--text-muted);
}

.three-container {
    width: 100%;
    height: 280px;
    position: relative;
}

/* Action Buttons */
.action-buttons-row {
    display: flex;
    gap: 14px;
}

.btn-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.btn-download {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid var(--card-border);
}

.btn-download:hover {
    background: rgba(255, 255, 255, 0.14);
}

.btn-ar {
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-ar:hover {
    background: var(--accent-hover);
}

/* Mobile & Hero Action Card */
.mobile-action-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.btn-hero-ar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: linear-gradient(135deg, #0071e3 0%, #005bb5 100%);
    color: #ffffff;
    text-decoration: none;
    padding: 16px 22px;
    border-radius: var(--radius-md);
    box-shadow: 0 6px 20px rgba(0, 113, 227, 0.45);
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    -webkit-tap-highlight-color: transparent;
}

.btn-hero-ar:hover,
.btn-hero-ar:active {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0, 113, 227, 0.65);
    background: linear-gradient(135deg, #0077ed 0%, #0062c4 100%);
}

.hero-ar-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.hero-ar-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.hero-ar-text strong {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #ffffff;
}

.hero-ar-text span {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 2px;
}

.btn-hero-download {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    text-decoration: none;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.btn-hero-download:hover,
.btn-hero-download:active {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-1px);
}

.hero-filesize {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 400;
}

.download-buttons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

@media (max-width: 600px) {
    .download-buttons-grid {
        grid-template-columns: 1fr;
    }
}

.btn-hero-download-glb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, rgba(5, 150, 105, 0.25) 100%);
    border: 1px solid rgba(16, 185, 129, 0.45);
    color: #34d399;
    text-decoration: none;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.btn-hero-download-glb:hover,
.btn-hero-download-glb:active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.3) 0%, rgba(5, 150, 105, 0.4) 100%);
    border-color: #10b981;
    transform: translateY(-1px);
}

.btn-hero-download-usdz {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.18) 0%, rgba(37, 99, 235, 0.25) 100%);
    border: 1px solid rgba(59, 130, 246, 0.45);
    color: #60a5fa;
    text-decoration: none;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.btn-hero-download-usdz:hover,
.btn-hero-download-usdz:active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(37, 99, 235, 0.4) 100%);
    border-color: #3b82f6;
    transform: translateY(-1px);
}

