/**
 * Flow AR - Multi-Select B2C Try-On AR Styles
 * ===========================================
 * Mobile-first responsive design
 */

:root {
    --primary: #10b981;
    --primary-dark: #059669;
    --primary-light: #d1fae5;
    --secondary: #3b82f6;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --danger: #ef4444;
    --warning: #f59e0b;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-100);
    -webkit-tap-highlight-color: transparent;
}

/* ==================== ACCESSIBILITY ==================== */

.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-900);
    color: white;
    padding: 1rem 2rem;
    z-index: 9999;
    border-radius: 0 0 0.5rem 0.5rem;
    text-decoration: none;
    font-weight: 600;
}

.skip-link:focus {
    top: 0;
}

/* ==================== SCREEN SYSTEM ==================== */

.screen {
    display: none;
    min-height: 100vh;
    flex-direction: column;
}

.screen.active {
    display: flex;
}

/* P2-08: Animated Transitions */
.screen.animate-in {
    animation: slideIn 0.35s ease-out;
}

.screen.animate-out {
    animation: slideOut 0.25s ease-in;
}

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

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-30px);
    }
}

/* Back navigation slides opposite direction */
.screen.animate-in-back {
    animation: slideInBack 0.35s ease-out;
}

@keyframes slideInBack {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.hidden {
    display: none !important;
}

/* ==================== STEP 1: WELCOME ==================== */

#step-welcome {
    background: linear-gradient(135deg, #064e3b 0%, #022c22 100%);
    color: white;
}

.welcome-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.welcome-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
}

.back-link {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 1.25rem;
    padding: 0.5rem;
}

.ar-badge {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.welcome-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.welcome-icon {
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.welcome-title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.welcome-subtitle {
    font-size: 1.1rem;
    opacity: 0.85;
    max-width: 320px;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.welcome-features {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    opacity: 0.9;
}

.feature-item i {
    width: 24px;
    text-align: center;
    color: var(--primary);
}

.btn-start {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 3rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
    transition: all 0.3s ease;
}

.btn-start:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(16, 185, 129, 0.5);
}

.welcome-hint {
    margin-top: 2rem;
    font-size: 0.85rem;
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ==================== FLOW HEADER ==================== */

.flow-header {
    background: white;
    padding: 0.875rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

.btn-back {
    background: none;
    border: none;
    color: var(--gray-600);
    font-size: 1.1rem;
    padding: 0.5rem;
    cursor: pointer;
}

.header-title {
    font-weight: 700;
    color: var(--gray-800);
}

.step-indicator {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ==================== P1-01: PROGRESS BAR VISUAL ==================== */

.progress-bar-container {
    padding: 1rem 1.25rem 0.75rem;
    background: white;
    border-bottom: 1px solid var(--gray-200);
}

.progress-bar {
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, #34d399 100%);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--gray-400);
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.3s;
}

.progress-step.active {
    color: var(--primary);
    font-weight: 600;
}

.progress-step.completed {
    color: var(--primary);
}

.progress-step.completed i {
    font-size: 0.65rem;
}

/* Legacy wizard (keeping for compatibility) */
.wizard-progress {
    display: none;
}

/* ==================== P1-02: MAX SELECTION HINT ==================== */

.selection-hint.max-reached {
    color: var(--primary);
    background: var(--primary-light);
    padding: 0.625rem 0.875rem;
    border-radius: 8px;
    margin-top: 0.5rem;
}

.selection-hint.max-reached i {
    color: var(--primary);
}

/* ==================== STEP 2: FRAME SELECTION ==================== */

.selection-content {
    flex: 1;
    padding: 1rem;
    padding-bottom: calc(140px + var(--safe-area-bottom));
    overflow-y: auto;
}

.selection-header {
    margin-bottom: 1rem;
}

.selection-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.selection-hint {
    font-size: 0.875rem;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
    position: relative;
    /* Fade hint for scroll */
    mask-image: linear-gradient(to right, black 90%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 90%, transparent 100%);
}

.filter-bar::-webkit-scrollbar {
    display: none;
}

.filter-bar.scrolled-end {
    mask-image: linear-gradient(to left, black 90%, transparent 100%);
    -webkit-mask-image: linear-gradient(to left, black 90%, transparent 100%);
}

.filter-bar.scrolled-middle {
    mask-image: linear-gradient(to right, transparent 0%, black 5%, black 90%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 90%, transparent 100%);
}

.filter-btn {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
}

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

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Frame Grid */
.frame-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (min-width: 576px) {
    .frame-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 992px) {
    .frame-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Frame Card */
.frame-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.frame-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.frame-card.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.frame-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.frame-card-image {
    position: relative;
    aspect-ratio: 4/3;
    background: var(--gray-100);
    overflow: hidden;
}

.frame-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.5rem;
}

/* AR Badge on Card */
.frame-ar-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Selection Checkbox */
.frame-checkbox {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    border: 2px solid var(--gray-300);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.frame-card.selected .frame-checkbox {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.frame-checkbox i {
    font-size: 0.7rem;
    opacity: 0;
}

.frame-card.selected .frame-checkbox i {
    opacity: 1;
}

.frame-card-body {
    padding: 0.75rem;
}

.frame-card-brand {
    font-size: 0.7rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.frame-card-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-top: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.frame-card-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 0.25rem;
}

/* Skeleton Cards */
.skeleton-card {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 12px;
    height: 180px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--gray-500);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Selection Bar (Fixed Bottom) */
.selection-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--gray-200);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    padding: 0.75rem 1rem;
    padding-bottom: calc(0.75rem + var(--safe-area-bottom));
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.selection-bar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.selected-frames-strip {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    flex: 1;
    padding: 0.25rem 0;
    -webkit-overflow-scrolling: touch;
}

.selected-frames-strip::-webkit-scrollbar {
    display: none;
}

.selected-frame-thumb {
    position: relative;
    flex-shrink: 0;
    width: 48px;
    height: 32px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid var(--primary);
}

.selected-frame-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--gray-100);
}

.selected-frame-thumb .remove-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 16px;
    height: 16px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 0.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.selection-bar-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.selection-count {
    font-size: 0.85rem;
    color: var(--gray-600);
}

.btn-clear-selection {
    background: none;
    border: none;
    color: var(--gray-500);
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-clear-selection:hover {
    color: var(--danger);
}

.btn-continue {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-continue:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
}

.btn-continue:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

/* ==================== STEP 3: TRY-ON AR ==================== */

#step-tryon {
    background: #0a0a0a;
    color: white;
}

.tryon-header {
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.tryon-header .btn-back {
    color: white;
}

.tryon-header .header-title {
    color: white;
}

.ar-status {
    color: var(--primary);
}

.ar-status.ready {
    color: var(--primary);
}

.ar-status.error {
    color: var(--danger);
}

/* AR Container */
.ar-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #000;
}

#ar-video {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

#ar-canvas {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

/* ==================== P2-07: FACE GUIDE ENHANCED ==================== */

.face-guide-enhanced {
    position: absolute;
    width: 220px;
    height: 300px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.guide-oval {
    width: 180px;
    height: 240px;
    border: 3px dashed rgba(255,255,255,0.4);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.face-guide-enhanced.detected .guide-oval {
    border-color: var(--primary);
    border-style: solid;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.face-guide-enhanced.poor .guide-oval {
    border-color: var(--warning);
}

.face-guide-enhanced.good .guide-oval {
    border-color: var(--primary);
    border-style: solid;
}

.face-guide-enhanced.excellent .guide-oval {
    border-color: var(--primary);
    border-style: solid;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.5);
}

/* Quality Indicator */
.guide-quality {
    position: absolute;
    bottom: -50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.quality-bar {
    width: 120px;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    overflow: hidden;
}

.quality-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--warning) 0%, var(--primary) 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.quality-text {
    font-size: 0.75rem;
    color: var(--gray-400);
    transition: color 0.3s;
}

.face-guide-enhanced.excellent .quality-text {
    color: var(--primary);
}

/* Tips */
.guide-tips {
    position: absolute;
    top: -40px;
    display: flex;
    justify-content: center;
}

.guide-tips .tip {
    display: none;
    align-items: center;
    gap: 6px;
    background: rgba(0,0,0,0.8);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: white;
    white-space: nowrap;
}

.guide-tips .tip.active {
    display: flex;
    animation: tipFadeIn 0.3s ease;
}

@keyframes tipFadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.guide-tips .tip i {
    font-size: 0.9rem;
}

.guide-tips .tip.success {
    background: var(--primary);
}

.guide-tips .tip.success i {
    color: white;
}

/* Legacy face-guide (hidden) */
.face-guide:not(.face-guide-enhanced) {
    display: none;
}

/* Current Frame Info */
.current-frame-info {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    padding: 8px 20px;
    border-radius: 20px;
    z-index: 5;
    font-size: 0.9rem;
    font-weight: 600;
}

/* AR Loading Overlay */
.ar-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.ar-loading-overlay.hidden {
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

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

.ar-loading-overlay p {
    color: var(--gray-400);
}

/* ==================== P0-01: PRE-PERMISSION OVERLAY ==================== */

.ar-prepermission-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.98) 0%, rgba(10,10,10,0.98) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 15;
    text-align: center;
    padding: 2rem;
}

.ar-prepermission-overlay.hidden {
    display: none;
}

.prepermission-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 0 15px rgba(16, 185, 129, 0); }
}

.prepermission-icon i {
    font-size: 2rem;
    color: white;
}

.ar-prepermission-overlay h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: white;
}

.ar-prepermission-overlay p {
    color: var(--gray-400);
    margin-bottom: 1.5rem;
    max-width: 280px;
}

.prepermission-privacy {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 0.75rem 1.25rem;
    border-radius: 30px;
    margin-bottom: 2rem;
    font-size: 0.875rem;
    color: var(--primary);
}

.prepermission-privacy i {
    font-size: 0.9rem;
}

.btn-activate-camera {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.125rem 2.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.btn-activate-camera:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(16, 185, 129, 0.5);
}

.btn-skip-ar {
    background: none;
    border: none;
    color: var(--gray-400);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    margin-bottom: 1.5rem;
    transition: color 0.2s;
}

.btn-skip-ar:hover {
    color: white;
}

.prepermission-help {
    color: var(--gray-500);
    font-size: 0.8rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.prepermission-help:hover {
    color: var(--gray-400);
}

/* ==================== P0-02: FALLBACK OVERLAY ==================== */

.ar-fallback-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.98) 0%, rgba(10,10,10,0.98) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 15;
    text-align: center;
    padding: 2rem;
}

.ar-fallback-overlay.hidden {
    display: none;
}

.fallback-icon {
    width: 80px;
    height: 80px;
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid rgba(239, 68, 68, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.fallback-icon i {
    font-size: 2rem;
    color: var(--danger);
}

.ar-fallback-overlay h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: white;
}

.ar-fallback-overlay > p {
    color: var(--gray-400);
    margin-bottom: 2rem;
}

.fallback-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    max-width: 320px;
}

.btn-fallback-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    color: white;
}

.btn-fallback-option:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--primary);
}

.btn-fallback-option i {
    font-size: 1.5rem;
    color: var(--primary);
    width: 32px;
    text-align: center;
}

.btn-fallback-option span {
    font-weight: 600;
    display: block;
}

.btn-fallback-option small {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 2px;
    font-weight: normal;
}

.btn-fallback-option.secondary {
    background: transparent;
    border-color: transparent;
    justify-content: center;
    margin-top: 0.5rem;
}

.btn-fallback-option.secondary i {
    font-size: 1rem;
    width: auto;
}

.btn-fallback-option.secondary:hover {
    background: rgba(255,255,255,0.05);
}

/* ==================== P0-03: EMPTY STATE WITH ACTIONS ==================== */

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--gray-500);
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.empty-state-icon i {
    font-size: 2rem;
    color: var(--gray-400);
}

.empty-state h3 {
    font-size: 1.25rem;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--gray-500);
    margin-bottom: 1.5rem;
}

.empty-state-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 280px;
    margin: 0 auto;
}

.btn-empty-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: 10px;
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-empty-action:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-empty-action.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn-empty-action.primary:hover {
    background: var(--primary-dark);
}

.btn-empty-action.secondary {
    background: transparent;
    border-color: var(--gray-300);
    color: var(--gray-500);
}

.btn-empty-action.secondary:hover {
    border-color: var(--gray-400);
    color: var(--gray-700);
}

.btn-empty-action i {
    font-size: 1rem;
}

/* ==================== P0-04: CONTACT METHOD TOGGLE ==================== */

.contact-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.toggle-option {
    flex: 1;
    position: relative;
}

.toggle-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem;
    background: var(--gray-100);
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    color: var(--gray-600);
}

.toggle-label i {
    font-size: 1.1rem;
}

.toggle-option input:checked + .toggle-label {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.toggle-option input:focus + .toggle-label {
    box-shadow: 0 0 0 3px var(--primary-light);
}

.contact-field.hidden {
    display: none;
}

/* Form field errors */
.field-error {
    display: block;
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 0.375rem;
}

.field-error.hidden {
    display: none;
}

.form-group input.error,
.form-group select.error {
    border-color: var(--danger);
}

.form-group input.error:focus,
.form-group select.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Valid state with checkmark */
.form-group input.valid,
.form-group select.valid {
    border-color: var(--primary);
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2310b981'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
}

.form-group input.valid:focus,
.form-group select.valid:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* Legacy permission overlay (keeping for compatibility) */
.ar-permission-overlay {
    display: none;
}

/* ==================== CAMERA HELP MODAL ==================== */

.camera-help-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1rem;
}

.camera-help-modal.hidden {
    display: none;
}

.camera-help-modal .modal-content {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 360px;
    width: 100%;
    position: relative;
    color: var(--gray-800);
}

.camera-help-modal .modal-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-400);
}

.camera-help-modal h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--gray-800);
}

.camera-help-modal ol {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
}

.camera-help-modal li {
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.camera-help-modal .modal-tip {
    background: var(--primary-light);
    padding: 0.875rem;
    border-radius: 10px;
    font-size: 0.875rem;
    color: var(--primary-dark);
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.camera-help-modal .modal-tip i {
    flex-shrink: 0;
    margin-top: 2px;
}

/* Frame Carousel */
.frame-carousel {
    background: rgba(0,0,0,0.9);
    padding: 0.75rem 1rem;
    padding-bottom: calc(70px + var(--safe-area-bottom));
    border-top: 1px solid rgba(255,255,255,0.1);
}

.carousel-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.carousel-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.carousel-position {
    background: rgba(255,255,255,0.15);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 600;
    color: var(--gray-300);
}

.carousel-track {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
    /* Fade hint for more items */
    mask-image: linear-gradient(to right, black 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

.carousel-item {
    flex-shrink: 0;
    width: 80px;
    padding: 6px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    text-align: center;
}

.carousel-item:hover {
    background: rgba(255,255,255,0.1);
}

.carousel-item.active {
    border-color: var(--primary);
    background: rgba(16, 185, 129, 0.1);
}

.carousel-item img {
    width: 68px;
    height: 34px;
    object-fit: contain;
    background: rgba(255,255,255,0.9);
    border-radius: 6px;
}

.carousel-item .item-name {
    font-size: 0.65rem;
    color: var(--gray-400);
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Try-On Actions */
.tryon-actions {
    position: absolute;
    bottom: 180px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* P2-06: Capture Button */
.btn-capture {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.5);
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(5px);
}

.btn-capture:hover {
    background: rgba(255,255,255,0.25);
    transform: scale(1.1);
}

.btn-capture:active {
    transform: scale(0.95);
}

.btn-capture.flash {
    animation: cameraFlash 0.3s ease;
}

@keyframes cameraFlash {
    0% { background: white; }
    100% { background: rgba(255,255,255,0.15); }
}

.btn-favorite {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
    transition: all 0.2s;
}

.btn-favorite:hover {
    transform: scale(1.05);
}

.btn-favorite i {
    font-size: 1.1rem;
}

.btn-favorite.active {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
    box-shadow: 0 4px 20px rgba(244, 63, 94, 0.4);
}

.btn-favorite.active i {
    animation: heartPop 0.3s ease;
}

@keyframes heartPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* ==================== TRYON CONTINUE BAR ==================== */

.tryon-continue-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.875rem 1rem;
    padding-bottom: calc(0.875rem + var(--safe-area-bottom));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    z-index: 100;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.continue-bar-info {
    flex: 1;
    min-width: 0;
}

.favorite-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #f43f5e;
    font-size: 0.9rem;
    font-weight: 600;
}

.favorite-indicator i {
    font-size: 1rem;
    animation: heartBeat 1.5s infinite;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.1); }
}

.favorite-indicator span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.no-favorite-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-400);
    font-size: 0.85rem;
}

.no-favorite-hint i {
    color: var(--gray-500);
}

.btn-continue-tryon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-continue-tryon:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.btn-continue-tryon i {
    font-size: 0.9rem;
}

/* ==================== P2-06: PHOTO PREVIEW MODAL ==================== */

.photo-preview-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.photo-preview-modal.hidden {
    display: none;
}

.photo-preview-content {
    background: var(--gray-900);
    border-radius: 20px;
    padding: 1rem;
    max-width: 400px;
    width: 100%;
    position: relative;
}

.preview-close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--gray-400);
    font-size: 1.75rem;
    cursor: pointer;
    z-index: 10;
}

.preview-close:hover {
    color: white;
}

#captured-photo {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 0.75rem;
}

.preview-frame-name {
    text-align: center;
    color: white;
    font-weight: 600;
    margin-bottom: 1rem;
}

.preview-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-preview-action {
    flex: 1;
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-preview-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-preview-action.secondary {
    background: rgba(255,255,255,0.1);
    flex: 0 0 auto;
}

.btn-preview-action.secondary:hover {
    background: rgba(255,255,255,0.2);
    box-shadow: none;
}

.btn-preview-action i {
    font-size: 1rem;
}

/* ==================== STEP 4: APPOINTMENT ==================== */

#step-appointment {
    background: var(--gray-100);
}

.appointment-content {
    flex: 1;
    padding: 1rem;
    padding-bottom: calc(2rem + var(--safe-area-bottom));
    overflow-y: auto;
}

/* Favorite Banner */
.favorite-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    border-radius: 12px;
    padding: 0.875rem;
    margin-bottom: 1.5rem;
    border: 2px solid var(--primary-light);
    position: relative;
}

.favorite-banner img {
    width: 70px;
    height: 45px;
    object-fit: contain;
    background: var(--gray-100);
    border-radius: 8px;
}

.favorite-info {
    flex: 1;
}

.favorite-label {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.favorite-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
}

.favorite-heart {
    color: var(--primary);
    font-size: 1.25rem;
}

/* Appointment Form */
.appointment-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-section {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.form-section h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section h3 i {
    color: var(--primary);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.375rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 10px;
    font-size: 1rem;
    color: var(--gray-800);
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--gray-400);
}

.btn-submit {
    width: 100%;
    padding: 1.125rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-submit:disabled {
    background: var(--gray-300);
    box-shadow: none;
    cursor: not-allowed;
}

/* ==================== P1-05: TIME SLOTS VISUAL GRID ==================== */

.time-slots-container {
    min-height: 80px;
}

.time-slots-placeholder,
.time-slots-loading,
.time-slots-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem;
    color: var(--gray-500);
    font-size: 0.9rem;
    text-align: center;
}

.time-slots-placeholder i,
.time-slots-loading i,
.time-slots-empty i {
    font-size: 1.25rem;
    color: var(--gray-400);
}

.time-slots-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

@media (max-width: 400px) {
    .time-slots-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.time-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.5rem;
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.2s;
}

.time-slot:hover:not(.unavailable):not(.selected) {
    border-color: var(--primary);
    color: var(--primary);
}

.time-slot.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    animation: slotSelected 0.3s ease;
    position: relative;
}

.time-slot.selected::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    background: white;
    color: var(--primary);
    border-radius: 50%;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

@keyframes slotSelected {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

.time-slot.unavailable {
    background: var(--gray-100);
    border-color: var(--gray-200);
    color: var(--gray-400);
    cursor: not-allowed;
    text-decoration: line-through;
}

.time-slot.popular {
    position: relative;
}

.time-slot.popular::after {
    content: 'Popular';
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--warning);
    color: white;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 700;
}

/* ==================== STEP 5: CONFIRMATION ==================== */

#step-confirmation {
    background: linear-gradient(135deg, #064e3b 0%, #022c22 100%);
    color: white;
}

.confirmation-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.confirmation-icon {
    font-size: 5rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    animation: successPop 0.5s ease-out;
}

@keyframes successPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.confirmation-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.confirmation-subtitle {
    font-size: 1.1rem;
    opacity: 0.85;
    margin-bottom: 2rem;
}

/* Confirmation Card */
.confirmation-card {
    background: rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 1.5rem;
    width: 100%;
    max-width: 320px;
    margin-bottom: 1.5rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-label {
    opacity: 0.7;
}

.summary-value {
    font-weight: 600;
}

/* P1-06: Location Row with Map Link */
.location-row .summary-value {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    text-align: right;
}

.map-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--secondary);
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.2s;
}

.map-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

.map-link i {
    font-size: 0.9rem;
}

/* P1-07: Calendar Buttons (Google + ICS) */
.calendar-buttons {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-calendar {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: white;
    color: var(--gray-800);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-calendar:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.btn-calendar.google i {
    color: #4285f4;
    font-size: 1.1rem;
}

.btn-calendar.ics {
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
}

.btn-calendar.ics:hover {
    background: rgba(255,255,255,0.25);
}

.btn-calendar.ics i {
    color: var(--primary);
}

/* Confirmation Actions */
.confirmation-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.btn-restart {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-restart:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-home {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: rgba(255,255,255,0.1);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-home:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}

.btn-share {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: rgba(255,255,255,0.1);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-share:hover {
    background: rgba(255,255,255,0.2);
}

/* ==================== TOAST NOTIFICATION ==================== */

.toast-notification {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--gray-800);
    color: white;
    padding: 0.875rem 1.5rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.toast-notification.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

.toast-notification i {
    color: var(--primary);
}

/* ==================== RESUME SESSION MODAL ==================== */

.resume-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

.resume-modal.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.resume-modal-content {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    max-width: 340px;
    width: 100%;
    text-align: center;
    animation: slideUp 0.3s ease;
}

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

.resume-modal-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-light) 0%, #a7f3d0 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}

.resume-modal-icon i {
    font-size: 1.75rem;
    color: var(--primary-dark);
}

.resume-modal-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.resume-modal-content p {
    color: var(--gray-500);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.resume-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-resume-continue {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    transition: all 0.2s;
}

.btn-resume-continue:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-resume-restart {
    padding: 0.875rem;
    background: transparent;
    color: var(--gray-500);
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-resume-restart:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

/* ==================== RESPONSIVE ==================== */

@media (min-width: 768px) {
    .welcome-title {
        font-size: 2.5rem;
    }

    .welcome-subtitle {
        font-size: 1.25rem;
        max-width: 400px;
    }

    .selection-content {
        max-width: 900px;
        margin: 0 auto;
    }

    .appointment-content {
        max-width: 600px;
        margin: 0 auto;
    }
}

/* ==================== CALIBRATION PANEL ==================== */

.btn-calibrate {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--gray-800);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-calibrate:hover {
    background: var(--gray-700);
    transform: scale(1.05);
}

.btn-calibrate i {
    font-size: 1rem;
}

.calibration-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--gray-900);
    color: white;
    padding: 1rem;
    padding-bottom: calc(1rem + var(--safe-area-bottom));
    border-radius: 1.5rem 1.5rem 0 0;
    z-index: 100;
    transform: translateY(0);
    transition: transform 0.3s ease;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}

.calibration-panel.hidden {
    transform: translateY(100%);
    pointer-events: none;
}

.calibration-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.calibration-title {
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-close-calibration {
    background: var(--gray-700);
    border: none;
    color: white;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calibration-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--gray-800);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.calibration-status .status-icon {
    font-size: 1.1rem;
}

.calibration-status.server .status-icon::before { content: "🧠"; }
.calibration-status.hybrid .status-icon::before { content: "🔮"; }
.calibration-status.auto .status-icon::before { content: "⚡"; }
.calibration-status.manual .status-icon::before { content: "✋"; }

.calibration-sliders {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.slider-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.slider-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--gray-300);
}

.slider-group label i {
    color: var(--primary);
    width: 1rem;
}

.slider-value {
    margin-left: auto;
    font-weight: 600;
    color: white;
    min-width: 3rem;
    text-align: right;
}

.slider-group input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--gray-700);
    border-radius: 3px;
    outline: none;
}

.slider-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.slider-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.calibration-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.btn-reset-calibration {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--gray-600);
    background: transparent;
    color: var(--gray-300);
    border-radius: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-reset-calibration:hover {
    background: var(--gray-800);
    border-color: var(--gray-500);
}

.btn-confirm-calibration {
    flex: 2;
    padding: 0.75rem;
    border: none;
    background: var(--primary);
    color: white;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-confirm-calibration:hover {
    background: var(--primary-dark);
}

.calibration-hint {
    text-align: center;
    font-size: 0.75rem;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.calibration-hint i {
    color: var(--primary);
}

/* ==================== AR CALIBRATION PANEL ==================== */

/* Quick Actions (Normal Mode) */
.ar-quick-actions {
    position: absolute;
    bottom: 140px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 15;
}

.ar-quick-actions.hidden {
    display: none;
}

.btn-ar-quick {
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}

.btn-ar-quick.adjust {
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
}

.btn-ar-quick.adjust:hover {
    background: rgba(255,255,255,0.25);
}

.btn-ar-quick.perfect {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-ar-quick.perfect:hover {
    transform: scale(1.05);
}

/* Calibration Source Indicator */
.calibration-indicator {
    position: absolute;
    top: 60px;
    left: 12px;
    z-index: 15;
}

.calib-badge {
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.calib-badge.server {
    background: rgba(139, 92, 246, 0.9);
}

.calib-badge.hybrid {
    background: rgba(245, 158, 11, 0.9);
}

.calib-badge.manual {
    background: rgba(239, 68, 68, 0.9);
}

/* Calibration Panel */
.calibration-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    background: rgba(0,0,0,0.92);
    padding: 15px;
    z-index: 20;
    border-left: 1px solid rgba(255,255,255,0.1);
    box-shadow: -5px 0 20px rgba(0,0,0,0.3);
    overflow-y: auto;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.calibration-panel.hidden {
    display: none;
}

.calib-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 12px;
}

.calib-panel-title {
    font-size: 1rem;
    font-weight: 600;
    color: white;
}

.calib-panel-close {
    background: none;
    border: none;
    color: var(--gray-400);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.calib-panel-close:hover {
    color: white;
}

/* Auto-regulation toggle */
.calib-auto-toggle {
    background: rgba(16,185,129,0.1);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 12px;
}

.calib-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: white;
}

.calib-toggle-label input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.auto-status {
    font-size: 0.7rem;
    color: var(--primary);
    margin-left: auto;
    font-weight: 600;
}

.calib-toggle-hint {
    font-size: 0.65rem;
    color: var(--gray-500);
    margin-top: 4px;
    padding-left: 26px;
}

/* Mode indicator */
.calib-mode-indicator {
    text-align: center;
    padding: 6px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 0.75rem;
    background: rgba(16,185,129,0.2);
    color: var(--primary);
}

.calib-mode-indicator.manual {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Slider sections */
.calib-section {
    margin-bottom: 15px;
}

.calib-section-title {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calib-slider-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.calib-slider-row.compact {
    margin-bottom: 6px;
}

.calib-icon {
    font-size: 1rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.calib-slider-content {
    flex: 1;
    min-width: 0;
}

.calib-slider-content label {
    display: block;
    font-size: 0.7rem;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.calib-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    background: #333;
    border-radius: 3px;
    outline: none;
}

.calib-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.calib-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.calib-value {
    font-size: 0.7rem;
    color: var(--gray-400);
    min-width: 30px;
    text-align: right;
}

/* Temple groups */
.calib-temple-group {
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 8px;
}

.calib-temple-group.left {
    border-left: 3px solid #ff5722;
}

.calib-temple-group.right {
    border-left: 3px solid #4caf50;
}

.calib-temple-label {
    font-size: 0.7rem;
    color: var(--gray-400);
    margin-bottom: 6px;
}

/* Action buttons */
.calib-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
}

.btn-calib {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-calib.cancel {
    background: #333;
    color: var(--gray-400);
}

.btn-calib.cancel:hover {
    background: #444;
}

.btn-calib.confirm {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-calib.confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* Contribution counter */
.calib-contribution {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--gray-500);
}

.contrib-icon {
    color: var(--primary);
}

#contrib-count {
    color: var(--primary);
    font-weight: 600;
}

/* Success Overlay */
.calib-success-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(16, 185, 129, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 25;
    animation: fadeIn 0.3s ease-out;
}

.calib-success-overlay.hidden {
    display: none;
}

.success-checkmark {
    font-size: 5rem;
    color: var(--primary);
    animation: successPop 0.5s ease-out;
}

.success-text {
    font-size: 1.2rem;
    color: white;
    margin-top: 10px;
    font-weight: 600;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes successPop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .calibration-panel {
        width: 100%;
        max-width: 100%;
        border-left: none;
        border-top: 1px solid rgba(255,255,255,0.1);
    }

    .ar-quick-actions {
        bottom: 160px;
        flex-direction: column;
        align-items: center;
    }

    .btn-ar-quick {
        width: 180px;
        justify-content: center;
    }
}
