/* MeshIt — Modern 3D Scanning Theme */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a2e;
    --bg-card-hover: #1e1e35;
    --accent: #6c63ff;
    --accent-glow: rgba(108, 99, 255, 0.3);
    --accent-secondary: #00d4aa;
    --text-primary: #e8e8f0;
    --text-secondary: #8888a0;
    --text-muted: #555570;
    --border: #2a2a40;
    --success: #00d4aa;
    --warning: #ffa726;
    --error: #ff5252;
    --gradient-1: linear-gradient(135deg, #6c63ff 0%, #00d4aa 100%);
    --shadow: 0 4px 24px rgba(0,0,0,0.4);
    --shadow-glow: 0 0 40px rgba(108,99,255,0.15);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(108,99,255,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(0,212,170,0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Navbar */
#navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 40px;
    background: rgba(10,10,15,0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links { display: flex; align-items: center; gap: 12px; }
.nav-links span { color: var(--text-secondary); font-size: 0.9rem; }
.nav-links span strong { color: var(--accent-secondary); font-weight: 600; }

/* Buttons */
button {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}
button:hover { background: var(--bg-card-hover); border-color: var(--accent); box-shadow: var(--shadow-glow); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

button#btn-start-scan,
button[onclick*="requestCheckout"] {
    background: var(--gradient-1);
    border: none;
    color: white;
    font-weight: 600;
    padding: 12px 28px;
}
button#btn-start-scan:hover:not(:disabled),
button[onclick*="requestCheckout"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(108,99,255,0.4);
}

/* Hero */
#hero {
    text-align: center;
    padding: 80px 40px 60px;
}
#hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -1px;
    line-height: 1.2;
}
#hero h1 span {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
#hero p { color: var(--text-secondary); font-size: 1.1rem; max-width: 600px; margin: 0 auto 8px; }

.price {
    display: inline-block;
    margin-top: 16px;
    padding: 10px 24px;
    background: rgba(108,99,255,0.1);
    border: 1px solid rgba(108,99,255,0.3);
    border-radius: 50px;
    color: var(--accent);
    font-weight: 600;
    font-size: 1rem;
}

/* Main */
main { max-width: 900px; margin: 0 auto; padding: 0 40px 80px; }

/* Auth */
#auth-section {
    max-width: 400px;
    margin: 0 auto;
    padding: 40px;
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border);
}
#auth-section h2 { text-align: center; margin-bottom: 24px; font-size: 1.5rem; }
#auth-form { display: flex; flex-direction: column; gap: 12px; }

input[type="email"],
input[type="password"],
input[type="number"] {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

#auth-section button[type="submit"] {
    background: var(--gradient-1);
    border: none;
    color: white;
    padding: 14px;
    font-weight: 600;
    margin-top: 8px;
}
#auth-switch { color: var(--text-muted); cursor: pointer; font-size: 0.85rem; }
#auth-switch:hover { color: var(--accent); }

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 48px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(108,99,255,0.02);
}
.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--accent);
    background: rgba(108,99,255,0.05);
    box-shadow: inset 0 0 40px rgba(108,99,255,0.05);
}
.drop-zone p { color: var(--text-secondary); margin: 4px 0; }
.drop-zone .hint { font-size: 0.8rem; color: var(--text-muted); }

/* Photo Preview */
#photo-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.thumb {
    width: 80px; height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--border);
    transition: all 0.2s;
    cursor: pointer;
}
.thumb:hover { border-color: var(--error); transform: scale(1.05); }

/* Upload Actions */
#upload-actions { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
#photo-count { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 12px; }

/* Scan Cards */
h2 { font-size: 1.3rem; margin-bottom: 16px; }
.scan-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}
.scan-card:hover { border-color: var(--accent); background: var(--bg-card-hover); }
.scan-info h3 { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.scan-info p { color: var(--text-secondary); font-size: 0.85rem; margin: 2px 0; }
.scan-actions { display: flex; align-items: center; gap: 12px; }

/* Badges */
.badge { padding: 6px 14px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.badge-uploading { background: rgba(255,167,38,0.15); color: var(--warning); }
.badge-queued { background: rgba(108,99,255,0.15); color: var(--accent); }
.badge-processing { background: rgba(0,212,170,0.15); color: var(--accent-secondary); animation: pulse 2s infinite; }
.badge-completed { background: rgba(0,212,170,0.2); color: var(--success); }
.badge-failed { background: rgba(255,82,82,0.15); color: var(--error); }

@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.6; } }

/* Download Button */
.btn-download {
    background: var(--gradient-1) !important;
    border: none !important;
    color: white !important;
    padding: 10px 20px !important;
    border-radius: 8px !important;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s;
}
.btn-download:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(108,99,255,0.4); }

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    width: 90%;
    max-width: 400px;
    position: relative;
}
.modal-content h2 { margin-bottom: 16px; }
.modal-close {
    position: absolute;
    top: 16px; right: 16px;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
}
.modal-close:hover { color: var(--text-primary); }

/* Footer */
footer {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
}

/* Responsive */
@media (max-width: 768px) {
    #navbar { padding: 12px 20px; }
    #hero { padding: 40px 20px; }
    #hero h1 { font-size: 2rem; }
    main { padding: 0 20px 60px; }
    .scan-card { flex-direction: column; align-items: flex-start; gap: 12px; }
    .drop-zone { padding: 32px 16px; }
}
