@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Space+Mono:ital,wght@0,400;0,700;1,400&family=Syne:wght@700;800&family=DM+Sans:wght@400;500;700&display=swap');

:root {
    --bg-paper: #F4F1EA;
    --bg-carbon: #121212;
    --riso-pink: #FF2A6D;
    --riso-acid: #05FFA1;
    --riso-blue: #0055FF;
    --riso-amber: #FF9900;
    --border-black: #121212;
    --shadow-solid: 4px 4px 0px #121212;
    --shadow-solid-lg: 6px 6px 0px #121212;
    --shadow-solid-sm: 2px 2px 0px #121212;
}

* {
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

body {
    font-family: 'Space Mono', monospace;
    background-color: var(--bg-paper);
    color: var(--border-black);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    min-height: 100vh;
    background-image: radial-gradient(rgba(18, 18, 18, 0.08) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Persistent Kiosk Header Navbar */
header {
    position: sticky !important;
    top: 0 !important;
    z-index: 40 !important;
    flex-shrink: 0 !important;
    background-color: #FFFFFF !important;
}

/* Headings font */
h1, h2, h3, .font-heading {
    font-family: 'Syne', sans-serif;
    letter-spacing: -0.02em;
}

.font-mono {
    font-family: 'Space Mono', monospace;
}

.font-display {
    font-family: 'Archivo Black', sans-serif;
}

/* Brutalist Tactile Buttons */
.btn-brutalist {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    text-transform: uppercase;
    border: 3px solid var(--border-black);
    box-shadow: var(--shadow-solid);
    transition: all 0.1s ease;
    cursor: pointer;
    touch-action: manipulation;
}

.btn-brutalist:hover {
    transform: translate(-1px, -1px);
    box-shadow: 6px 6px 0px var(--border-black);
}

.btn-brutalist:active {
    transform: translate(3px, 3px);
    box-shadow: 0px 0px 0px var(--border-black);
}

.btn-brutalist-lg {
    box-shadow: var(--shadow-solid-lg);
    border-width: 4px;
}

.btn-brutalist-lg:hover {
    transform: translate(-2px, -2px);
    box-shadow: 8px 8px 0px var(--border-black);
}

.btn-brutalist-lg:active {
    transform: translate(4px, 4px);
    box-shadow: 0px 0px 0px var(--border-black);
}

/* Brutalist Cards & Panels */
.card-brutalist {
    background-color: #FFFFFF;
    border: 3px solid var(--border-black);
    box-shadow: var(--shadow-solid);
}

.card-brutalist-dark {
    background-color: var(--bg-carbon);
    color: var(--bg-paper);
    border: 3px solid #2A2A2A;
    box-shadow: 4px 4px 0px var(--riso-acid);
}

/* LED Status Indicator */
.led-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #000;
    display: inline-block;
}

.led-red {
    background-color: #EF4444;
    box-shadow: 0 0 8px #EF4444;
    animation: blink-rec 1s infinite alternate;
}

.led-green {
    background-color: var(--riso-acid);
    box-shadow: 0 0 8px var(--riso-acid);
}

.led-yellow {
    background-color: var(--riso-amber);
    box-shadow: 0 0 8px var(--riso-amber);
}

@keyframes blink-rec {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* Camera Viewfinder Overlays */
.viewfinder-corner {
    position: absolute;
    width: 28px;
    height: 28px;
    border-color: rgba(255, 255, 255, 0.85);
    pointer-events: none;
}

.corner-tl { top: 20px; left: 20px; border-top: 3px solid; border-left: 3px solid; }
.corner-tr { top: 20px; right: 20px; border-top: 3px solid; border-right: 3px solid; }
.corner-bl { bottom: 20px; left: 20px; border-bottom: 3px solid; border-left: 3px solid; }
.corner-br { bottom: 20px; right: 20px; border-bottom: 3px solid; border-right: 3px solid; }

.grid-lines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.15) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.15) 1px, transparent 1px);
    background-size: 33.333% 33.333%;
}

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

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

/* Marquee Text */
.marquee-container {
    overflow: hidden;
    white-space: nowrap;
}

.marquee-content {
    display: inline-block;
    animation: marquee 25s linear infinite;
}

@keyframes marquee {
    0% { transform: translateX(0%); }
    100% { transform: translateX(-50%); }
}

/* Halftone Texture Overlay */
.texture-halftone {
    background-image: radial-gradient(#121212 1px, transparent 1px);
    background-size: 6px 6px;
    opacity: 0.08;
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* Touchscreen Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-left: 2px solid #000;
}
::-webkit-scrollbar-thumb {
    background: #000;
}

/* Mobile Editor Split & Independent Scrolling */
@media (max-width: 1023px) {
    #screen-editor {
        overflow: hidden !important;
    }
    #screen-editor > div:first-child {
        flex-shrink: 0 !important;
    }
    #screen-editor > div:last-child {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
        overflow-y: auto !important;
    }
}

/* Mobile Booth Camera & Shutter Button Fix */
@media (max-width: 767px) {
    #screen-booth {
        height: calc(100vh - 55px) !important;
        height: calc(100dvh - 55px) !important;
        max-height: calc(100vh - 55px) !important;
        max-height: calc(100dvh - 55px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior-y: contain !important;
        touch-action: pan-y !important;
    }

    #screen-booth * {
        touch-action: pan-y;
    }

    #screen-booth .btn-brutalist,
    #screen-booth button {
        touch-action: manipulation !important;
    }

    #camera-feed {
        pointer-events: none !important;
    }

    #screen-booth > div:first-child {
        flex-grow: 0 !important;
        flex-shrink: 0 !important;
        height: 40vh !important;
        min-height: 220px !important;
        max-height: 380px !important;
    }

    #screen-booth > div:last-child {
        flex-shrink: 0 !important;
    }
}

/* PRINT MEDIA QUERY FOR DIRECT KIOSK PHOTOBOOTH PRINTER */
@media print {
    body {
        background: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    header, footer, nav, #kiosk-controls, .no-print, #screen-standby, #screen-payment, #screen-booth, #screen-retake-modal, #screen-editor {
        display: none !important;
    }

    #screen-result {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    #result-print-wrapper {
        display: block !important;
        width: 100vw !important;
        height: 100vh !important;
        margin: 0 !important;
        padding: 0 !important;
        page-break-inside: avoid;
    }

    #final-canvas {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        max-height: 100vh !important;
        object-fit: contain !important;
    }
}
