/* ========================================
   CSS VARIABLES & RESET
   ======================================== */

:root {
    /* Colors */
    --bg-primary: #050505;
    --bg-secondary: #0a0a0a;
    --bg-card: #121212;
    --bg-card-hover: #1a1a1a;
    --accent-primary: #00d4ff;
    --accent-glow: rgba(0, 212, 255, 0.3);
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #606060;
    --border-primary: #2a2a2a;
    --border-accent: var(--accent-primary);
    --error-color: #ff4444;
    
    /* Spacing (Fibonacci-ish) */
    --space-xs: 8px;
    --space-sm: 13px;
    --space-md: 21px;
    --space-lg: 34px;
    --space-xl: 55px;
    
    /* Typography (Fibonacci-ish scale) */
    --text-xs: 13px;
    --text-sm: 16.5px;
    --text-base: 21px;
    --text-lg: 26.5px;
    --text-xl: 34px;
    --text-2xl: 42px;
    --text-3xl: 55px;
    
    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 200ms ease;
    --transition-base: 300ms ease;
    
    /* Layout */
    --max-width: 1800px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Bricolage Grotesque', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: var(--text-sm);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========================================
   SPLASH SCREEN
   ======================================== */

.splash {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: splashFadeOut 500ms ease 2500ms forwards;
}

.splash-content {
    text-align: center;
    animation: splashIn 1000ms ease forwards;
}

.splash-logo {
    font-size: var(--text-3xl);
    font-weight: 800;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-sm);
    background: linear-gradient(135deg, var(--text-primary), var(--accent-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.splash-subtitle {
    font-size: var(--text-lg);
    font-weight: 300;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
}

.splash-box {
    position: absolute;
    inset: 0;
    border: 2px solid var(--accent-primary);
    opacity: 0;
    animation: splashBoxGrow 1200ms ease 200ms forwards;
    margin: var(--space-xl);
}

@keyframes splashIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes splashBoxGrow {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 0.3;
        transform: scale(1);
    }
}

@keyframes splashFadeOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

/* ========================================
   MAIN LAYOUT
   ======================================== */

.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: var(--max-width);
    width: 100%;
    margin: 0 auto;
    padding: var(--space-sm);
}

.header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.logo {
    font-size: var(--text-sm);
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-xs);
}

.step-title {
    font-size: var(--text-sm);
    font-weight: 300;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.content-area {
    flex: 1;
    /* margin-bottom: var(--space-xl); */
}

/* ========================================
   SELECTED STRIP
   ======================================== */

.selected-strip {
    padding: var(--space-md) 0;
    margin-bottom: var(--space-lg);
    border-top: 1px dashed var(--border-primary);
    border-bottom: 1px dashed var(--border-primary);
}

.selected-strip-title {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-sm);
    text-align: center;
}

.selected-items {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    justify-content: center;
}

.selected-item {
    background: var(--bg-card);
    /* border: 1px solid var(--border-primary);
     */
     border: 2px solid var(--border-accent);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--text-xs);
}

.selected-item-icon {
    width: 32px;
    height: 32px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
}

/* ========================================
   BUTTONS
   ======================================== */

.button {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: var(--text-sm);
    font-weight: 500;
    padding: var(--space-sm) var(--space-lg);
    border: 2px solid var(--border-accent);
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-base);
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
    overflow: hidden;
}

.button:hover:not(:disabled) {
    background: var(--accent-primary);
    color: var(--bg-primary);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: translateY(-2px);
}

.button:active:not(:disabled) {
    transform: translateY(0);
}

.button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: var(--border-primary);
}

.button:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 4px;
}

.button-secondary {
    border-color: var(--border-primary);
}

.button-secondary:hover:not(:disabled) {
    border-color: var(--accent-primary);
    background: transparent;
    color: var(--accent-primary);
}

/* ========================================
   NAVIGATION
   ======================================== */

.navigation {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    align-items: center;
    padding: var(--space-lg) 0;
    border-top: 1px solid var(--border-primary);
}

.stepper {
    display: flex;
    gap: var(--space-md);
    align-items: center;
}

.step-circle {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    border: 2px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-muted);
    transition: all var(--transition-base);
    position: relative;
}

.step-circle.active {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    box-shadow: 0 0 15px var(--accent-glow);
}

.step-circle.completed {
    border-color: var(--accent-primary);
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.step-label {
    position: absolute;
    bottom: -24px;
    font-size: 11px;
    white-space: nowrap;
    color: var(--text-muted);
    font-weight: 400;
}

.step-circle.active .step-label {
    color: var(--accent-primary);
}

.nav-buttons {
    display: flex;
    gap: var(--space-md);
}

/* ========================================
   CARDS & GRIDS
   ======================================== */

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

.card {
    background: var(--bg-card);
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.card:hover {
    border-color: var(--accent-primary);
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.card.selected {
    border-color: var(--accent-primary);
    background: var(--bg-card-hover);
    box-shadow: 0 0 20px var(--accent-glow);
}

.card.selected::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--accent-primary);
}

.card:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 4px;
}

.card-image {
    width: 100%;
    aspect-ratio: 0.7;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-sm);
    overflow: hidden;
    position: relative;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-image i {
    font-size: var(--text-2xl);
    color: var(--text-muted);
}

.card-label {
    font-size: var(--text-sm);
    font-weight: 600;
    text-align: center;
    color: var(--text-primary);
}

.card-description {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    text-align: center;
    margin-top: var(--space-xs);
}

/* Square aspect ratio for scene cards */
.scene-card-image {
    aspect-ratio: 1 !important;
}

/* Pose cards with circular text design */
.pose-card {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pose-circle {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    border: 3px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-md);
    transition: all var(--transition-base);
}

.pose-card:hover .pose-circle {
    border-color: var(--accent-primary);
    background: var(--bg-card-hover);
}

.pose-card.selected .pose-circle {
    border-color: var(--accent-primary);
    background: var(--accent-primary);
}

.pose-number {
    font-size: var(--text-3xl);
    font-weight: 800;
    color: var(--text-primary);
}

.pose-card.selected .pose-number {
    color: var(--bg-primary);
}

/* ========================================
   STEP 1: MODEL SELECTION
   ======================================== */

.model-layout {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: var(--space-xl);
}

.model-section {
    display: flex;
    flex-direction: column;
}

.section-title {
    font-size: var(--text-base);
    font-weight: 600;
    margin-bottom: var(--space-md);
    letter-spacing: 0.05em;
}

.self-card {
    aspect-ratio: 1;
    border: 3px dashed var(--border-primary);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
    background: var(--bg-card);
    position: relative;
    overflow: hidden;
}

.self-card:hover {
    border-color: var(--accent-primary);
    background: var(--bg-card-hover);
}

.self-card.selected {
    border-style: solid;
    border-color: var(--accent-primary);
    box-shadow: 0 0 30px var(--accent-glow);
}

.self-card-icon {
    font-size: var(--text-3xl);
    color: var(--accent-primary);
    margin-bottom: var(--space-sm);
}

.self-card-label {
    font-size: var(--text-base);
    font-weight: 600;
}

.self-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
}

.gender-selector {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    justify-content: center;
}

.gender-pill {
    padding: var(--space-xs) var(--space-md);
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.gender-pill:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.gender-pill.active {
    border-color: var(--accent-primary);
    background: var(--accent-primary);
    color: var(--bg-primary);
}

/* ========================================
   WEBCAM MODAL
   ======================================== */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--space-lg);
    animation: fadeIn 300ms ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-card);
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    max-width: 600px;
    width: 100%;
    position: relative;
}

.modal-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: var(--text-lg);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--accent-primary);
}

.modal-title {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: var(--space-md);
}

.webcam-container {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--space-md);
}

.webcam-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.countdown-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 120px;
    font-weight: 800;
    color: var(--accent-primary);
    animation: countdownPulse 1s ease infinite;
}

@keyframes countdownPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.modal-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
}

/* ========================================
   STEP 2: COVER FLOW CAROUSEL
   ======================================== */

.breadcrumb {
    display: flex;
    gap: var(--space-xs);
    align-items: center;
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
    justify-content: center;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.breadcrumb-link {
    color: var(--text-secondary);
    cursor: pointer;
    transition: color var(--transition-fast);
    text-decoration: none;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
}

.breadcrumb-link:hover {
    color: var(--accent-primary);
    background: var(--bg-card);
}

.breadcrumb-link.active {
    color: var(--accent-primary);
    font-weight: 600;
}

.breadcrumb-separator {
    color: var(--border-primary);
}

/* Coverflow Wrapper */
.coverflow-wrapper {
    width: 100%;
    /* margin: var(--space-xl) 0; */
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-lg);
    /* min-height: 800px; */
    position: relative;
}

.carousel-arrow {
    width: 60px;
    height: 60px;
    border: 2px solid var(--border-accent);
    background: var(--bg-card);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
    color: var(--text-primary);
    font-size: var(--text-lg);
    z-index: 100;
    flex-shrink: 0;
}

.carousel-arrow:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: scale(1.1);
}

.carousel-arrow:active {
    transform: scale(0.95);
}

.carousel-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.carousel-arrow:disabled:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    transform: scale(1);
    box-shadow: none;
}

.coverflow {
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    height: 800px;
}

.coverflow img {
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.4s ease;
    width: 400px;
    height: auto;
    max-height: 500px;
    object-fit: cover;
}

.coverflow img:hover {
    border: 3px solid var(--accent-primary);
    box-shadow: 0 0 30px var(--accent-glow);
}

/* Text items for categories/brands */
.coverflow-text-item, .coverflow-pose-item {
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    aspect-ratio: 1;
    width: 400px !important;
    height: 400px !important;
}

.coverflow-text-item:hover {
    border-color: var(--accent-primary) !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

/* Override coverflow.js title box styling */
.coverflow-title-box {
    display: none !important;
    /* background: rgba(212, 175, 55, 0.2) !important; */
    color: var(--accent-primary) !important;
    border: 1px solid var(--accent-primary) !important;
    backdrop-filter: blur(10px);
    font-family: 'Bricolage Grotesque', sans-serif !important;
    font-weight: 600 !important;
    letter-spacing: 1px !important;
}

.carousel-container {
    position: relative;
    height: 500px;
    margin: var(--space-xl) 0;
    perspective: 1200px;
}

.carousel {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-item {
    position: absolute;
    width: 300px;
    transition: all 600ms cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.carousel-item.center {
    transform: translateX(0) scale(1.2) translateZ(0);
    z-index: 10;
    opacity: 1;
}

.carousel-item.left-1 {
    transform: translateX(-350px) scale(0.85) rotateY(25deg) translateZ(-100px);
    z-index: 5;
    opacity: 0.7;
}

.carousel-item.left-2 {
    transform: translateX(-550px) scale(0.7) rotateY(35deg) translateZ(-200px);
    z-index: 3;
    opacity: 0.4;
}

.carousel-item.right-1 {
    transform: translateX(350px) scale(0.85) rotateY(-25deg) translateZ(-100px);
    z-index: 5;
    opacity: 0.7;
}

.carousel-item.right-2 {
    transform: translateX(550px) scale(0.7) rotateY(-35deg) translateZ(-200px);
    z-index: 3;
    opacity: 0.4;
}

.carousel-item.hidden {
    opacity: 0;
    pointer-events: none;
}

.carousel-card {
    background: var(--bg-card);
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
}

.carousel-item.center .carousel-card {
    border-color: var(--accent-primary);
    box-shadow: 0 0 40px var(--accent-glow);
}

.carousel-card-image {
    width: 100%;
    aspect-ratio: 1;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.carousel-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-card-image i {
    font-size: var(--text-2xl);
    color: var(--text-muted);
}

.carousel-card-content {
    padding: var(--space-md);
    text-align: center;
}

.carousel-card-title {
    font-size: var(--text-base);
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.carousel-card-subtitle {
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.carousel-controls {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    transform: translateY(-50%);
    padding: 0 var(--space-md);
    z-index: 20;
}

.carousel-arrow {
    width: 50px;
    height: 50px;
    border: 2px solid var(--border-accent);
    background: var(--bg-card);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
    pointer-events: all;
    color: var(--text-primary);
    font-size: var(--text-base);
}

.carousel-arrow:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: scale(1.1);
}

.carousel-arrow:active {
    transform: scale(0.95);
}

.carousel-info {
    text-align: center;
    /* margin-top: var(--space-lg); */
}

.carousel-name {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.carousel-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    margin-bottom: var(--space-md);
}

/* ========================================
   ERROR TOAST
   ======================================== */

.toast {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    background: var(--error-color);
    color: var(--text-primary);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 2000;
    animation: toastSlideIn 300ms ease;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ========================================
   TRANSITION STAGE
   ======================================== */

.transition-stage {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 500ms ease;
}

.transition-logo {
    font-size: var(--text-2xl);
    font-weight: 800;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-xl);
}

.progress-container {
    margin-bottom: var(--space-lg);
}

.progress-dots {
    display: flex;
    gap: var(--space-sm);
}

.progress-dot {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    background: var(--accent-primary);
    animation: dotPulse 1.5s ease infinite;
}

.progress-dot:nth-child(2) {
    animation-delay: 0.3s;
}

.progress-dot:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes dotPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }
}

.transition-message {
    font-size: var(--text-base);
    color: var(--text-secondary);
    font-weight: 300;
    animation: messageRotate 8s ease infinite;
}

/* ========================================
   RESULT VIEW
   ======================================== */

.result-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
}

.result-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.result-title {
    font-size: var(--text-xl);
    font-weight: 800;
    letter-spacing: 0.08em;
}

.result-tabs {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    border-bottom: 2px solid var(--border-primary);
    width: 100%;
}

.result-tab {
    flex: 1;
    padding: var(--space-md) var(--space-lg);
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-size: var(--text-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    bottom: -2px;
}

.result-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}

.result-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
    background: rgba(0, 212, 255, 0.05);
}

.result-tab i {
    margin-right: var(--space-xs);
}

.result-tab-content {
    width: 100%;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.video-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 9/16;
    background: var(--bg-secondary);
    border: 3px solid var(--accent-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-lg);
    box-shadow: 0 0 40px var(--accent-glow);
}

.result-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
}

.video-overlay:hover {
    background: rgba(0, 0, 0, 0.3);
}

.video-overlay:hover .play-icon {
    transform: scale(1.2);
}

.play-icon {
    font-size: 80px;
    color: var(--accent-primary);
    transition: all var(--transition-base);
    filter: drop-shadow(0 0 20px var(--accent-glow));
}

.result-actions {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
    justify-content: center;
}

.result-actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.transform-id {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin-top: var(--space-xs);
    font-family: monospace;
}

.loading-video {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    color: var(--accent-primary);
}

.loading-video i {
    font-size: 48px;
    animation: spin 1s linear infinite;
}

.loading-video p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.transformed-preview {
    width: 100%;
    margin-bottom: var(--space-lg);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.transformed-preview img {
    width: 100%;
    max-width: 100%;
    border-radius: var(--radius-lg);
    border: 3px solid var(--accent-primary);
    box-shadow: 0 0 40px var(--accent-glow);
}

/* AR Mode Styles */
.coverflow-ar-wrapper {
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.coverflow-ar-wrapper:hover {
    border-color: var(--accent-primary) !important;
}

a-scene {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-lg);
}

.video-frame a-scene {
    position: absolute;
    top: 0;
    left: 0;
}

.error-toast {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ========================================
   SETTINGS BUTTON & MODAL
   ======================================== */

.settings-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    background: rgba(18, 18, 18, 0.95);
    border: 2px solid var(--accent-primary);
    color: var(--accent-primary);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: all var(--transition-base);
    backdrop-filter: blur(10px);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
}

.settings-btn:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    transform: rotate(90deg);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
}

.settings-btn.needs-attention {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 68, 68, 0.5);
        border-color: #ff4444;
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 68, 68, 0.8);
        border-color: #ff6666;
    }
}

.settings-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.settings-modal {
    background: var(--bg-card);
    border: 2px solid var(--border-accent);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    box-shadow: 0 0 60px var(--accent-glow);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.settings-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-header h2 {
    font-size: var(--text-lg);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.settings-header h2 i {
    color: var(--accent-primary);
}

.settings-body {
    padding: var(--space-lg);
}

.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-sm);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-weight: 600;
}

.form-group label i {
    color: var(--accent-primary);
    margin-right: var(--space-xs);
}

.form-group input {
    width: 100%;
    padding: var(--space-md);
    background: var(--bg-secondary);
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--text-sm);
    font-family: inherit;
    transition: all var(--transition-base);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px var(--accent-glow);
}

.form-group small {
    display: block;
    margin-top: var(--space-xs);
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.form-group small a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: opacity var(--transition-fast);
}

.form-group small a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.settings-actions {
    padding: var(--space-lg);
    border-top: 1px solid var(--border-primary);
    display: flex;
    justify-content: flex-end;
}

.success-toast {
    position: fixed;
    top: 90px;
    right: 20px;
    background: #00ff88;
    color: #050505;
    padding: 15px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    z-index: 10002;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 255, 136, 0.3);
}

.success-toast i {
    font-size: 20px;
}

/* ========================================
   TRANSFORM LOADING OVERLAY
   ======================================== */

.transform-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 5, 0.98);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10003;
    animation: fadeIn 0.3s ease;
}

.transform-loading-content {
    text-align: center;
    max-width: 500px;
    padding: var(--space-xl);
}

.loading-spinner {
    position: relative;
    width: 400px;
    height: 400px;
    margin: 0 auto var(--space-lg);
    transform-style: preserve-3d;
    perspective: 10000px;
    animation: girar 8s linear infinite;
}

@keyframes girar {
    0% { transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
    100% { transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg); }
}

.loading-sphere {
    position: absolute;
    top: 0;
    left: 0;
    width: 400px;
    height: 400px;
    transform-style: preserve-3d;
    perspective: 10000px;
}

.loading-sphere.sphere1 { transform: rotate(0deg); }
.loading-sphere.sphere2 { transform: rotate(20deg); }
.loading-sphere.sphere3 { transform: rotate(40deg); }
.loading-sphere.sphere4 { transform: rotate(60deg); }
.loading-sphere.sphere5 { transform: rotate(80deg); }
.loading-sphere.sphere6 { transform: rotate(100deg); }
.loading-sphere.sphere7 { transform: rotate(120deg); }
.loading-sphere.sphere8 { transform: rotate(140deg); }
.loading-sphere.sphere9 { transform: rotate(160deg); }

.loading-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    border: 2px solid;
    transform-style: preserve-3d;
    perspective: 10000px;
}

.loading-sphere.sphere1 .loading-item { border-color: rgba(255, 0, 0, 0.5); }
.loading-sphere.sphere2 .loading-item { border-color: rgba(255, 255, 0, 0.5); }
.loading-sphere.sphere3 .loading-item { border-color: rgba(255, 128, 0, 0.5); }
.loading-sphere.sphere4 .loading-item { border-color: rgba(0, 255, 0, 0.5); }
.loading-sphere.sphere5 .loading-item { border-color: rgba(0, 255, 255, 0.5); }
.loading-sphere.sphere6 .loading-item { border-color: rgba(0, 128, 255, 0.5); }
.loading-sphere.sphere7 .loading-item { border-color: rgba(0, 0, 255, 0.5); }
.loading-sphere.sphere8 .loading-item { border-color: rgba(128, 0, 255, 0.5); }
.loading-sphere.sphere9 .loading-item { border-color: rgba(255, 0, 255, 0.5); }

.loading-item:nth-child(1) { transform: rotateY(0deg) translateZ(200px); }
.loading-item:nth-child(2) { transform: rotateY(45deg) translateZ(200px); }
.loading-item:nth-child(3) { transform: rotateY(90deg) translateZ(200px); }
.loading-item:nth-child(4) { transform: rotateY(135deg) translateZ(200px); }
.loading-item:nth-child(5) { transform: rotateY(180deg) translateZ(200px); }
.loading-item:nth-child(6) { transform: rotateY(225deg) translateZ(200px); }
.loading-item:nth-child(7) { transform: rotateY(270deg) translateZ(200px); }
.loading-item:nth-child(8) { transform: rotateY(315deg) translateZ(200px); }

.transform-loading-content h2 {
    font-size: var(--text-xl);
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.transform-loading-content p {
    color: var(--text-secondary);
    font-size: var(--text-base);
    margin-bottom: var(--space-xl);
}

.loading-steps {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.loading-step {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-card);
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-md);
    opacity: 0.4;
    transition: all var(--transition-base);
}

.loading-step i {
    font-size: 24px;
    color: var(--accent-primary);
    width: 30px;
}

.loading-step span {
    flex: 1;
    text-align: left;
    color: var(--text-primary);
    font-weight: 600;
}

.loading-step .step-status {
    font-size: 20px;
}

.transform-loading-content small {
    display: block;
    color: var(--text-muted);
    font-size: var(--text-xs);
    margin-top: var(--space-lg);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .main-container {
        padding: var(--space-xs);
    }
    
    .loading-spinner {
        width: 250px;
        height: 250px;
    }
    
    .loading-sphere {
        width: 250px;
        height: 250px;
    }
    
    .loading-item {
        width: 250px;
        height: 250px;
    }
    
    .loading-item:nth-child(1),
    .loading-item:nth-child(2),
    .loading-item:nth-child(3),
    .loading-item:nth-child(4),
    .loading-item:nth-child(5),
    .loading-item:nth-child(6),
    .loading-item:nth-child(7),
    .loading-item:nth-child(8) {
        transform: rotateY(calc(var(--i, 0) * 45deg)) translateZ(125px);
    }
    
    .logo {
        font-size: var(--text-sm);
    }
    
    .step-title {
        font-size: var(--text-sm);
    }
    
    .model-layout {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .card-grid {
        grid-template-columns: 1fr;
    }
    
    .carousel-container {
        height: 400px;
    }
    
    .carousel-item {
        width: 250px;
    }
    
    .carousel-item.left-1,
    .carousel-item.right-1 {
        transform: translateX(-280px) scale(0.75);
    }
    
    .carousel-item.right-1 {
        transform: translateX(280px) scale(0.75);
    }
    
    .carousel-item.left-2,
    .carousel-item.right-2 {
        opacity: 0;
        pointer-events: none;
    }
    
    .stepper {
        flex-wrap: wrap;
        gap: var(--space-sm);
    }
    
    .step-circle {
        width: 36px;
        height: 36px;
        font-size: 11px;
    }
    
    .step-label {
        font-size: 9px;
        bottom: -20px;
    }
    
    .nav-buttons {
        width: 100%;
    }
    
    .button {
        flex: 1;
        font-size: var(--text-xs);
        padding: var(--space-sm) var(--space-md);
    }
    
    .toast {
        left: var(--space-md);
        right: var(--space-md);
    }
}

@media (max-width: 480px) {
    .splash-logo {
        font-size: var(--text-2xl);
    }
    
    .splash-subtitle {
        font-size: var(--text-base);
    }
    
    .carousel-container {
        height: 350px;
    }
    
    .carousel-item {
        width: 200px;
    }
    
    .carousel-item.center {
        transform: translateX(0) scale(1.1);
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

*:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

button:focus-visible {
    outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
