/* ============================================
   DRW Skincare - Skin Analyzer (standalone)
   ============================================ */

:root {
    --primary-color: #ec4899;
    --primary-dark: #db2777;
    --primary-light: #f472b6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 6px 20px rgba(236, 72, 153, 0.10);
    --shadow-lg: 0 14px 40px rgba(236, 72, 153, 0.16);
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ===== Cards ===== */
.content-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.25rem;
    border: 1px solid rgba(236, 72, 153, 0.08);
    transition: box-shadow 0.3s ease;
}

.content-card:hover {
    box-shadow: var(--shadow-md);
}

/* ===== Tab Navigation (minimal pill) ===== */
.tab-nav {
    display: flex;
    gap: 0.25rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    border-radius: 999px;
    padding: 0.25rem;
    border: 1px solid rgba(236, 72, 153, 0.10);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
    flex: 1;
    min-width: max-content;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    background: transparent;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.tab-btn:hover { color: var(--primary-color); }

.tab-btn.active {
    background: linear-gradient(135deg, #ec4899 0%, #a855f7 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.28);
}

.tab-btn .tab-icon { font-size: 0.85rem; }

@media (max-width: 480px) {
    .tab-btn { padding: 0.45rem 0.7rem; font-size: 0.75rem; gap: 0.3rem; }
    .tab-btn .tab-icon { font-size: 0.8rem; }
}

/* ===== Tab Panels (with fade) ===== */
.tab-panel { display: none; animation: fadeIn 0.3s ease; }
.tab-panel.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===== Guide Steps ===== */
.guide-step {
    display: flex;
    gap: 0.875rem;
    align-items: flex-start;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.04), rgba(168, 85, 247, 0.04));
    border: 1px solid rgba(236, 72, 153, 0.10);
    border-radius: 14px;
}

.guide-step-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, #ec4899, #a855f7);
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

/* ===== Pills / badges ===== */
.badge-pill {
    display: inline-block;
    font-size: 0.7rem;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-weight: 600;
}

/* ===== CTA Button ===== */
.cta-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.75rem;
    background: linear-gradient(135deg, #ec4899 0%, #a855f7 100%);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(236, 72, 153, 0.30);
    transition: all 0.2s ease;
}

.cta-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(236, 72, 153, 0.38);
}

.cta-primary:active { transform: scale(0.98); }

/* ===== Buttons ===== */
.btn-primary, .btn-secondary { transition: all 0.2s ease; }
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:active, .btn-secondary:active { transform: scale(0.98); }

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #f3f4f6;
    color: #4b5563;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: linear-gradient(135deg, #ec4899, #a855f7);
    color: #fff;
}

/* ===== Camera ===== */
.content-card-camera {
    padding: 0.6rem;
    border-radius: 22px;
}

.camera-stage {
    position: relative;
    margin-bottom: 0.75rem;
}

.camera-frame {
    position: relative;
    aspect-ratio: 3 / 4;
    max-height: 70vh;
    background: #0f172a;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
}

@media (min-width: 640px) {
    .camera-frame { aspect-ratio: 4 / 5; max-height: 75vh; }
}

/* Overlay fullscreen button (top-right of camera stage) */
.fs-toggle-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: none;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 0.85rem;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
}

.fs-toggle-btn:hover {
    background: linear-gradient(135deg, #ec4899, #a855f7);
}

.camera-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.camera-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

/* Subtle scanning corners (decorative) */
.camera-frame::before,
.camera-frame::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border: 2px solid rgba(236, 72, 153, 0.75);
    pointer-events: none;
    z-index: 2;
}
.camera-frame::before {
    top: 12px; left: 12px;
    border-right: none; border-bottom: none;
    border-top-left-radius: 8px;
}
.camera-frame::after {
    bottom: 12px; right: 12px;
    border-left: none; border-top: none;
    border-bottom-right-radius: 8px;
}

/* Exit fullscreen button (only visible in fs) */
.exit-fs-btn {
    display: none;
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    backdrop-filter: blur(8px);
    z-index: 10;
}

/* Floating shutter (only visible in fs) */
.fs-floating-controls {
    display: none;
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.fs-shutter {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    border: 4px solid #fff;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
}

.fs-shutter:active { transform: scale(0.92); }

.fs-shutter-inner {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ec4899, #a855f7);
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.5);
}

/* Fullscreen state */
.camera-stage.is-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #000;
    padding: 0;
    margin: 0;
}

.camera-stage.is-fullscreen .camera-frame {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    border-radius: 0;
}

.camera-stage.is-fullscreen .camera-frame::before,
.camera-stage.is-fullscreen .camera-frame::after { display: none; }

.camera-stage.is-fullscreen .exit-fs-btn,
.camera-stage.is-fullscreen .fs-floating-controls {
    display: flex;
}

.camera-stage.is-fullscreen .fs-floating-controls {
    display: block;
}

/* ===== Result Hero Cards ===== */
.result-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    border-radius: 16px;
    border: 1px solid;
}

.result-hero-purple {
    background: linear-gradient(135deg, #faf5ff, #fdf2f8);
    border-color: #e9d5ff;
}

.result-hero-green {
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    border-color: #bbf7d0;
}

/* ===== Toast ===== */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: calc(100vw - 3rem);
    pointer-events: none;
}

.toast {
    background: var(--bg-card);
    padding: 0.875rem 1.25rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 280px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid var(--info-color);
    pointer-events: auto;
}

.toast.success { border-left-color: var(--success-color); }
.toast.error   { border-left-color: var(--danger-color); }
.toast.info    { border-left-color: var(--info-color); }
.toast.warning { border-left-color: var(--warning-color); }

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

.toast.success i { color: var(--success-color); }
.toast.error i   { color: var(--danger-color); }
.toast.info i    { color: var(--info-color); }
.toast.warning i { color: var(--warning-color); }

@keyframes slideIn {
    from { transform: translateX(400px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

/* ===== Utility ===== */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== Mobile tweaks ===== */
@media (max-width: 640px) {
    .content-card {
        padding: 1.1rem;
        border-radius: 16px;
    }

    .toast-container {
        right: 1rem;
        left: 1rem;
        bottom: 1rem;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }

    .result-hero { padding: 1rem; }
    .result-hero p.text-2xl { font-size: 1.35rem; }
}
