/* Global Styles */
:root {
    --primary-color: #0d6efd;
    --primary-hover: #0b5ed7;
    --dark-surface: #1e293b;
    --scanner-border: #38bdf8;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #334155;
    background-color: #f8fafc;
}

/* Card Styling */
.card {
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

.card-header {
    background-color: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    padding: 1rem 1.25rem;
    font-weight: 600;
}

/* Dashboard Metric Cards */
.stat-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 0.75rem;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Scanner Viewport */
.scanner-container {
    position: relative;
    background-color: #0f172a;
    border-radius: 0.75rem;
    overflow: hidden;
    min-height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#cameraVideo {
    width: 100%;
    height: 100%;
    max-height: 420px;
    object-fit: cover;
    transform: scaleX(1); /* standard camera */
}

/* Scanner Target Framing Overlay */
.scanner-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 85%;
    max-width: 450px;
    height: 70%;
    max-height: 270px;
    border: 2px dashed rgba(56, 189, 248, 0.8);
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.55);
    pointer-events: none;
    z-index: 10;
}

/* Corner highlights on viewfinder */
.scanner-corner {
    position: absolute;
    width: 24px;
    height: 24px;
    border-color: #38bdf8;
    border-style: solid;
}

.corner-tl { top: -2px; left: -2px; border-width: 4px 0 0 4px; border-top-left-radius: 10px; }
.corner-tr { top: -2px; right: -2px; border-width: 4px 4px 0 0; border-top-right-radius: 10px; }
.corner-bl { bottom: -2px; left: -2px; border-width: 0 0 4px 4px; border-bottom-left-radius: 10px; }
.corner-br { bottom: -2px; right: -2px; border-width: 0 4px 4px 0; border-bottom-right-radius: 10px; }

/* Laser Scanner Bar */
.scanner-laser {
    position: absolute;
    left: 5%;
    right: 5%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #38bdf8, #0ea5e9, transparent);
    box-shadow: 0 0 10px #38bdf8;
    animation: scanAnim 2.5s infinite ease-in-out;
    z-index: 12;
}

@keyframes scanAnim {
    0% { top: 10%; opacity: 0.2; }
    50% { top: 90%; opacity: 1; }
    100% { top: 10%; opacity: 0.2; }
}

/* File Drop Zone */
.dropzone-box {
    border: 2px dashed #cbd5e1;
    border-radius: 0.75rem;
    padding: 2.5rem 1.5rem;
    text-align: center;
    background-color: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.dropzone-box:hover, .dropzone-box.drag-over {
    border-color: #0d6efd;
    background-color: #eff6ff;
}

/* Image preview thumbnails */
.license-preview-thumb {
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #e2e8f0;
}

/* Status Badges */
.badge-active {
    background-color: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.badge-expired {
    background-color: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.badge-expiring {
    background-color: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

/* Table Enhancements */
.table th {
    font-weight: 600;
    color: #475569;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background-color: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

.table td {
    vertical-align: middle;
    font-size: 0.95rem;
}

/* Field auto-fill animation */
.form-control, .form-select {
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

/* OCR Assistant styling */
#ocrLinesContainer > div:hover {
    background-color: #f1f5f9;
}
