:root {
    --primary: #FFB7B2; /* Pastel Pink */
    --secondary: #E2F0CB; /* Pastel Green */
    --accent: #B5EAD7; /* Pastel Mint */
    --bg: #F9F6F0; /* Cream */
    --text: #111111;
    --border-color: #111111;
    --font: 'Outfit', sans-serif;
    
    /* Neo-Brutalist Variables */
    --border: 3px solid var(--border-color);
    --shadow: 5px 5px 0px var(--border-color);
    --shadow-hover: 2px 2px 0px var(--border-color);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: var(--font);
    background-color: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    /* Cute dot pattern */
    background-image: radial-gradient(var(--border-color) 1px, transparent 0);
    background-size: 25px 25px;
}

h1, h2, h3 { font-weight: 800; letter-spacing: -0.5px; }

/* Buttons */
.btn-start, .btn-primary, .btn-secondary {
    display: inline-block;
    padding: 1rem 2.5rem;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text);
    background-color: #fff;
    border: var(--border);
    border-radius: 8px;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.1s ease;
    text-decoration: none;
    text-transform: uppercase;
}
.btn-start:hover, .btn-primary:hover, .btn-secondary:hover {
    transform: translate(3px, 3px);
    box-shadow: var(--shadow-hover);
}
.btn-primary { background-color: var(--primary); }
.btn-secondary { background-color: var(--accent); }

/* Landing Page */
.landing-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}
.landing-container {
    text-align: center;
    background: #fff;
    padding: 4rem 5rem;
    border: var(--border);
    border-radius: 16px;
    box-shadow: 10px 10px 0px var(--border-color);
}
.landing-container h1 { font-size: 4rem; margin-bottom: 1rem; color: var(--text); }
.landing-container p { font-size: 1.4rem; margin-bottom: 2rem; font-weight: 600; color: var(--text); }

/* Photobooth App Screens */
.screen { display: none; height: 100vh; padding: 2rem; }
.screen.active { display: flex; flex-direction: column; align-items: center; }

/* Template List */
.template-list {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 2rem;
    max-width: 1600px;
}
.template-item {
    width: 220px;
    background: #fff;
    padding: 15px;
    border: var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}
.template-item p { margin-top: 10px; font-weight: 800; font-size: 1.1rem; }
.template-item img { 
    width: 100%; 
    border: 2px solid var(--border-color); 
    border-radius: 8px; 
    background: var(--bg);
}
.template-item:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0px var(--border-color); }
.template-item.selected { 
    background-color: var(--secondary); 
    transform: translate(3px, 3px); 
    box-shadow: var(--shadow-hover); 
}

/* Booth Layout */
.booth-layout {
    display: flex;
    width: 100%;
    max-width: 1600px;
    gap: 2.5rem;
    height: calc(100vh - 4rem);
}
.camera-section {
    flex: 1;
    position: relative;
    background: var(--border-color);
    border: var(--border);
    border-radius: 16px;
    box-shadow: 8px 8px 0px var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.camera-section video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}
.countdown-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12rem;
    color: var(--primary);
    -webkit-text-stroke: 4px var(--border-color);
    text-shadow: 6px 6px 0px var(--border-color);
    font-weight: 800;
    z-index: 10;
}
.btn-capture {
    position: absolute;
    bottom: 2rem;
    padding: 1rem 2.5rem;
    font-size: 1.4rem;
    font-weight: 800;
    border-radius: 12px;
    border: var(--border);
    background: var(--primary);
    color: var(--text);
    cursor: pointer;
    z-index: 10;
    box-shadow: var(--shadow);
    transition: all 0.1s;
    text-transform: uppercase;
}
.btn-capture:active { transform: translate(3px, 3px); box-shadow: var(--shadow-hover); }

/* Preview */
.preview-section {
    width: 420px;
    background: #fff;
    border: var(--border);
    border-radius: 16px;
    box-shadow: 8px 8px 0px var(--border-color);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    overflow: hidden;
}
.template-preview-container {
    flex: 1;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background: var(--bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    max-height: calc(100vh - 200px);
}
.template-preview-container canvas {
    width: 100%;
    height: 100%;
    max-height: calc(100vh - 250px);
    object-fit: contain;
    display: block;
}
.actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 15px;
    width: 100%;
}
.actions button { flex: 1; padding: 1rem 0; font-size: 1.1rem; }

/* Effects */
.flash-effect {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: white;
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    transition: opacity 0.1s;
}
.flash-effect.active { opacity: 1; }

.loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(249, 246, 240, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    font-weight: 800;
    color: var(--text);
    -webkit-text-stroke: 2px var(--text);
    text-shadow: 4px 4px 0px var(--primary);
    z-index: 10000;
}
.loading-overlay.active { display: flex; }

/* QR Result & Layout */
.result-layout {
    display: flex;
    gap: 4rem;
    align-items: center;
    justify-content: center;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
}
.result-preview {
    display: flex;
    justify-content: center;
    align-items: center;
}
.result-preview img {
    max-height: 75vh;
    border: var(--border);
    border-radius: 8px;
    box-shadow: 10px 10px 0px var(--border-color);
}
.result-details {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.qr-container {
    display: flex;
    gap: 2.5rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
}
.qr-item {
    text-align: center;
    background: #fff;
    padding: 2rem;
    border: var(--border);
    border-radius: 16px;
    box-shadow: 8px 8px 0px var(--border-color);
}
.qr-item p { margin-top: 1.5rem; font-weight: 800; font-size: 1.2rem;}
.qr-code { width: 200px; height: 200px; }
.qr-code img, .qr-code canvas { width: 100% !important; height: 100% !important; }

/* Admin UI */
.template-manager-layout {
    margin-top: 2rem;
    display: flex;
    gap: 2rem;
}

.admin-layout {
    display: flex;
    height: 100vh;
}
.admin-sidebar {
    width: 250px;
    background: var(--bg);
    padding: 2rem;
    border-right: var(--border);
    z-index: 10;
}
.admin-sidebar h2 { margin-bottom: 2rem; color: var(--text); font-size: 1.8rem;}
.admin-nav { list-style: none; }
.admin-nav li { margin-bottom: 1.2rem; }
.admin-nav a { 
    text-decoration: none; color: var(--text); font-weight: 800; 
    display: block; padding: 0.8rem; border: var(--border); 
    border-radius: 8px; background: #fff;
    box-shadow: 4px 4px 0px var(--border-color);
    transition: all 0.1s;
}
.admin-nav a:hover { 
    transform: translate(2px, 2px); 
    box-shadow: 2px 2px 0px var(--border-color); 
    background: var(--secondary);
}

.admin-content {
    flex: 1;
    padding: 3rem;
    overflow-y: auto;
    background: #fff;
}
.admin-login {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}
.login-box {
    background: var(--primary);
    padding: 3rem;
    border: var(--border);
    border-radius: 16px;
    box-shadow: 8px 8px 0px var(--border-color);
    width: 100%;
    max-width: 450px;
}
.login-box h2 { text-align: center; margin-bottom: 2rem; font-size: 2.5rem; }
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 800; font-size: 1.1rem;}
.form-control { 
    width: 100%; padding: 1rem; border: var(--border); 
    border-radius: 8px; font-family: var(--font); 
    font-weight: 600; font-size: 1.1rem;
}

/* Make inline elements look brutalist in admin */
.admin-content > div[style*="background:#fff"] {
    border: var(--border) !important;
    box-shadow: var(--shadow) !important;
    background: var(--bg) !important;
}

/* Custom Modal & SweetAlert2 */
div:where(.swal2-container) div:where(.swal2-popup) {
    border: var(--border);
    border-radius: 16px;
    box-shadow: 10px 10px 0px var(--border-color);
    background: var(--bg);
    font-family: var(--font);
}
div:where(.swal2-container) button:where(.swal2-styled) {
    border: var(--border) !important;
    box-shadow: 4px 4px 0px var(--border-color) !important;
    border-radius: 8px !important;
    font-family: var(--font) !important;
    font-weight: 800 !important;
    color: var(--text) !important;
    transition: all 0.1s !important;
}
div:where(.swal2-container) button:where(.swal2-styled):hover {
    transform: translate(2px, 2px) !important;
    box-shadow: 2px 2px 0px var(--border-color) !important;
}
div:where(.swal2-container) button:where(.swal2-confirm) {
    background-color: var(--primary) !important;
}
div:where(.swal2-container) button:where(.swal2-cancel) {
    background-color: #fff !important;
}

.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
.modal-content {
    background: var(--bg);
    border: var(--border);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    box-shadow: 10px 10px 0px var(--border-color);
    text-align: center;
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-content h3 {
    margin-bottom: 1rem;
    font-size: 1.8rem;
}
.modal-content p {
    margin-bottom: 2rem;
    font-size: 1.1rem;
    font-weight: 600;
}
.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}
.modal-actions button {
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    flex: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .booth-layout { flex-direction: column; height: auto; }
    .camera-section { height: 60vh; border-radius: 12px;}
    .preview-section { width: 100%; height: auto; border-radius: 12px;}
    
    .result-layout { flex-direction: column; gap: 2rem; padding: 1rem; }
    .result-preview img { max-height: 50vh; }
    .result-details { text-align: center; }
    .qr-container { flex-direction: row; gap: 1rem; justify-content: center; align-items: center; }
    
    .admin-layout { flex-direction: column; }
    .admin-sidebar { 
        position: fixed; bottom: 0; left: 0; width: 100%; height: auto; 
        padding: 0.8rem 0 0.5rem 0; background: #fff; 
        border-top: var(--border); border-right: none; border-bottom: none; 
        z-index: 9999; box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
    }
    .admin-sidebar h2 { display: none; }
    .admin-nav { display: flex; justify-content: space-around; gap: 0; }
    .admin-nav li { margin-bottom: 0; flex: 1; min-width: auto; }
    .admin-nav a { 
        display: flex; flex-direction: column; align-items: center; justify-content: center;
        padding: 0; font-size: 0.7rem; border: none; box-shadow: none; background: transparent; gap: 0.4rem; font-weight: 800;
    }
    .admin-nav a i { font-size: 1.4rem; }
    .admin-nav a:hover { transform: none; box-shadow: none; background: transparent; opacity: 0.7; }
    
    .admin-content { padding: 1rem; padding-bottom: 90px; }
    .btn-start, .btn-primary, .btn-secondary { padding: 0.6rem 1rem; font-size: 0.95rem; }
    .form-control { padding: 0.7rem; font-size: 1rem; }
    h1 { font-size: 1.8rem; margin-bottom: 1rem; }
    h3 { font-size: 1.4rem; }
    
    .template-manager-layout { flex-direction: column; gap: 1rem; }

    .countdown-overlay {
        font-size: 5rem;
        -webkit-text-stroke: 2px var(--border-color);
        text-shadow: 4px 4px 0px var(--border-color);
    }
}
