/* ═══════════════════════════════════════════════
   SKINARI Virtual Brow AR Studio
   ═══════════════════════════════════════════════ */

/* Section Styling */
.virtual-brow {
    background: var(--color-bg);
}
.theme-dark .virtual-brow {
    background: var(--color-surface);
}

.brow-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    text-align: center;
}
.theme-dark .brow-card {
    background: rgba(30, 27, 25, 0.8) !important;
    border-color: rgba(184, 163, 137, 0.2) !important;
}

.brow-cta-btn {
    margin-top: var(--space-lg);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Modal Core Styling */
.brow-modal {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 2500;
    display: flex;
    align-items: center; justify-content: center;
    visibility: hidden; opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.brow-modal.open {
    visibility: visible;
    opacity: 1;
}

.brow-backdrop {
    position: absolute; inset: 0;
    background: #000; /* Pure black for camera backdrop */
}

.brow-panel {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.theme-dark .brow-panel {
    background: #000;
}

.brow-modal.open .brow-panel {
    transform: none;
}

/* Camera & AR Canvas Area */
.brow-stage {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.brow-camera-wrapper {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
}

video#brow-video {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Key for full-screen camera */
    transform: scaleX(-1); /* mirror */
}

canvas#brow-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* mirror canvas to match video */
    pointer-events: none;
    z-index: 5;
}

/* Close button - override default to place top right */
.brow-modal .scanner-close {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 1000;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    color: #fff;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.2);
}

/* UI Overlay / Guide */
.brow-face-guide {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    z-index: 10;
    transition: opacity 0.3s;
}

.brow-face-guide.hidden {
    opacity: 0;
}

.guide-oval {
    width: 220px;
    height: 300px;
    border: 2px dashed rgba(184, 163, 137, 0.8);
    border-radius: 50%;
    margin-bottom: var(--space-sm);
    box-shadow: 0 0 40px rgba(0,0,0,0.5) inset;
}

.brow-face-guide p {
    color: var(--color-white);
    background: rgba(0,0,0,0.7);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    backdrop-filter: blur(8px);
}

/* Loading Overlay */
.brow-loading-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--color-white);
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.brow-loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.loading-spinner {
    width: 32px; height: 32px;
    border: 3px solid rgba(184, 163, 137, 0.3);
    border-top-color: var(--color-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--space-sm);
}

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

/* Controls Wrapper (Floating Glass Window) */
.brow-controls-wrapper {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: rgba(20, 18, 16, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(184, 163, 137, 0.2);
    border-top-left-radius: var(--radius-xl);
    border-top-right-radius: var(--radius-xl);
    padding: var(--space-xl) var(--space-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    z-index: 50;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
    padding-bottom: env(safe-area-inset-bottom, 32px); /* For iOS home bar */
}

.brow-controls-wrapper h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #fff;
    margin-bottom: 8px;
}
.theme-dark .brow-controls-wrapper h3 {
    color: #fff;
}

.brow-style-buttons {
    display: flex;
    gap: var(--space-md);
    background: rgba(0, 0, 0, 0.5);
    padding: 6px;
    border-radius: 30px;
    border: 1px solid rgba(184, 163, 137, 0.2);
}

.btn-style {
    background: transparent;
    border: none;
    padding: 10px 24px;
    border-radius: 20px;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: rgba(255,255,255,0.7);
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.theme-dark .btn-style {
    color: rgba(255,255,255,0.7);
}

.btn-style.active {
    background: var(--color-gold);
    color: var(--color-bg);
    box-shadow: 0 4px 16px rgba(184, 163, 137, 0.3);
    font-weight: 500;
}
.theme-dark .btn-style.active {
    background: var(--color-gold);
}

/* Slider */
.brow-intensity-wrapper {
    width: 100%;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.brow-intensity-wrapper label {
    font-size: 0.85rem;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.8);
}

input[type=range]#brow-intensity {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(184, 163, 137, 0.3);
    border-radius: 2px;
    outline: none;
}
input[type=range]#brow-intensity::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.theme-dark input[type=range]#brow-intensity::-webkit-slider-thumb {
    background: var(--color-gold);
}
