/* =============================================
   CatchSantaCam - Festive Design System
   ============================================= */

:root {
    /* Colors - Dark theme with Christmas accents - */
    --bg-primary: #0a0f1a;
    --bg-secondary: #111827;
    --bg-card: rgba(30, 41, 59, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.05);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --accent-red: #dc2626;
    --accent-red-light: #ef4444;
    --accent-green: #16a34a;
    --accent-green-light: #22c55e;
    --accent-gold: #fbbf24;

    --gradient-christmas: linear-gradient(135deg, var(--accent-red) 0%, var(--accent-green) 100%);
    --gradient-card: linear-gradient(135deg, rgba(220, 38, 38, 0.1) 0%, rgba(22, 163, 74, 0.1) 100%);

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Typography */
    --font-display: 'Mountains of Christmas', cursive;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Border radius */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow-red: 0 0 30px rgba(220, 38, 38, 0.3);
    --shadow-glow-green: 0 0 30px rgba(22, 163, 74, 0.3);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;
}

/* =============================================
   Reset & Base Styles
   ============================================= */

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

/* Reset doesn't apply to video controls */
video,
video * {
    all: revert;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* =============================================
   Snow Canvas
   ============================================= */

#snow-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* =============================================
   App Container
   ============================================= */

.app-container {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* =============================================
   Screen Transitions
   ============================================= */

.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--space-xl);
    padding-top: 80px;
    /* Account for fixed user-header */
    animation: fadeIn var(--transition-slow) ease;
}

.screen.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================================
   Typography
   ============================================= */

h1,
h2,
h3 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
}

h1 {
    font-size: clamp(2.5rem, 8vw, 4rem);
}

h2 {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    margin-bottom: var(--space-md);
}

h3 {
    font-size: 1.5rem;
}

.screen-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: var(--space-xl);
    text-align: center;
}

/* =============================================
   Buttons
   ============================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-christmas);
    color: white;
    box-shadow: var(--shadow-md), var(--shadow-glow-red);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow-green);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-glass);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-back-header {
    background: var(--bg-glass);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-right: auto;
}

/* Fixed positioning removed to use flexbox alignment */

.btn-back-header:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-back-header.hidden {
    display: none;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: var(--space-sm) var(--space-md);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-glass);
}

.btn-large {
    padding: var(--space-lg) var(--space-2xl);
    font-size: 1.125rem;
}

.btn-icon {
    font-size: 1.25em;
}

.btn-back {
    position: absolute;
    top: var(--space-xl);
    left: var(--space-xl);
    background: var(--bg-glass);
    color: var(--text-secondary);
    border: none;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* =============================================
   Landing Screen
   ============================================= */

.landing-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 600px;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.santa-icon {
    font-size: 4rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.logo {
    background: var(--gradient-christmas);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}

.tagline {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-2xl);
    max-width: 500px;
}

.ai-highlight {
    background: linear-gradient(135deg, #00d4ff 0%, #7c3aed 50%, #ff006e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(124, 58, 237, 0.5);
}

.preview-container {
    background: var(--gradient-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-2xl);
    width: 100%;
    position: relative;
}

.preview-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gradient-christmas);
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
}

.before-after {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    flex-wrap: wrap;
}

.preview-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.preview-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.preview-placeholder {
    width: 140px;
    height: 100px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    border: 2px dashed rgba(255, 255, 255, 0.2);
}

.preview-placeholder span {
    font-size: 2rem;
}

.preview-placeholder p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.preview-placeholder.after {
    border-color: var(--accent-green);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.4);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(22, 163, 74, 0);
    }
}

.arrow {
    font-size: 1.5rem;
    color: var(--text-muted);
}

.supported-cameras {
    margin-top: var(--space-lg);
    margin-bottom: var(--space-lg);
    text-align: center;
}

.supported-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.camera-brands {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.brand-badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    transition: all var(--transition-fast);
}

.brand-badge:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.brand-badge.more {
    font-style: italic;
    color: var(--text-muted);
}

/* =============================================
   Upload Screen
   ============================================= */

#screen-upload {
    position: relative;
}

.drop-zone {
    width: 100%;
    max-width: 500px;
    padding: var(--space-3xl);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-lg);
    background: var(--bg-glass);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--accent-green);
    background: rgba(22, 163, 74, 0.1);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

.drop-icon {
    font-size: 3rem;
}

.drop-text {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.drop-or {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.file-types {
    margin-top: var(--space-md);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.upload-preview {
    max-width: 500px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

.upload-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

#btn-continue {
    margin-top: var(--space-xl);
}

/* =============================================
   Configure Screen
   ============================================= */

#screen-configure {
    position: relative;
}

.config-preview {
    position: relative;
    max-width: 500px;
    width: 100%;
    margin-bottom: var(--space-xl);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.config-preview img {
    width: 100%;
    display: block;
}

.santa-overlay {
    position: absolute;
    font-size: 3rem;
    top: 50%;
    transform: translateY(-50%);
    animation: walkPreview 3s infinite;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

@keyframes walkPreview {
    0% {
        left: -10%;
    }

    100% {
        left: 100%;
    }
}

.config-options {
    background: var(--bg-glass);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
    width: 100%;
    max-width: 500px;
}

.config-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.config-group label {
    font-weight: 500;
    color: var(--text-secondary);
}

.direction-buttons {
    display: flex;
    gap: var(--space-sm);
}

.direction-btn {
    flex: 1;
    padding: var(--space-md);
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.direction-btn:hover {
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.direction-btn.active {
    border-color: var(--accent-green);
    background: rgba(22, 163, 74, 0.2);
    color: var(--text-primary);
}

.processing-note {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: var(--space-lg);
}

/* =============================================
   Loading Screen
   ============================================= */

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 400px;
}

.loading-animation {
    width: 200px;
    height: 100px;
    position: relative;
    margin-bottom: var(--space-xl);
    background: var(--bg-glass);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.santa-walking {
    position: absolute;
    font-size: 3rem;
    top: 50%;
    transform: translateY(-50%);
    animation: walkLoading 2s infinite linear;
}

@keyframes walkLoading {
    0% {
        left: -20%;
    }

    100% {
        left: 100%;
    }
}

.loading-message {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    min-height: 1.5em;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-md);
}

.progress-fill {
    height: 100%;
    background: var(--gradient-christmas);
    border-radius: var(--radius-full);
    width: 0%;
    transition: width 0.5s ease;
}

.loading-note {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* =============================================
   Result Screen
   ============================================= */

.result-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 600px;
    width: 100%;
}

.success-badge {
    background: var(--gradient-christmas);
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-full);
    margin-bottom: var(--space-lg);
    animation: celebrate 0.5s ease;
}

@keyframes celebrate {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.video-container {
    width: 100%;
    margin: var(--space-xl) 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: #000;
}

.video-container video {
    width: 100%;
    display: block;
    background: #000;
}

/* Ensure native video controls use default browser styling */
.video-container video::-webkit-media-controls-timeline,
.video-container video::-webkit-media-controls-current-time-display,
.video-container video::-webkit-media-controls-time-remaining-display {
    all: revert;
}

.result-actions {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: var(--space-xl);
}

#btn-create-another {
    font-size: 1rem;
}

/* =============================================
   Error Modal
   ============================================= */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--space-xl);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    max-width: 400px;
    text-align: center;
}

.modal-content h3 {
    color: var(--accent-red-light);
    margin-bottom: var(--space-md);
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

/* =============================================
   Utility Classes
   ============================================= */

.hidden {
    display: none !important;
}

/* =============================================
   Responsive Design
   ============================================= */

@media (max-width: 600px) {
    .screen {
        padding: var(--space-lg);
    }

    .btn-back {
        top: calc(var(--space-md) + env(safe-area-inset-top, 20px));
        left: var(--space-md);
        z-index: 100;
    }

    .btn-large {
        width: 100%;
        padding: var(--space-lg) var(--space-xl);
    }

    .before-after {
        flex-direction: column;
    }

    .arrow {
        transform: rotate(90deg);
    }

    .direction-buttons {
        flex-direction: column;
    }

    .result-actions {
        width: 100%;
    }

    .result-actions .btn {
        flex: 1;
    }

    .drop-zone {
        padding: var(--space-xl);
    }

    .config-preview {
        margin-top: var(--space-xl);
    }
}

/* =============================================
   Loading States for Buttons
   ============================================= */

.btn.loading {
    pointer-events: none;
    opacity: 0.8;
    position: relative;
    color: transparent !important;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 1.2em;
    height: 1.2em;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.btn.loading .btn-icon {
    visibility: hidden;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Disabled state for forms during loading */
.auth-form.loading input,
.auth-form.loading button:not([type="submit"]) {
    opacity: 0.6;
    pointer-events: none;
}

/* Pulsing effect for primary buttons during loading */
.btn-primary.loading {
    animation: pulse-loading 1.5s ease-in-out infinite;
}

@keyframes pulse-loading {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 0.9;
    }
}

/* =============================================
   User Header
   ============================================= */

.user-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-xl);
    z-index: 50;
    background: rgba(10, 10, 20, 0.95);
    backdrop-filter: blur(10px);
}

.credits-badge {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--gradient-christmas);
    color: white;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: var(--shadow-sm);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-body);
}

.credits-badge:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.credits-icon {
    font-size: 1.1rem;
}

.btn-logout {
    background: var(--bg-glass);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-login {
    background: var(--gradient-christmas);
    color: white;
    border: none;
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* =============================================
   Auth Modal
   ============================================= */

.auth-modal-content {
    max-width: 380px;
    width: 100%;
    position: relative;
}

.auth-modal-content h3 {
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 1.75rem;
    margin-bottom: var(--space-sm);
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: var(--space-xl);
}

.modal-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--space-xs);
    line-height: 1;
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    text-align: left;
}

.form-group label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

.form-group input {
    background: var(--bg-primary);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    padding: var(--space-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color var(--transition-fast);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-green);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.auth-error {
    color: var(--accent-red-light);
    font-size: 0.9rem;
    text-align: center;
    margin: 0;
}

.auth-success {
    color: var(--accent-green-light);
    font-size: 0.9rem;
    text-align: center;
    margin: 0;
}

/* Google Sign-In Button */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    background: white;
    color: #333;
    border: 1px solid #ddd;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.btn-google:hover {
    background: #f7f7f7;
    border-color: #ccc;
    box-shadow: var(--shadow-sm);
}

.btn-google .google-icon {
    flex-shrink: 0;
}

/* Auth Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin: var(--space-lg) 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.btn-full {
    width: 100%;
}

.forgot-password {
    text-align: center;
    margin-top: var(--space-sm);
    margin-bottom: var(--space-md);
}

.auth-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.btn-link {
    background: none;
    border: none;
    color: var(--accent-green-light);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    transition: color var(--transition-fast);
}

.btn-link:hover {
    color: var(--accent-green);
    text-decoration: underline;
}

/* =============================================
   Credits Modal
   ============================================= */

.credits-modal-content {
    max-width: 400px;
    width: 100%;
    position: relative;
}

/* Video Viewer Modal */
.video-viewer-content {
    max-width: 800px;
    width: 95%;
    padding: var(--space-md);
    position: relative;
}

.video-viewer-content .modal-close {
    z-index: 10;
}

.video-viewer-content video {
    width: 100%;
    max-height: 70vh;
    border-radius: var(--radius-md);
    background: #000;
}

.credits-modal-content h3 {
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 1.75rem;
    margin-bottom: var(--space-sm);
}

.credits-balance-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    font-size: 1rem;
    color: var(--text-secondary);
}

.credits-balance-display .balance-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-green);
}

.credits-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: var(--space-lg);
}

.credits-package {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    background: var(--gradient-card);
    border: 2px solid var(--accent-green);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.package-icon {
    font-size: 2.5rem;
}

.package-details {
    flex: 1;
    text-align: left;
}

.package-details h4 {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.package-details p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

.package-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-gold);
}

.credits-note {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: var(--space-md);
}

/* =============================================
   Responsive - Auth & Credits
   ============================================= */

@media (max-width: 600px) {
    .user-header {
        width: 100%;
        justify-content: flex-end;
        padding: var(--space-sm) var(--space-md);
        background: rgba(10, 10, 20, 0.95);
        backdrop-filter: blur(10px);
    }

    .screen {
        padding-top: 70px;
    }

    .credits-badge {
        font-size: 0.8rem;
        padding: var(--space-xs) var(--space-sm);
    }

    .auth-modal-content,
    .credits-modal-content {
        margin: var(--space-md);
        padding: var(--space-xl);
    }

    .credits-package {
        flex-direction: column;
        text-align: center;
    }

    .package-details {
        text-align: center;
    }
}

/* =============================================
   My Videos Button
   ============================================= */

.btn-my-videos {
    background: var(--bg-glass);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-my-videos:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-green);
}

/* =============================================
   My Videos Gallery
   ============================================= */

.videos-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-xl);
    margin-top: var(--space-2xl);
    width: 100%;
    max-width: 1000px;
}

.video-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all var(--transition-normal);
}

.video-card:hover {
    border-color: var(--accent-green);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #000;
    cursor: pointer;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-fast);
}

.video-thumbnail:hover img {
    transform: scale(1.05);
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    transition: all var(--transition-fast);
    backdrop-filter: blur(4px);
}

.video-thumbnail:hover .play-overlay {
    background: var(--accent-red);
    transform: translate(-50%, -50%) scale(1.1);
}

.video-card-info {
    padding: var(--space-md);
}

.video-card-date {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: var(--space-sm);
}

.video-card-actions {
    display: flex;
    gap: var(--space-sm);
}

.video-card-actions .btn {
    flex: 1;
    padding: var(--space-sm);
    font-size: 0.85rem;
}

.btn-delete {
    background: transparent;
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
}

.btn-delete:hover {
    background: var(--accent-red);
    color: white;
}

/* No Videos State */
.no-videos {
    text-align: center;
    padding: var(--space-3xl);
}

.no-videos-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: var(--space-lg);
}

.no-videos p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: var(--space-sm);
}

.no-videos-hint {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: var(--space-xl);
}

/* Loading State */
.videos-loading {
    text-align: center;
    padding: var(--space-3xl);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-glass);
    border-top-color: var(--accent-green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto var(--space-lg);
}

/* Responsive - My Videos */
@media (max-width: 600px) {
    .videos-gallery {
        grid-template-columns: 1fr;
    }
}

/* =============================================
   Demo Video Section
   ============================================= */

.demo-video-container {
    background: var(--gradient-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
    width: 100%;
    max-width: 400px;
    position: relative;
}

.demo-video-wrapper {
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-top: var(--space-sm);
    position: relative;
    aspect-ratio: 16 / 9;
    max-height: 250px;
    background: rgba(0, 0, 0, 0.3);
}

.demo-video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.demo-fallback {
    padding: var(--space-xl);
}

.demo-caption {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: var(--space-sm);
    margin-bottom: 0;
}

/* Carousel Pagination Dots */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 0;
}

.carousel-dot:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.2);
}

.carousel-dot.active {
    background: var(--accent-green);
    transform: scale(1.2);
    box-shadow: 0 0 8px var(--accent-green);
}

/* =============================================
   How It Works Section
   ============================================= */

.how-it-works {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-md);
    background: var(--bg-glass);
    border-radius: var(--radius-md);
    min-width: 100px;
}

.step-icon {
    font-size: 2rem;
}

.step-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-align: center;
}

.step-arrow {
    font-size: 1.25rem;
    color: var(--text-muted);
}

@media (max-width: 600px) {
    .how-it-works {
        flex-direction: column;
    }

    .step-arrow {
        transform: rotate(90deg);
    }
}

/* =============================================
   Site Footer
   ============================================= */

.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: var(--space-xl) var(--space-md);
    text-align: center;
    position: relative;
    z-index: 10;
}

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

.footer-brand {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--accent-green-light);
}

.footer-divider {
    color: var(--text-muted);
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 0;
}

/* Share Buttons */
.share-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin: var(--space-md) 0;
}

.share-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.btn-share {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Share Section with AddToAny */
.share-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    margin: var(--space-md) 0;
}

.share-buttons-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.share-section .a2a_kit,
.share-buttons-row .a2a_kit {
    display: flex !important;
    gap: var(--space-xs);
}

/* Custom Copy Button */
.btn-share-custom {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-share-custom:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--accent-green);
}

.btn-share-custom-small {
    padding: var(--space-xs) var(--space-sm);
    font-size: 1rem;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Gallery custom copy button */
.btn-share-custom-gallery {
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    color: white;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-share-custom-gallery:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--accent-green);
}

/* Gallery share kit alignment */
.gallery-share-kit {
    display: flex !important;
    gap: 4px;
}

/* Footer Share */
.footer-share {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin: var(--space-md) 0;
}

.btn-share-footer {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-share-footer:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-green);
    transform: scale(1.1);
}

/* Video Gallery Share Buttons */
.video-card-share {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.share-label-small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.btn-share-small {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-share-small:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-green);
    transform: scale(1.1);
}

@media (max-width: 600px) {
    .footer-links {
        flex-direction: column;
        gap: var(--space-xs);
    }

    .footer-divider {
        display: none;
    }

    .share-buttons {
        flex-wrap: wrap;
    }

    .result-actions-secondary {
        flex-direction: column;
        width: 100%;
    }
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--accent-green);
    color: white;
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-full);
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
}

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