@charset "UTF-8";

/* ======================================================
   SNAPLAB PHOTOBOOTH - PREMIUM TOUCH UI & PRINT STYLES
   ====================================================== */

:root {
    --primary: #ec4899;
    --primary-hover: #db2777;
    --accent: #8b5cf6;
    --bg-dark: #09090b;
    --card-bg: rgba(24, 24, 27, 0.75);
    --border-glass: rgba(255, 255, 255, 0.12);
}

* {
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-dark);
    color: #f4f4f5;
    overflow-x: hidden;
    touch-action: manipulation;
}

/* Screen Views - Perfectly fills available space below top header */
.screen-view {
    width: 100%;
    flex: 1 1 0%;
    min-height: 0;
}
#screen-start.screen-view {
    height: 100%;
}

/* Glassmorphism Classes */
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
}

.glass-card {
    background: rgba(39, 39, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-card:active {
    transform: scale(0.98);
}

/* Flash Screen Effect */
#flash-overlay {
    position: fixed;
    inset: 0;
    background: white;
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.05s ease-out;
}

#flash-overlay.active {
    opacity: 1;
    transition: none;
}

/* Animated Countdown Number */
@keyframes countdown-pop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.15);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.animate-pop {
    animation: countdown-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Pulsing Start Button */
@keyframes gentle-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 25px rgba(236, 72, 153, 0.4);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 0 45px rgba(236, 72, 153, 0.7);
    }
}

.pulse-glow {
    animation: gentle-pulse 2.2s infinite ease-in-out;
}

/* Floating animation for cards */
@keyframes float-slow {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(1deg); }
}

.animate-float {
    animation: float-slow 4s infinite ease-in-out;
}

/* Custom Scrollbar for Template Selection */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Live Video Flip */
.mirror-video {
    transform: scaleX(-1);
}

/* ======================================================
   PREMIUM STUDIO TEMPLATE CARDS & ACTIVE STATES
   ====================================================== */
.template-card {
    position: relative;
    border-radius: 1.25rem;
    transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    background: rgba(24, 24, 27, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    overflow: visible;
}

.template-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(39, 39, 42, 0.9);
    box-shadow: 0 12px 28px -5px rgba(0, 0, 0, 0.6);
}

.template-card.active {
    border-color: #ec4899 !important;
    background: linear-gradient(180deg, rgba(236, 72, 153, 0.16) 0%, rgba(24, 24, 27, 0.96) 100%) !important;
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.85), 0 15px 35px -5px rgba(236, 72, 153, 0.5) !important;
    transform: translateY(-4px) scale(1.025);
    z-index: 10;
}

/* Glowing selection corner badge */
.active-indicator-badge {
    position: absolute;
    top: -10px;
    right: 10px;
    z-index: 35;
    background: linear-gradient(135deg, #ec4899, #f43f5e);
    color: white;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.05em;
    padding: 3px 10px;
    border-radius: 9999px;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.6), 0 0 0 2px rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 4px;
    animation: gentle-pop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes gentle-pop {
    0% { transform: scale(0.6); opacity: 0; }
    70% { transform: scale(1.12); }
    100% { transform: scale(1); opacity: 1; }
}

/* Hide scrollbar for category tabs */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ======================================================
   RESPONSIVE DESIGN SYSTEM: MOBILE, TABLET/IPAD & DESKTOP
   ====================================================== */

/* --- Mobile Devices (< 768px) --- */
@media (max-width: 767.98px) {
    /* Touch optimization */
    button, .template-card, .pan-btn, .color-pill, .filter-btn {
        min-height: 44px;
        touch-action: manipulation;
    }

    /* Template grid on mobile: 2 neat columns */
    #templates-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.75rem !important;
        padding-bottom: 6.5rem !important;
    }

    /* Customize screen on mobile: stack nicely with scroll */
    #screen-customize {
        padding: 0.75rem !important;
        gap: 1rem !important;
    }

    #customize-preview-container {
        max-height: 48vh !important;
    }

    /* Review slots on mobile */
    #review-slots-container {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.75rem !important;
    }

    /* Screen result adjustments on mobile */
    #screen-result {
        padding: 0.75rem !important;
    }

    /* Ensure safe-area support for modern iPhones & Androids with bottom notch/home bar */
    .pb-safe {
        padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    }
}

/* --- Tablet & iPad Devices (768px - 1024px) --- */
@media (min-width: 768px) and (max-width: 1024px) {
    #templates-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 1.25rem !important;
        padding-bottom: 7rem !important;
    }

    #review-slots-container {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 1.25rem !important;
    }

    #customize-preview-container {
        max-height: 60vh !important;
    }
}

/* --- Desktop & Laptop Devices (> 1024px) --- */
@media (min-width: 1025px) {
    #templates-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 1.5rem !important;
        padding-bottom: 7rem !important;
    }

    /* Subtle custom scrollbar */
    #templates-scroll-container::-webkit-scrollbar {
        width: 8px;
    }
    #templates-scroll-container::-webkit-scrollbar-thumb {
        background: rgba(236, 72, 153, 0.4);
        border-radius: 9999px;
    }
    #templates-scroll-container::-webkit-scrollbar-thumb:hover {
        background: rgba(236, 72, 153, 0.8);
    }
}

/* Print Container - Hidden on screen */
#print-section {
    display: none;
}

/* ======================================================
   PRINT STYLES FOR CANON SELPHY & 4R PHOTO PRINTERS
   Paper size: 4x6 inches (100x148mm / 102x152mm)
   ====================================================== */
@media print {
    @page {
        size: 4in 6in;
        margin: 0;
    }

    html, body {
        width: 4in;
        height: 6in;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        overflow: hidden !important;
    }

    /* Hide everything on the app UI */
    #app-container,
    .no-print,
    header,
    footer,
    nav,
    button,
    #flash-overlay {
        display: none !important;
    }

    /* Show only the high-res print image */
    #print-section {
        display: block !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 4in !important;
        height: 6in !important;
        margin: 0 !important;
        padding: 0 !important;
        z-index: 999999 !important;
        background: white !important;
    }

    #print-section img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
        page-break-after: avoid !important;
        page-break-inside: avoid !important;
    }
}
