/* ========================================
   MALIKS LEBANON - CHRISTMAS PHOTO BOOTH
   Complete Redesign with Christmas Theme
   No Scroll Design - Fullscreen Experience
   ======================================== */

:root {
    /* Christmas Colors */
    --christmas-red: #C41E3A;
    --christmas-green: #0F8A5F;
    --christmas-gold: #FFD700;
    --snow-white: #FFFFFF;
    --ice-blue: #E8F4F8;
    --dark-pine: #0A5F38;
    --warm-red: #DC143C;

    /* UI Colors */
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-light: #FFFFFF;
    --text-dark: #1A1A1A;
    --shadow-strong: 0 20px 60px rgba(0, 0, 0, 0.4);
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.2);
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Poppins', sans-serif;
    color: var(--text-light);
    position: fixed;
}

body {
    background: linear-gradient(135deg, #1a472a 0%, #0d2818 50%, #0a1f13 100%);
}

/* ========================================
   CHRISTMAS BACKGROUND
   ======================================== */
.christmas-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.snow-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent),
        radial-gradient(2px 2px at 90% 60%, white, transparent),
        radial-gradient(1px 1px at 33% 90%, white, transparent);
    background-size: 200% 200%;
    animation: snowfall 20s linear infinite;
    opacity: 0.6;
}

.lights-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 10% 20%, rgba(255, 215, 0, 0.3) 0%, transparent 3%),
        radial-gradient(circle at 30% 40%, rgba(220, 20, 60, 0.3) 0%, transparent 3%),
        radial-gradient(circle at 50% 60%, rgba(255, 215, 0, 0.3) 0%, transparent 3%),
        radial-gradient(circle at 70% 80%, rgba(220, 20, 60, 0.3) 0%, transparent 3%),
        radial-gradient(circle at 90% 30%, rgba(255, 215, 0, 0.3) 0%, transparent 3%);
    background-size: 100% 100%;
    animation: twinkle 3s ease-in-out infinite;
}

@keyframes snowfall {
    0% { background-position: 0% 0%; }
    100% { background-position: 0% 100%; }
}

@keyframes twinkle {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

/* ========================================
   GLASS MORPHISM EFFECT
   ======================================== */
.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-strong);
}

/* ========================================
   SKELETON LOADER
   ======================================== */
.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.1) 25%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.1) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 10px;
}

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

.modal-photo-preview img.loading {
    opacity: 0;
}

.modal-photo-preview.loading::before {
    content: "";
    display: block;
    width: 100%;
    height: 300px;
    background: linear-gradient(90deg, rgba(255,255,255,0.1) 25%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.1) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 10px;
}

#previewImage.loading {
    opacity: 0;
}

.preview-frame.loading::before {
    content: "";
    display: block;
    width: 100%;
    height: 400px;
    background: linear-gradient(90deg, rgba(255,255,255,0.1) 25%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.1) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 15px;
}

/* ========================================
   MUSIC TOGGLE
   ======================================== */
.music-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 2px solid var(--glass-border);
    color: var(--christmas-gold);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-soft);
}

.music-toggle:hover {
    transform: scale(1.1);
    background: rgba(255, 215, 0, 0.2);
}

.music-toggle.playing {
    animation: pulse-glow 2s infinite;
}

/* ========================================
   FULLSCREEN TOGGLE
   ======================================== */
.fullscreen-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 10000;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 2px solid var(--glass-border);
    color: var(--christmas-gold);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-soft);
}

.fullscreen-toggle:hover {
    transform: scale(1.1);
    background: rgba(255, 215, 0, 0.2);
}

.fullscreen-toggle.active {
    background: rgba(255, 215, 0, 0.3);
    border-color: var(--christmas-gold);
}

/* ========================================
   SCREEN MANAGEMENT
   ======================================== */
.screen {
    display: none !important;
    width: 100%;
    position: relative;
    z-index: 5;
    animation: fadeIn 0.5s ease;
}

.screen.active {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.fullscreen-center {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height - accounts for mobile browser bars */
    padding: 1rem;
    z-index: 1000;
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* ========================================
   PASSWORD SCREEN
   ======================================== */
#passwordScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    background: linear-gradient(135deg, #1a472a 0%, #0d2818 50%, #0a1f13 100%);
}

#passwordScreen.hidden {
    display: none !important;
}

.password-card {
    width: 100%;
    max-width: 450px;
    padding: 3rem 2rem;
    border-radius: 30px;
    text-align: center;
    animation: slideIn 0.6s ease;
}

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

.logo-display {
    margin-bottom: 2.5rem;
}

.logo-circle {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--christmas-red), var(--warm-red));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    box-shadow: 0 10px 40px rgba(220, 20, 60, 0.5);
}

.brand-title {
    font-family: 'Mountains of Christmas', cursive;
    font-size: 2.8rem;
    color: var(--christmas-gold);
    text-shadow: 2px 2px 20px rgba(255, 215, 0, 0.6);
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
}

.brand-subtitle {
    font-size: 1.1rem;
    color: var(--ice-blue);
    font-weight: 300;
}

.password-input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.password-input {
    flex: 1;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    border: 2px solid var(--glass-border);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    text-align: center;
    font-weight: 600;
    letter-spacing: 3px;
    transition: all 0.3s ease;
}

.password-input:focus {
    outline: none;
    border-color: var(--christmas-gold);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.password-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
}

.btn-enter {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--christmas-gold), #FFA500);
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4);
}

.btn-enter:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(255, 215, 0, 0.6);
}

.password-hint {
    font-size: 0.9rem;
    color: var(--ice-blue);
    opacity: 0.8;
}

/* ========================================
   APP CONTAINER
   ======================================== */
.app-container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ========================================
   HEADER
   ======================================== */
.header {
    position: relative;
    z-index: 10;
    padding: 1rem 1.5rem;
    text-align: center;
    background: linear-gradient(135deg, var(--christmas-red), var(--warm-red));
    box-shadow: var(--shadow-soft);
    flex-shrink: 0;
}

.brand-name {
    font-family: 'Mountains of Christmas', cursive;
    font-size: 2rem;
    font-weight: 700;
    color: var(--snow-white);
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
    letter-spacing: 2px;
}

.tagline {
    font-size: 0.9rem;
    color: var(--ice-blue);
    font-weight: 300;
    letter-spacing: 1px;
}

/* ========================================
   MAIN CONTAINER
   ======================================== */
.main-container {
    flex: 1;
    position: relative;
    z-index: 5;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* ========================================
   WELCOME SCREEN
   ======================================== */
.welcome-card {
    width: 100%;
    max-width: 500px;
    padding: 2.5rem 2rem;
    border-radius: 30px;
    text-align: center;
}

.ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--christmas-gold), #FFA500);
    color: var(--text-dark);
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.4);
}

.free-photobooth-title {
    font-family: 'Mountains of Christmas', cursive;
    font-size: 4rem;
    font-weight: 700;
    color: var(--christmas-gold);
    text-align: center;
    margin-bottom: 1.5rem;
    text-shadow: 3px 3px 15px rgba(197, 29, 52, 0.8),
                 0 0 30px rgba(255, 215, 0, 0.6);
    letter-spacing: 3px;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 3px 3px 15px rgba(197, 29, 52, 0.8),
                     0 0 30px rgba(255, 215, 0, 0.6);
    }
    to {
        text-shadow: 3px 3px 20px rgba(197, 29, 52, 1),
                     0 0 50px rgba(255, 215, 0, 0.9);
    }
}

.christmas-title {
    font-family: 'Mountains of Christmas', cursive;
    font-size: 2.5rem;
    color: var(--snow-white);
    margin-bottom: 2rem;
    text-shadow: 2px 2px 10px rgba(255, 215, 0, 0.5);
    line-height: 1.2;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    position: relative;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--christmas-red), var(--warm-red));
    color: var(--text-light);
    box-shadow: 0 10px 30px rgba(220, 20, 60, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(220, 20, 60, 0.6);
}

.btn-secondary {
    background: linear-gradient(135deg, #FFFFFF, #F0F0F0);
    color: var(--christmas-red);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    transform: translateY(-3px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--snow-white);
    color: var(--snow-white);
    padding: 0.8rem 2rem;
    margin-top: 1rem;
}

.btn-large {
    padding: 1.3rem 3rem;
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.pulse {
    animation: pulse 2s infinite;
}

.pulse-glow {
    animation: pulse-glow 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes pulse-glow {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 10px 30px rgba(220, 20, 60, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 50px rgba(220, 20, 60, 0.7);
    }
}

.features-quick {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.feature-quick {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--christmas-gold);
}

.feature-quick span {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--ice-blue);
}

/* ========================================
   CAMERA SCREEN
   ======================================== */
.camera-wrapper {
    width: 100%;
    max-width: 900px;
    height: 100%;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--christmas-red) transparent;
}

.camera-wrapper::-webkit-scrollbar {
    width: 6px;
}

.camera-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.camera-wrapper::-webkit-scrollbar-thumb {
    background: var(--christmas-red);
    border-radius: 10px;
}

.camera-container {
    width: 100%;
    position: relative;
    padding: 1.5rem;
    border-radius: 20px;
}

#video {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 15px;
    margin-bottom: 0.8rem;
    border: 2px solid var(--christmas-gold);
}

/* ========================================
   COMPACT CONTROL BAR - ALL IN ONE LINE
   ======================================== */
.compact-control-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    padding: 0.5rem;
    border-radius: 12px;
    margin-bottom: 0.8rem;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.left-controls {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
}

.right-controls {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Control Labels */
.control-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--christmas-gold);
    white-space: nowrap;
    margin-right: 0.3rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Person Count Buttons - Compact */
.person-count-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid transparent;
    border-radius: 8px;
    color: var(--ice-blue);
    cursor: pointer;
    transition: all 0.3s ease;
}

.person-count-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: var(--christmas-gold);
}

.person-count-btn.active {
    background: linear-gradient(135deg, var(--christmas-red), #b91c1c);
    border-color: var(--christmas-gold);
    color: var(--snow-white);
    box-shadow: 0 2px 8px rgba(197, 29, 52, 0.4);
}

.person-count-btn i {
    color: currentColor;
}

.divider {
    width: 1px;
    height: 28px;
    background: rgba(255, 215, 0, 0.3);
    margin: 0 0.2rem;
}

/* Category Tabs - Compact */
.category-tabs {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.category-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    height: 36px;
    padding: 0 0.6rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 8px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.category-tab:hover {
    background: rgba(255, 255, 255, 0.15);
}

.category-tab.active {
    background: linear-gradient(135deg, var(--christmas-gold), #FFA500);
    color: var(--text-dark);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

.category-tab span {
    display: inline;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

/* Control Buttons - QR Code & Storage */
.btn-control-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: linear-gradient(135deg, #FFFFFF, #F0F0F0);
    color: var(--christmas-red);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-control-compact:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #FFFFFF, #FAFAFA);
}

.btn-control-compact i {
    color: var(--christmas-red);
}

.right-controls {
    display: flex;
    gap: 0.4rem;
}

/* ========================================
   FILTERS PANEL - COMPACT
   ======================================== */
.filters-panel {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    padding: 0.6rem;
    border-radius: 12px;
    margin-bottom: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.filters-category {
    display: none;
}

.filters-category.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    padding: 0.6rem 0.3rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.filter-btn.active {
    border-color: var(--christmas-gold);
    background: rgba(255, 215, 0, 0.2);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.filter-icon {
    font-size: 1.5rem;
}

.filter-btn p {
    font-size: 0.65rem;
    margin: 0;
    font-weight: 500;
    text-align: center;
    line-height: 1.1;
}

/* ========================================
   CAPTURE BUTTON
   ======================================== */
.capture-zone {
    text-align: center;
    margin-bottom: 0.5rem;
}

.btn-capture {
    position: relative;
    width: 60px;
    height: 60px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 auto;
    display: block;
}

.capture-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 4px solid var(--snow-white);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.capture-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: var(--christmas-red);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.btn-capture:hover .capture-ring {
    transform: scale(1.1);
}

.btn-capture:hover .capture-dot {
    background: var(--christmas-gold);
}

.capture-hint {
    margin-top: 0.5rem;
    color: var(--ice-blue);
    font-weight: 500;
    font-size: 0.8rem;
}

.btn-back {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(0, 0, 0, 0.5);
    color: var(--text-light);
    border: 2px solid var(--christmas-red);
    padding: 0.7rem 1rem;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: var(--christmas-red);
}

/* ========================================
   COUNTDOWN TIMER
   ======================================== */
.countdown-timer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    display: none;
    pointer-events: none;
}

.countdown-timer.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.countdown-number {
    font-size: 10rem;
    font-weight: bold;
    color: var(--christmas-gold);
    text-shadow:
        0 0 20px rgba(255, 215, 0, 0.8),
        0 0 40px rgba(255, 215, 0, 0.6),
        0 0 60px rgba(255, 215, 0, 0.4),
        4px 4px 20px rgba(0, 0, 0, 0.8);
    animation: countdownPulse 1s ease-out;
}

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

/* Responsive countdown */
@media (max-width: 768px) {
    .countdown-number {
        font-size: 6rem;
    }
}

/* ========================================
   LOADING SCREEN
   ======================================== */
.loading-container {
    max-width: 500px;
    text-align: center;
    padding: 2rem;
}

.christmas-loader {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto 2rem;
}

.ornament {
    position: absolute;
    font-size: 3rem;
    animation: ornamentSpin 3s ease-in-out infinite;
}

.ornament-1 {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 0s;
}

.ornament-2 {
    bottom: 0;
    left: 0;
    animation-delay: 1s;
}

.ornament-3 {
    bottom: 0;
    right: 0;
    animation-delay: 2s;
}

@keyframes ornamentSpin {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(360deg) scale(1.2); }
}

.loading-title {
    font-family: 'Mountains of Christmas', cursive;
    font-size: 2.2rem;
    color: var(--christmas-gold);
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 10px rgba(255, 215, 0, 0.5);
}

.loading-bar-container {
    margin-bottom: 1.5rem;
}

.loading-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--christmas-gold), #FFA500);
    animation: loading 2s ease-in-out infinite;
    box-shadow: 0 0 10px var(--christmas-gold);
}

@keyframes loading {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

.loading-text {
    font-size: 1.1rem;
    color: var(--ice-blue);
    margin-bottom: 0.5rem;
}

.loading-tip {
    font-size: 0.9rem;
    color: var(--christmas-gold);
    opacity: 0.7;
    font-style: italic;
    margin-bottom: 2rem;
}

/* Loading Info Section */
.loading-info {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.info-icon {
    color: var(--christmas-gold);
    margin-bottom: 1rem;
}

.loading-info h3 {
    font-family: 'Mountains of Christmas', cursive;
    font-size: 1.5rem;
    color: var(--christmas-gold);
    margin-bottom: 1rem;
}

.info-grid {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.info-item {
    flex: 1;
    min-width: 180px;
    background: rgba(255, 255, 255, 0.08);
    padding: 1rem;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.info-emoji {
    font-size: 2rem;
}

.info-item p {
    color: var(--ice-blue);
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    margin: 0;
}

.social-tags {
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.tag-title {
    color: var(--ice-blue);
    font-weight: 600;
    margin-bottom: 0.8rem;
    font-size: 1rem;
}

.tags-row {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    flex-wrap: wrap;
}

.tag {
    background: linear-gradient(135deg, var(--christmas-red), #c41e3a);
    color: var(--snow-white);
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(197, 29, 52, 0.4);
    border: 2px solid var(--christmas-gold);
}

/* ========================================
   PREVIEW SCREEN
   ======================================== */
.preview-container {
    max-width: 600px;
    width: 100%;
    text-align: center;
    padding: 0.5rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-height: 100%;
    overflow-y: auto;
}

/* For larger screens, optimize spacing */
@media (min-width: 1024px) and (min-height: 900px) {
    .preview-title {
        margin-bottom: 0.6rem;
        font-size: 1.6rem;
    }

    .preview-frame {
        margin-bottom: 0.6rem;
        padding: 0.6rem;
    }

    .qr-action-section {
        margin-bottom: 0;
        gap: 3rem;
    }

    #previewImage {
        max-height: 45vh;
        max-height: 45dvh;
    }
}

.preview-title {
    font-family: 'Mountains of Christmas', cursive;
    font-size: 1.8rem;
    color: var(--christmas-gold);
    margin-bottom: 0.8rem;
    text-shadow: 2px 2px 10px rgba(255, 215, 0, 0.5);
    flex-shrink: 0;
}

.preview-frame {
    position: relative;
    padding: 0.8rem;
    border-radius: 20px;
    border: 3px solid var(--christmas-gold);
    margin-bottom: 0.8rem;
    flex-shrink: 0;
    width: 100%;
}

#previewImage {
    width: 100%;
    max-height: 50vh;
    max-height: 50dvh; /* Dynamic viewport height */
    object-fit: contain;
    border-radius: 15px;
    display: block;
}

/* QR Code and Action Section */
.qr-action-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.qr-section {
    text-align: center;
    flex-shrink: 0;
}

.qr-label {
    color: var(--ice-blue);
    font-weight: 600;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.qr-code {
    display: inline-block;
    padding: 0.5rem;
    background: var(--snow-white);
    border-radius: 10px;
}

/* Responsive: Stack on small screens */
@media (max-width: 600px) {
    .qr-action-section {
        flex-direction: column;
        gap: 1rem;
    }
}

.social-tags-modal {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.tag-line-modal {
    font-size: 1.1rem;
    margin: 0.8rem 0;
    color: var(--snow-white);
}

.highlight {
    color: var(--christmas-gold);
    font-weight: 700;
    padding: 0.3rem 0.7rem;
    background: rgba(255, 215, 0, 0.15);
    border-radius: 8px;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

/* ========================================
   MODAL
   ======================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    border: 2px solid var(--christmas-gold);
    animation: slideUp 0.4s ease;
}

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

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(220, 20, 60, 0.2);
    border: 1px solid var(--christmas-red);
    color: var(--snow-white);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-close:hover {
    background: var(--christmas-red);
    transform: rotate(90deg);
}

.modal-title {
    font-family: 'Mountains of Christmas', cursive;
    font-size: 2rem;
    color: var(--christmas-gold);
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 10px rgba(255, 215, 0, 0.5);
}

.modal-photo-preview {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.modal-photo-preview img {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 10px;
}

.filter-preview-description {
    color: var(--ice-blue);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ========================================
   QR CODE MODAL
   ======================================== */
.qr-modal-content {
    max-width: 400px;
    text-align: center;
}

.modal-subtitle {
    color: var(--ice-blue);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.qr-code-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    background: var(--snow-white);
    border-radius: 15px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.qr-hint {
    font-size: 0.85rem;
    color: var(--ice-blue);
    opacity: 0.8;
}

.qr-hint strong {
    color: var(--christmas-gold);
    font-weight: 700;
}

/* ========================================
   STORAGE MODAL
   ======================================== */
.storage-modal-content {
    max-width: 700px;
    width: 90vw;
    max-height: 85vh;
}

.storage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.storage-subtitle {
    color: var(--ice-blue);
    font-size: 0.95rem;
    margin: 0;
    opacity: 0.9;
}

.btn-refresh {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--christmas-gold);
    border-radius: 10px;
    color: var(--christmas-gold);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 600;
}

.btn-refresh:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: translateY(-2px);
}

.storage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem;
}

.storage-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
}

.storage-item:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.storage-item.selected {
    border-color: var(--christmas-gold);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.storage-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.storage-item-check {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: var(--christmas-gold);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
    font-weight: bold;
}

.storage-item.selected .storage-item-check {
    display: flex;
}

.storage-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 8px;
    color: var(--ice-blue);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.page-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--christmas-gold);
}

.page-btn.active {
    background: linear-gradient(135deg, var(--christmas-gold), #FFA500);
    color: var(--text-dark);
    border-color: var(--christmas-gold);
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.storage-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.storage-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--ice-blue);
    opacity: 0.7;
}

.storage-empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.storage-empty-text {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    color: var(--ice-blue);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.preview-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}


/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 768px) {
    .brand-name {
        font-size: 1.6rem;
    }

    .tagline {
        font-size: 0.8rem;
    }

    .free-photobooth-title {
        font-size: 2.5rem;
        letter-spacing: 2px;
    }

    .christmas-title {
        font-size: 2rem;
    }

    .brand-title {
        font-size: 2.2rem;
    }

    .logo-circle {
        width: 100px;
        height: 100px;
    }

    .compact-control-bar {
        flex-wrap: wrap;
        padding: 0.4rem;
    }

    .left-controls {
        flex-wrap: wrap;
        gap: 0.3rem;
    }

    .person-count-btn {
        width: 32px;
        height: 32px;
    }

    .category-tab {
        height: 32px;
        padding: 0 0.5rem;
        gap: 0.25rem;
    }

    .category-tab span {
        font-size: 0.7rem;
    }

    .category-tab i {
        width: 14px;
        height: 14px;
    }

    .divider {
        height: 24px;
    }

    .control-label {
        font-size: 0.65rem;
        margin-right: 0.2rem;
    }

    .btn-upload-compact {
        width: 36px;
        height: 32px;
    }

    .filters-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.4rem;
    }

    .filter-icon {
        font-size: 1.3rem;
    }

    .filter-btn p {
        font-size: 0.6rem;
    }

    .filter-btn {
        padding: 0.5rem 0.2rem;
    }

    .btn {
        padding: 0.9rem 1.5rem;
        font-size: 0.9rem;
    }

    .btn-large {
        padding: 1.1rem 2rem;
        font-size: 1rem;
    }

    .features-quick {
        gap: 1.5rem;
    }

    .password-input-group {
        flex-direction: column;
    }

    .preview-title {
        font-size: 1.8rem;
    }

    .social-message h3 {
        font-size: 1.2rem;
    }

    .social-message p {
        font-size: 0.9rem;
    }

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

@media (max-width: 480px) {
    .free-photobooth-title {
        font-size: 2rem;
        letter-spacing: 1px;
    }

    .christmas-title {
        font-size: 1.7rem;
    }

    .brand-title {
        font-size: 1.8rem;
    }

    #video {
        max-height: 300px;
    }

    .camera-wrapper {
        max-height: calc(100vh - 120px);
    }

    .preview-container {
        max-height: calc(100vh - 120px);
    }
}

@media (orientation: landscape) and (max-height: 600px) {
    .header {
        padding: 0.5rem 1rem;
    }

    .brand-name {
        font-size: 1.4rem;
    }

    .footer {
        padding: 0.5rem;
    }

    .camera-wrapper {
        max-height: calc(100vh - 100px);
    }

    .preview-container {
        max-height: calc(100vh - 100px);
    }
}
