/* =============================================
   Photobooth Web Application — Main Stylesheet
   Dark Theme + Glassmorphism + Responsive
   ============================================= */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── CSS Custom Properties ────────────────── */
:root {
    /* Colors - Dark Palette */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-glass: rgba(255, 255, 255, 0.06);
    --bg-glass-hover: rgba(255, 255, 255, 0.1);
    --bg-glass-border: rgba(255, 255, 255, 0.08);

    /* Accent Colors */
    --accent-primary: #7c3aed;
    --accent-primary-light: #a78bfa;
    --accent-secondary: #06b6d4;
    --accent-gradient: linear-gradient(135deg, #7c3aed, #06b6d4);
    --accent-gradient-hover: linear-gradient(135deg, #6d28d9, #0891b2);
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --accent-danger-hover: #dc2626;

    /* Text */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-white: #ffffff;

    /* 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;

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

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(124, 58, 237, 0.3);
    --shadow-glow-cyan: 0 0 30px rgba(6, 182, 212, 0.3);

    /* Font */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Z-index layers */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-tooltip: 600;
    --z-toast: 700;
}

/* ── Reset & Base ─────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

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

/* Animated background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse 600px 400px at 20% 30%, rgba(124, 58, 237, 0.08), transparent),
        radial-gradient(ellipse 500px 300px at 80% 70%, rgba(6, 182, 212, 0.06), transparent);
    pointer-events: none;
    z-index: 0;
}

a {
    color: var(--accent-primary-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-secondary);
}

img {
    max-width: 100%;
    height: auto;
}

/* ── Typography ───────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-white);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Layout ───────────────────────────────── */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    position: relative;
    z-index: 1;
}

.container-fluid {
    width: 100%;
    padding: 0 var(--space-lg);
    position: relative;
    z-index: 1;
}

.page-wrapper {
    min-height: calc(100vh - 80px);
    padding: var(--space-2xl) 0;
}

/* ── Navigation ───────────────────────────── */
.navbar {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--bg-glass-border);
    padding: var(--space-md) 0;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-white) !important;
}

.navbar-brand .brand-icon {
    width: 36px;
    height: 36px;
    background: var(--accent-gradient);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    list-style: none;
}

.navbar-nav a {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.navbar-nav a:hover,
.navbar-nav a.active {
    color: var(--text-white);
    background: var(--bg-glass);
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--space-xs);
}

/* ── Cards ────────────────────────────────── */
.card {
    background: var(--bg-glass);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: rgba(124, 58, 237, 0.3);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.card-body {
    padding: var(--space-lg);
}

.card-img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-bottom: 1px solid var(--bg-glass-border);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-lg);
}

/* ── Buttons ──────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.7rem 1.4rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0);
    transition: background var(--transition-fast);
    pointer-events: none;
}

.btn:hover::after {
    background: rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--accent-gradient);
    color: var(--text-white);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.6);
}

.btn-secondary {
    background: var(--bg-glass);
    color: var(--text-primary);
    border: 1px solid var(--bg-glass-border);
}

.btn-secondary:hover {
    background: var(--bg-glass-hover);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-success {
    background: var(--accent-success);
    color: var(--text-white);
}

.btn-danger {
    background: var(--accent-danger);
    color: var(--text-white);
}

.btn-danger:hover {
    background: var(--accent-danger-hover);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.05rem;
    border-radius: var(--radius-md);
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-sm);
}

.btn-group {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

/* ── Forms ─────────────────────────────────── */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--space-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-glass);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    outline: none;
}

.form-control:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

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

.form-control-file {
    padding: var(--space-xl);
    border: 2px dashed var(--bg-glass-border);
    border-radius: var(--radius-lg);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    background: var(--bg-glass);
}

.form-control-file:hover {
    border-color: var(--accent-primary);
    background: rgba(124, 58, 237, 0.05);
}

.form-control-file.dragover {
    border-color: var(--accent-primary);
    background: rgba(124, 58, 237, 0.1);
}

/* ── Badges & Tags ────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-warning);
}

.badge-info {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-secondary);
}

/* ── Alerts / Toast ───────────────────────── */
.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    animation: slideDown 0.3s ease;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--accent-success);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--accent-danger);
}

.alert-info {
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: var(--accent-secondary);
}

/* Toast notification */
.toast-container {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    min-width: 300px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
    animation: slideInRight 0.4s ease;
}

/* ── Modal ─────────────────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: var(--z-modal-backdrop);
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-backdrop.active {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-xl);
    width: 95%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.3s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--bg-glass-border);
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 700;
}

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

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

.modal-body {
    padding: var(--space-xl);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding: var(--space-lg) var(--space-xl);
    border-top: 1px solid var(--bg-glass-border);
}

/* ── Admin: Login Page ────────────────────── */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-glass);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(20px);
    padding: var(--space-3xl) var(--space-2xl);
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.login-header .icon {
    width: 64px;
    height: 64px;
    background: var(--accent-gradient);
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: var(--space-md);
    box-shadow: var(--shadow-glow);
}

.login-header h1 {
    font-size: 1.6rem;
    margin-bottom: var(--space-xs);
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ── Admin: Dashboard ─────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-2xl);
    flex-wrap: wrap;
    gap: var(--space-md);
    position: sticky;
    top: 70px;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: var(--z-sticky);
    padding: var(--space-md) var(--space-lg);
    margin-left: calc(var(--space-lg) * -1);
    margin-right: calc(var(--space-lg) * -1);
    border-bottom: 1px solid var(--bg-glass-border);
}

.page-header h1 {
    font-size: 1.8rem;
}

.stats-bar {
    display: flex;
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
    flex-wrap: wrap;
}

.stat-card {
    flex: 1;
    min-width: 160px;
    background: var(--bg-glass);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    backdrop-filter: blur(10px);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.frame-card .card-img-wrapper {
    position: relative;
    overflow: hidden;
    background: repeating-conic-gradient(#1a1a2e 0% 25%, #12121a 0% 50%) 50% / 20px 20px;
}

.frame-card .card-img-wrapper img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    padding: var(--space-sm);
}

.frame-card .frame-status {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
}

.frame-card .frame-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.frame-card .frame-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ── Admin: Frame Editor ──────────────────── */
.editor-wrapper {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--space-lg);
    align-items: start;
}

.editor-canvas-area {
    background: var(--bg-glass);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    position: relative;
    overflow: hidden;
}

.editor-canvas-area canvas {
    display: block;
    margin: 0 auto;
    border-radius: var(--radius-sm);
}

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

.editor-panel {
    background: var(--bg-glass);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.editor-panel h3 {
    font-size: 1rem;
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.slot-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.slot-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    transition: background var(--transition-fast);
}

.slot-list-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.slot-list-item .slot-num {
    width: 24px;
    height: 24px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

/* ── Admin: Publish Panel ─────────────────── */
.publish-url-box {
    background: rgba(0, 0, 0, 0.3);
    padding: var(--space-md);
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--accent-secondary);
    word-break: break-all;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.qr-code-wrapper {
    text-align: center;
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: white;
    border-radius: var(--radius-md);
    display: inline-block;
}

/* ── User: Booth Page ─────────────────────── */
.booth-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

.booth-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.booth-header h1 {
    font-size: 2rem;
    margin-bottom: var(--space-sm);
}

.booth-header p {
    color: var(--text-muted);
}

.booth-frame-container {
    position: relative;
    width: 100%;
    margin: 0 auto var(--space-2xl);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: repeating-conic-gradient(#1a1a2e 0% 25%, #12121a 0% 50%) 50% / 20px 20px;
}

.booth-frame-container .frame-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.booth-frame-container .frame-overlay img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.booth-slot {
    position: absolute;
    cursor: pointer;
    border: 2px dashed rgba(124, 58, 237, 0.5);
    background: rgba(124, 58, 237, 0.05);
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 5;
}

.booth-slot:hover {
    border-color: var(--accent-primary);
    background: rgba(124, 58, 237, 0.15);
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.2);
}

.booth-slot.filled {
    border-color: var(--accent-success);
    background: transparent;
}

.booth-slot .slot-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    color: var(--text-muted);
    font-size: 0.8rem;
    pointer-events: none;
}

.booth-slot .slot-label .icon {
    font-size: 2rem;
    opacity: 0.5;
}

.booth-slot .slot-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.booth-slot .slot-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: var(--accent-danger);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 0.7rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 15;
    pointer-events: auto;
}

.booth-slot:hover .slot-remove,
.booth-slot.filled .slot-remove {
    display: flex;
}

.booth-actions {
    text-align: center;
    margin-top: var(--space-xl);
}

/* ── User: Camera Modal ───────────────────── */
.camera-container {
    position: relative;
    width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #000;
    aspect-ratio: 4/3;
}

.camera-container video,
.camera-container canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mirror {
    transform: scaleX(-1);
}

.camera-controls {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    margin-top: var(--space-md);
}

.camera-btn-capture {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 4px solid var(--text-white);
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
}

.camera-btn-capture::after {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: var(--accent-danger);
    transition: all var(--transition-fast);
}

.camera-btn-capture:hover::after {
    background: #ff0000;
    transform: scale(1.1);
}

.camera-btn-switch {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--bg-glass);
    color: var(--text-white);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
}

/* ── Filter Bar ───────────────────────────── */
.filter-bar {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-md) 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.filter-bar::-webkit-scrollbar {
    display: none;
}

.filter-option {
    flex-shrink: 0;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-option .filter-preview {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid transparent;
    margin-bottom: var(--space-xs);
    transition: border-color var(--transition-fast);
}

.filter-option .filter-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.filter-option.active .filter-preview {
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.5);
}

.filter-option .filter-name {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.filter-option.active .filter-name {
    color: var(--accent-primary-light);
}

/* ── User: Cropper Area ───────────────────── */
.cropper-area {
    position: relative;
    width: 100%;
    max-height: 400px;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: #000;
}

.cropper-area img {
    max-width: 100%;
    display: block;
}

/* ── User: Result Page ────────────────────── */
.result-wrapper {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.result-image-container {
    margin-bottom: var(--space-2xl);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: repeating-conic-gradient(#1a1a2e 0% 25%, #12121a 0% 50%) 50% / 20px 20px;
}

.result-image-container img {
    width: 100%;
    display: block;
}

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

/* ── Loading / Spinner ────────────────────── */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    backdrop-filter: blur(8px);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--bg-glass-border);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    margin-top: var(--space-md);
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.progress-bar-wrapper {
    width: 200px;
    height: 4px;
    background: var(--bg-glass);
    border-radius: var(--radius-full);
    margin-top: var(--space-md);
    overflow: hidden;
}

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

/* ── Empty State ──────────────────────────── */
.empty-state {
    text-align: center;
    padding: var(--space-3xl) var(--space-xl);
    color: var(--text-muted);
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.empty-state p {
    font-size: 0.9rem;
}

/* ── Divider ──────────────────────────────── */
.divider {
    width: 100%;
    height: 1px;
    background: var(--bg-glass-border);
    margin: var(--space-lg) 0;
}

/* ── Utility Classes ──────────────────────── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--accent-success); }
.text-danger { color: var(--accent-danger); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.mt-1 { margin-top: var(--space-md); }
.mt-2 { margin-top: var(--space-xl); }
.mb-1 { margin-bottom: var(--space-md); }
.mb-2 { margin-bottom: var(--space-xl); }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-md); }
.gap-sm { gap: var(--space-sm); }
.flex-wrap { flex-wrap: wrap; }
.hidden { display: none !important; }

/* ── Animations ───────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

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

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

.animate-fadeIn { animation: fadeIn 0.5s ease; }
.animate-slideUp { animation: slideUp 0.5s ease; }
.animate-pulse { animation: pulse 2s infinite; }

/* ── Cropper.js Overrides ─────────────────── */
.cropper-view-box,
.cropper-face {
    border-radius: 0 !important;
}

.cropper-point.point-se {
    width: 10px !important;
    height: 10px !important;
}

/* ── QR Code ──────────────────────────────── */
#qr-code-canvas {
    background: white;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    display: inline-block;
}

/* ── Responsive: Tablet (max-width: 1024px) ─ */
@media (max-width: 1024px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.6rem; }

    .editor-wrapper {
        grid-template-columns: 1fr;
    }

    .editor-sidebar {
        order: -1;
    }

    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

/* ── Responsive: Mobile (max-width: 768px) ── */
@media (max-width: 768px) {
    html { font-size: 15px; }
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.3rem; }
    h3 { font-size: 1.2rem; }

    .container {
        padding: 0 var(--space-md);
    }

    .page-wrapper {
        padding: var(--space-lg) 0;
    }

    .navbar-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(10, 10, 15, 0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: var(--space-md);
        border-bottom: 1px solid var(--bg-glass-border);
    }

    .navbar-nav.show {
        display: flex;
    }

    .navbar-toggle {
        display: block;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        margin-left: calc(var(--space-md) * -1);
        margin-right: calc(var(--space-md) * -1);
        padding: var(--space-md);
        top: 60px;
    }

    .stats-bar {
        flex-direction: column;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: var(--space-2xl) var(--space-lg);
    }

    .modal {
        width: 75%;
    }

    .modal-body {
        padding: var(--space-md);
    }

    .booth-header h1 {
        font-size: 1.4rem;
    }

    .result-actions {
        flex-direction: column;
    }

    .btn-lg {
        padding: 0.85rem 1.5rem;
        font-size: 1rem;
    }

    .filter-option .filter-preview {
        width: 48px;
        height: 48px;
    }
}

/* ── Responsive: Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    html { font-size: 14px; }

    .container {
        padding: 0 var(--space-sm);
    }

    .login-card {
        padding: var(--space-xl) var(--space-md);
    }

    .btn-group {
        flex-direction: column;
    }

    .camera-btn-capture {
        width: 56px;
        height: 56px;
    }
}

/* ── Scrollbar Styling ────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ── Selection ────────────────────────────── */
::selection {
    background: rgba(124, 58, 237, 0.4);
    color: var(--text-white);
}

/* ── Print ────────────────────────────────── */
@media print {
    body::before,
    .navbar,
    .booth-actions,
    .result-actions {
        display: none !important;
    }
}

/* ── Home Page ────────────────────────────── */
.home-hero {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-3xl) var(--space-lg);
}

.home-hero .hero-icon {
    font-size: 5rem;
    margin-bottom: var(--space-xl);
    animation: pulse 3s infinite;
}

.home-hero h1 {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

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

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

.booth-grid .card {
    cursor: pointer;
}

.booth-grid .card:hover {
    transform: translateY(-4px);
}

@media (max-width: 768px) {
    .home-hero h1 { font-size: 2rem; }
    .home-hero p { font-size: 1rem; }
    .booth-grid { grid-template-columns: 1fr; }
}
