/* ============================================
   LPR Tecno — Dark Theme Design System
   ============================================ */

/* --- CSS Variables --- */
:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.85);
    --bg-glass: rgba(17, 24, 39, 0.6);
    --border-glass: rgba(255, 255, 255, 0.08);
    --accent: #00e676;
    --accent-soft: rgba(0, 230, 118, 0.12);
    --accent-hover: #00c853;
    --text-primary: #e8eaed;
    --text-muted: #9ca3af;
    --danger: #ff5252;
    --warning: #ffab00;
    --success: #00e676;
    --info: #40c4ff;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Global --- */
* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* --- Glass Card --- */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.glass-card:hover {
    border-color: rgba(0, 230, 118, 0.15);
    box-shadow: 0 8px 40px rgba(0, 230, 118, 0.06);
}

/* --- Glass Navbar --- */
.glass-nav {
    background: rgba(10, 14, 23, 0.85) !important;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border-glass);
    padding: 0.6rem 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.glass-nav .navbar-brand {
    font-size: 1.3rem;
    letter-spacing: -0.5px;
}

.glass-nav .nav-link {
    color: var(--text-muted);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.9rem;
}

.glass-nav .nav-link:hover,
.glass-nav .nav-link.active {
    color: var(--accent);
    background: var(--accent-soft);
}

/* --- Accent Color System --- */
.text-accent { color: var(--accent) !important; }
.bg-accent-soft {
    background: var(--accent-soft) !important;
}
.bg-success-soft { background: rgba(0, 230, 118, 0.1) !important; }
.bg-danger-soft { background: rgba(255, 82, 82, 0.1) !important; }
.bg-info-soft { background: rgba(64, 196, 255, 0.1) !important; }

.btn-accent {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #000;
    border: none;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    text-transform: none;
    letter-spacing: 0;
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 230, 118, 0.3);
    color: #000;
}

.btn-accent:active {
    transform: translateY(0);
}

.btn-outline-accent {
    color: var(--accent);
    border-color: var(--accent);
    background: transparent;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-outline-accent:hover,
.btn-outline-accent.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

/* --- Role Badges --- */
.bg-role-admin {
    background: linear-gradient(135deg, #e040fb, #7c4dff) !important;
}

.bg-role-user {
    background: linear-gradient(135deg, #40c4ff, #448aff) !important;
}

/* --- Icon Circle --- */
.icon-circle {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* --- Main Content --- */
.main-content {
    min-height: calc(100vh - 140px);
}

/* --- Footer --- */
.footer-bar {
    border-top: 1px solid var(--border-glass);
    background: var(--bg-secondary);
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-body {
    background: linear-gradient(135deg, #0a0e17 0%, #0d1b2a 50%, #1b2838 100%);
    min-height: 100vh;
    overflow: hidden;
}

.login-bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.06;
    animation: float 20s ease-in-out infinite;
}

.shape-1 {
    width: 600px;
    height: 600px;
    background: var(--accent);
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: #7c4dff;
    bottom: -150px;
    left: -100px;
    animation-delay: -5s;
}

.shape-3 {
    width: 300px;
    height: 300px;
    background: #40c4ff;
    top: 50%;
    left: 50%;
    animation-delay: -10s;
}

.shape-4 {
    width: 250px;
    height: 250px;
    background: #e040fb;
    top: 30%;
    right: 20%;
    animation-delay: -15s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
    25% { transform: translate(50px, -50px) rotate(5deg) scale(1.05); }
    50% { transform: translate(-30px, 60px) rotate(-3deg) scale(0.95); }
    75% { transform: translate(40px, 30px) rotate(4deg) scale(1.02); }
}

.login-card {
    position: relative;
    z-index: 1;
    background: var(--bg-glass);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.login-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    background: linear-gradient(135deg, var(--accent), #00c853);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #000;
    box-shadow: 0 8px 32px rgba(0, 230, 118, 0.25);
}

.login-title {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.login-card .form-control {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.login-card .form-control:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 230, 118, 0.15);
    color: #fff;
}

/* ============================================
   CAMERA & CAPTURE
   ============================================ */
.camera-wrapper {
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
}

.camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.scan-frame {
    width: 70%;
    max-width: 350px;
    height: 80px;
    border: 2px solid var(--accent);
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(0, 230, 118, 0.15);
    animation: scan-pulse 2s ease-in-out infinite;
}

@keyframes scan-pulse {
    0%, 100% { opacity: 0.5; transform: scaleX(1); }
    50% { opacity: 1; transform: scaleX(1.02); }
}

.capture-btn {
    border-radius: 50px !important;
    padding: 0.8rem 2.5rem !important;
}

.capture-btn:hover {
    transform: translateY(-3px) scale(1.02);
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.upload-zone:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

/* AI Spinner */
.ai-spinner {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-ring::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    right: 6px;
    bottom: 6px;
    border: 3px solid transparent;
    border-top-color: var(--info);
    border-radius: 50%;
    animation: spin 1.5s linear infinite reverse;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

/* Result */
.result-plate {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 2px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 0.8rem 1.5rem;
    text-align: center;
}

.plate-number {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 4px;
    color: var(--accent);
    text-shadow: 0 0 20px rgba(0, 230, 118, 0.3);
}

.result-field {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 0.5rem 0.8rem;
}

/* ============================================
   RECORDS
   ============================================ */
.record-card {
    overflow: hidden;
    transition: var(--transition);
}

.record-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.record-img-wrapper {
    position: relative;
    height: 160px;
    overflow: hidden;
    background: #000;
}

.record-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.record-card:hover .record-img {
    transform: scale(1.05);
}

.record-plate-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 230, 118, 0.9);
    color: #000;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    letter-spacing: 1px;
}

.record-plate-badge.bg-secondary {
    background: rgba(156, 163, 175, 0.8) !important;
    color: #fff;
}

/* Admin Table */
.record-thumb {
    width: 50px;
    height: 35px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border-glass);
    transition: var(--transition);
}

.record-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* ============================================
   STAT CARDS
   ============================================ */
.stat-card {
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-custom {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    min-width: 300px;
    animation: toast-slide-in 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-custom.toast-success { border-left: 4px solid var(--success); }
.toast-custom.toast-error { border-left: 4px solid var(--danger); }
.toast-custom.toast-info { border-left: 4px solid var(--info); }
.toast-custom.toast-warning { border-left: 4px solid var(--warning); }

@keyframes toast-slide-in {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .login-card {
        margin: 1rem;
        padding: 1.8rem;
    }

    .plate-number {
        font-size: 1.3rem;
        letter-spacing: 2px;
    }

    .glass-nav .navbar-brand {
        font-size: 1.1rem;
    }

    .stat-card h3 {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .scan-frame {
        width: 85%;
        height: 60px;
    }

    .record-img-wrapper {
        height: 130px;
    }
}

/* ============================================
   TABLE OVERRIDES (Dark)
   ============================================ */
.table-dark {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: rgba(255, 255, 255, 0.03);
}

.table-dark thead tr {
    border-bottom: 1px solid var(--border-glass);
}

.table-dark td, .table-dark th {
    border-color: var(--border-glass);
    padding: 0.7rem;
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Modal overrides */
.modal-content {
    border-radius: var(--radius) !important;
}
