/* ═══════════════════════════════════════════════════════════════
   Mellouk Beauty — AI Analyzer
   Color palette: beige #F5F0E8 · gold #C9A96E · dark #2C2C2C
   ═══════════════════════════════════════════════════════════════ */

:root {
    --beige-50:   #fdfbf7;
    --beige-100:  #f9f5ee;
    --beige-200:  #f5f0e8;
    --beige-300:  #ede4d0;
    --gold-300:   #d4b87a;
    --gold-400:   #c9a96e;
    --gold-500:   #b8933a;
    --gold-600:   #9a7a2e;
    --dark:       #2c2c2c;
    --dark-800:   #1a1a1a;

    --shadow-card: 0 2px 24px rgba(44, 44, 44, 0.07);
    --shadow-hover: 0 8px 36px rgba(44, 44, 44, 0.13);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }

body {
    background-color: var(--beige-200);
    font-family: 'Outfit', sans-serif;
    color: var(--dark);
    -webkit-font-smoothing: antialiased;
}

/* ── Header ── */
.analyze-header {
    background: rgba(245, 240, 232, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--beige-300);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-link {
    text-decoration: none;
    color: var(--dark);
    transition: opacity var(--transition);
}
.logo-link:hover { opacity: 0.75; }

.whatsapp-btn {
    background: #25d366;
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1.1rem;
    border-radius: 9999px;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 0.875rem;
    transition: background var(--transition), transform var(--transition);
}
.whatsapp-btn:hover {
    background: #1ebe5a;
    transform: translateY(-1px);
}

/* ── Hero ── */
.hero-section {
    animation: fadeUp 0.6s ease both;
}

.hero-badge {
    background: rgba(201, 169, 110, 0.15);
    color: var(--gold-600);
    border: 1px solid rgba(201, 169, 110, 0.3);
    font-family: 'Outfit', sans-serif;
}

.gold-text {
    background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.privacy-note {
    background: rgba(201, 169, 110, 0.1);
    border: 1px solid rgba(201, 169, 110, 0.25);
    padding: 0.4rem 1rem;
    border-radius: 9999px;
}

.stat-item {
    text-align: center;
}
.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gold-500);
    line-height: 1;
    display: block;
}
.stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.2rem;
    display: block;
}

/* ── Upload Card ── */
.upload-card {
    background: #fff;
    box-shadow: var(--shadow-card);
    animation: fadeUp 0.7s 0.1s ease both;
}

.drop-zone {
    border-color: var(--beige-300);
    background: var(--beige-50);
    transition: border-color var(--transition), background var(--transition);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--gold-400);
    background: rgba(201, 169, 110, 0.05);
}

.drop-zone:focus-visible {
    outline: 2px solid var(--gold-400);
    outline-offset: 2px;
}

.drop-content {
    pointer-events: none;
}

.drop-icon-wrap {
    width: 64px;
    height: 64px;
    background: rgba(201, 169, 110, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-btn-label {
    background: var(--gold-400);
    color: #fff;
    font-weight: 500;
    pointer-events: none;
    letter-spacing: 0.01em;
}

/* Photo preview */
.preview-img-wrap {
    display: inline-block;
}
.preview-img {
    max-height: 260px;
    max-width: 100%;
    width: auto;
    border: 3px solid var(--gold-300);
}

.remove-btn {
    background: var(--dark);
    color: #fff;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background var(--transition);
}
.remove-btn:hover { background: #e11d48; }

#drop-preview {
    display: none;
}
#drop-preview.flex {
    display: flex;
}

/* Camera button */
.camera-capture-btn {
    background: transparent;
    border: 1px solid var(--beige-300);
    color: var(--dark);
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
}
.camera-capture-btn:hover {
    border-color: var(--gold-400);
    background: rgba(201, 169, 110, 0.07);
}

/* Analyze button */
.analyze-btn {
    background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
    color: #fff;
    border: none;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 16px rgba(201, 169, 110, 0.35);
}
.analyze-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(201, 169, 110, 0.45);
}
.analyze-btn:not(:disabled):active {
    transform: translateY(0);
}
.analyze-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

/* Error */
.error-banner {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #dc2626;
    font-size: 0.875rem;
}

/* ── Loading ── */
.loading-card {
    background: #fff;
    box-shadow: var(--shadow-card);
}

.loading-orb {
    position: relative;
    width: 80px;
    height: 80px;
}

.orb-inner {
    position: absolute;
    inset: 16px;
    background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
    border-radius: 50%;
    animation: orbPulse 1.5s ease-in-out infinite;
}

.orb-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid var(--gold-400);
    opacity: 0;
    animation: orbRing 2s ease-out infinite;
}
.orb-ring-1 { inset: 0; animation-delay: 0s; }
.orb-ring-2 { inset: -10px; animation-delay: 0.5s; }
.orb-ring-3 { inset: -20px; animation-delay: 1s; }

@keyframes orbPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}
@keyframes orbRing {
    0% { transform: scale(0.8); opacity: 0.6; }
    100% { transform: scale(1.4); opacity: 0; }
}

.loading-bar-wrap {
    width: 240px;
    max-width: 80%;
    height: 6px;
    background: var(--beige-300);
    border-radius: 9999px;
    overflow: hidden;
}
.loading-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--gold-400), var(--gold-600));
    border-radius: 9999px;
    transition: width 0.4s ease;
}

/* ── Result Cards ── */
.result-card {
    background: #fff;
    box-shadow: var(--shadow-card);
    transition: box-shadow var(--transition), transform var(--transition);
}
.result-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.result-card-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, rgba(201,169,110,0.15), rgba(201,169,110,0.25));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-500);
    flex-shrink: 0;
}
.result-card-icon.routine-morning {
    background: linear-gradient(135deg, rgba(253,186,116,0.2), rgba(251,146,60,0.15));
    color: #ea580c;
}
.result-card-icon.routine-evening {
    background: linear-gradient(135deg, rgba(139,92,246,0.15), rgba(109,40,217,0.1));
    color: #7c3aed;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--beige-300);
    gap: 0.5rem;
}
.result-row:last-child { border-bottom: none; }
.result-label { font-size: 0.8rem; color: #9ca3af; white-space: nowrap; }
.result-value { font-size: 0.875rem; color: var(--dark); text-align: right; }

/* Hair type badge */
.hair-type-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
    color: #fff;
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    padding: 0.4rem 1.2rem;
    border-radius: 12px;
    letter-spacing: 0.02em;
}

/* Porosity bar */
.porosity-track {
    position: relative;
    height: 8px;
    background: var(--beige-300);
    border-radius: 9999px;
    overflow: visible;
}
.porosity-fill {
    height: 100%;
    background: linear-gradient(90deg, #86efac, #fbbf24, #f87171);
    border-radius: 9999px;
    transition: width 1s 0.5s cubic-bezier(0.4,0,0.2,1);
    width: 0;
}
.porosity-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: var(--gold-400);
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    left: 0;
    transition: left 1s 0.5s cubic-bezier(0.4,0,0.2,1);
}

/* Skin swatch */
.skin-swatch-wrap {
    padding: 3px;
    border-radius: 50%;
    background: var(--beige-300);
}
.skin-swatch {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    transition: background-color 0.6s ease;
}

.undertone-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(201,169,110,0.12);
    color: var(--gold-600);
    border: 1px solid rgba(201,169,110,0.25);
}

/* ── Product Cards ── */
.product-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.875rem 1rem;
    border-radius: 1rem;
    background: var(--beige-50);
    border: 1px solid var(--beige-300);
    transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
    text-decoration: none;
    color: inherit;
}
.product-item:hover {
    border-color: var(--gold-400);
    transform: translateX(3px);
    box-shadow: 0 4px 16px rgba(201,169,110,0.15);
}

.product-rank {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
    color: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
}

.product-info { flex: 1; min-width: 0; }
.product-name { font-weight: 600; font-size: 0.875rem; margin-bottom: 0.2rem; }
.product-desc { font-size: 0.75rem; color: #6b7280; line-height: 1.4; }
.product-tag {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    margin-top: 0.3rem;
    background: rgba(201,169,110,0.15);
    color: var(--gold-600);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.product-arrow {
    color: var(--gold-400);
    font-size: 0.875rem;
    flex-shrink: 0;
    margin-top: 4px;
}

/* ── Routines ── */
.routine-list {
    list-style: none;
    padding: 0;
    margin: 0;
    space-y: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.routine-step {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    font-size: 0.875rem;
    color: var(--dark);
    line-height: 1.5;
}
.routine-step-num {
    width: 24px;
    height: 24px;
    background: var(--beige-200);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--gold-500);
    flex-shrink: 0;
}

/* ── Premium CTA ── */
.premium-cta-card {
    background: linear-gradient(135deg, var(--dark-800) 0%, #3d2e1a 100%);
    color: #fff;
    box-shadow: 0 8px 40px rgba(44, 44, 44, 0.25);
    position: relative;
    overflow: hidden;
}
.premium-cta-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23C9A96E' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
    pointer-events: none;
}

.premium-badge {
    background: rgba(201,169,110,0.2);
    color: var(--gold-300);
    border: 1px solid rgba(201,169,110,0.3);
}

.premium-features {
    list-style: none;
    padding: 0;
    margin: 0;
}
.premium-features li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.85);
}
.premium-features li i {
    color: var(--gold-300);
    font-size: 0.75rem;
    flex-shrink: 0;
}

.price-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gold-300);
    line-height: 1;
}

.premium-cta-btn {
    background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
    color: #fff;
    border: none;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 20px rgba(201,169,110,0.45);
    transition: transform var(--transition), box-shadow var(--transition);
}
.premium-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(201,169,110,0.55);
}

.premium-circle {
    width: 120px;
    height: 120px;
    background: rgba(201,169,110,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(201,169,110,0.2);
}
.premium-circle i {
    font-size: 2.5rem;
    color: var(--gold-300);
}

/* ── Re-analyze button ── */
.reanalyze-btn {
    background: transparent;
    border: 1.5px solid var(--beige-300);
    color: #6b7280;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: border-color var(--transition), color var(--transition);
}
.reanalyze-btn:hover {
    border-color: var(--gold-400);
    color: var(--gold-500);
}

/* ── How it works ── */
.how-section {
    border-top: 1px solid var(--beige-300);
}
.how-card {
    background: #fff;
    box-shadow: var(--shadow-card);
    transition: box-shadow var(--transition), transform var(--transition);
}
.how-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}
.how-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, rgba(201,169,110,0.15), rgba(201,169,110,0.3));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-500);
    font-size: 1.4rem;
}

/* ── Footer ── */
.analyze-footer {
    border-top: 1px solid var(--beige-300);
    background: var(--beige-100);
}

/* ── WhatsApp Float ── */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 52px;
    height: 52px;
    background: #25d366;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.45);
    z-index: 50;
    transition: transform var(--transition), box-shadow var(--transition);
}
.whatsapp-float:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 28px rgba(37, 211, 102, 0.55);
}

/* ── Premium Modal ── */
.premium-modal-overlay {
    align-items: center;
    justify-content: center;
}
.premium-modal-overlay.flex {
    display: flex;
}

.premium-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.premium-modal-dialog {
    position: relative;
    z-index: 10;
    background: #fff;
    border-radius: 1.5rem;
    padding: 2rem 1.75rem;
    max-width: 420px;
    width: calc(100% - 2rem);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: modalIn 0.3s cubic-bezier(0.4,0,0.2,1) both;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.premium-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    background: var(--beige-200);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    color: #9ca3af;
    transition: background var(--transition);
}
.premium-modal-close:hover { background: var(--beige-300); color: var(--dark); }

.modal-crown-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--dark-800), #3d2e1a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-300);
}

.modal-price-block {
    background: var(--beige-50);
    border: 1px solid var(--beige-300);
}
.modal-price {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--gold-500);
}

.modal-features {
    list-style: none;
    padding: 0;
    margin: 0;
}
.modal-features li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.875rem;
    color: var(--dark);
}

/* ── Result success badge ── */
.success-badge {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

/* ── Reveal animation ── */
.reveal-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal-card.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delay helpers */
#hair-card.revealed  { transition-delay: 0.0s; }
#skin-card.revealed  { transition-delay: 0.1s; }
#products-card.revealed { transition-delay: 0.2s; }
#morning-card.revealed { transition-delay: 0.3s; }
#evening-card.revealed { transition-delay: 0.4s; }
#premium-card.revealed { transition-delay: 0.5s; }

/* ── Animations ── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* ── Skeleton loader (for future use) ── */
.skeleton {
    background: linear-gradient(90deg, var(--beige-200) 25%, var(--beige-300) 50%, var(--beige-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

/* ── Webcam Capture Overlay ── */
#webcam-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.webcam-dialog {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: #111;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    max-width: 640px;
    width: 90vw;
}
.webcam-dialog video {
    display: block;
    width: 100%;
    border-radius: 20px 20px 0 0;
    transform: scaleX(-1);
}
.webcam-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 1rem;
    background: #111;
}
.webcam-snap-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 4px solid #fff;
    background: var(--gold-400);
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    transition: transform 0.15s, background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.webcam-snap-btn:hover {
    transform: scale(1.1);
    background: var(--gold-500);
}
.webcam-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.webcam-close-btn:hover {
    background: rgba(0, 0, 0, 0.85);
}

/* ── Reanalyze Top Button ── */
.reanalyze-top-btn {
    background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    box-shadow: 0 4px 16px rgba(201, 169, 110, 0.35);
    transition: transform 0.2s, box-shadow 0.2s;
    animation: cta-glow 2.5s ease-in-out infinite;
}
.reanalyze-top-btn:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 24px rgba(201, 169, 110, 0.5);
    animation: none;
}
@keyframes cta-glow {
    0%, 100% { box-shadow: 0 4px 16px rgba(201, 169, 110, 0.35); }
    50%      { box-shadow: 0 6px 24px rgba(201, 169, 110, 0.55); }
}

/* ── Utility ── */
.hidden { display: none !important; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--beige-200); }
::-webkit-scrollbar-thumb { background: var(--beige-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-300); }

/* ── Responsive adjustments ── */
@media (max-width: 640px) {
    .premium-cta-card .price-amount { font-size: 2rem; }
    .hair-type-badge { font-size: 1.25rem; }
    .whatsapp-float { bottom: 16px; right: 16px; width: 46px; height: 46px; font-size: 1.2rem; }
}
