/* style.css - Premium Dark Mode & Glassmorphic Design System */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg-main: #0b0f19;
    --bg-card: rgba(17, 24, 39, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(6, 182, 212, 0.4);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --color-accent: #06b6d4;      /* Cyan */
    --color-accent-rgb: 6, 182, 212;
    --color-success: #10b981;     /* Emerald */
    --color-success-rgb: 16, 185, 129;
    --color-warning: #f59e0b;     /* Amber */
    --color-error: #ef4444;       /* Rose */
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 20px rgba(6, 182, 212, 0.25);
    --shadow-success-glow: 0 0 20px rgba(16, 185, 129, 0.25);
    
    --transition-all: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background-image: 
        radial-gradient(at 0% 0%, rgba(6, 182, 212, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.05) 0px, transparent 50%);
}

/* Header & Navigation */
header {
    background: rgba(11, 15, 25, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-success) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-icon {
    width: 2rem;
    height: 2rem;
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-success) 100%);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.logo-icon::before {
    content: '';
    width: 0.75rem;
    height: 0.75rem;
    border: 2px solid #0b0f19;
    border-radius: 50%;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: var(--transition-all);
    border: 1px solid transparent;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.nav-link.active {
    color: var(--color-accent);
    background: rgba(6, 182, 212, 0.08);
    border-color: rgba(6, 182, 212, 0.15);
}

/* Main Layout */
main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2.5rem 2rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

@media (min-width: 1024px) {
    main.grid-split {
        grid-template-columns: 1.2fr 0.8fr;
    }
}

/* Card / Glassmorphism Panel */
.panel {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    transition: border-color 0.3s ease;
    overflow: hidden;
}

.panel:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.panel-header {
    margin-bottom: 1.5rem;
}

.panel-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* Camera Kiosk Frame */
.camera-kiosk {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    background: #060913;
    border-radius: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.6);
}

.camera-kiosk video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* Mirror camera stream */
}

.camera-kiosk canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    transform: scaleX(-1); /* Mirror canvas to align with mirrored video */
}

/* Kiosk Overlay & Scanners */
.scanner-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
    box-shadow: 0 0 12px var(--color-accent);
    z-index: 8;
    animation: scan 3s ease-in-out infinite;
    pointer-events: none;
}

.scanner-target {
    position: absolute;
    top: 15%;
    left: 15%;
    right: 15%;
    bottom: 15%;
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 1.5rem;
    pointer-events: none;
    z-index: 8;
    transition: var(--transition-all);
}

.scanner-target.active {
    border-color: var(--color-accent);
    box-shadow: 0 0 25px rgba(6, 182, 212, 0.1);
}

.scanner-target.success {
    border-color: var(--color-success);
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.1);
}

/* Custom overlay prompts inside video frame */
.camera-prompt {
    position: absolute;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1.25rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    z-index: 15;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-md);
}

.pulse-dot {
    width: 0.5rem;
    height: 0.5rem;
    background-color: var(--color-accent);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

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

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-family: inherit;
    transition: var(--transition-all);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-accent);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.15);
}

/* Button System */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    transition: var(--transition-all);
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-accent) 0%, #0891b2 100%);
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    box-shadow: 0 0 25px rgba(6, 182, 212, 0.4);
    transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none !important;
    transform: none !important;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 15, 25, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: opacity 0.4s ease;
    gap: 1.5rem;
}

.spinner {
    width: 3rem;
    height: 3rem;
    border: 3px solid rgba(6, 182, 212, 0.1);
    border-top: 3px solid var(--color-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
}

.loading-subtext {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 1000;
    max-width: 380px;
    width: calc(100vw - 4rem);
}

.toast {
    background: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: var(--transition-all);
}

.toast-success {
    border-left: 4px solid var(--color-success);
}

.toast-error {
    border-left: 4px solid var(--color-error);
}

.toast-warning {
    border-left: 4px solid var(--color-warning);
}

.toast-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
}

.toast-msg {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Table Style */
.table-wrapper {
    overflow-x: auto;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

th {
    background: rgba(255, 255, 255, 0.02);
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
}

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

/* Kiosk Feedback Overlays (Success/Error checkmark animations) */
.kiosk-flash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 80;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.kiosk-flash.flash-success {
    background: rgba(16, 185, 129, 0.15);
    box-shadow: inset 0 0 100px rgba(16, 185, 129, 0.3);
}

.kiosk-flash.flash-error {
    background: rgba(239, 68, 68, 0.15);
    box-shadow: inset 0 0 100px rgba(239, 68, 68, 0.3);
}

.kiosk-flash-icon {
    font-size: 4rem;
    transform: scale(0.5);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.kiosk-flash.show {
    opacity: 1;
    pointer-events: auto;
}

.kiosk-flash.show .kiosk-flash-icon {
    transform: scale(1);
}

.kiosk-flash-text {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 1rem;
    text-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

/* Animations */
@keyframes scan {
    0%, 100% { top: 0%; }
    50% { top: 99%; }
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.5; }
    50% { transform: scale(1); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.5; }
}

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

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

/* Alert fallback */
.alert-error-banner {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
