/* Style variables representing the design token system */
:root {
    --bg-dark: #0a0e17;
    --bg-card: #111827;
    --bg-card-header: #1f2937;
    --text-primary: #f3f4f6;
    --text-muted: #9ca3af;
    --border-color: rgba(255, 255, 255, 0.08);
    --primary-glow: rgba(59, 130, 246, 0.5);
    
    /* Elegant gradients */
    --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #047857 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    --gradient-dark: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    
    /* Animation timings */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Core resets & typography */
body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    letter-spacing: -0.011em;
}

h1, h2, h3, h4, h5, h6, .navbar-brand {
    font-family: 'Outfit', sans-serif;
}

/* Navigation bar */
.bg-premium {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.brand-icon-wrapper {
    background: rgba(59, 130, 246, 0.15);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.text-primary-gradient {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-muted-custom {
    color: var(--text-muted);
}

/* Custom indicator pill */
.bg-success-glow {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
}

.animate-pulse {
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0% { transform: scale(0.95); opacity: 0.5; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); opacity: 0.5; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Config panel */
.config-card {
    background-color: var(--bg-card) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 16px !important;
}

.bg-dark-custom {
    background-color: #0d131f !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: var(--text-primary) !important;
}

.bg-dark-custom:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25) !important;
    border-color: #3b82f6 !important;
}

.border-secondary-custom {
    border-color: rgba(255, 255, 255, 0.08) !important;
}

.bg-dark-custom-switch {
    background-color: #0d131f !important;
}

/* Custom premium buttons */
.btn-primary-gradient {
    background: var(--gradient-primary);
    border: none;
    color: white;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.btn-primary-gradient:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
    transform: translateY(-1px);
}

.btn-outline-light-custom {
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: transparent;
    color: var(--text-primary);
    transition: var(--transition-smooth);
}

.btn-outline-light-custom:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.btn-outline-danger-custom {
    border: 1px solid rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.05);
    color: #ef4444;
    transition: var(--transition-smooth);
}

.btn-outline-danger-custom:hover {
    background: #ef4444;
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* Scanner view finder styles */
.scanner-card, .results-card, .history-card {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 20px !important;
    overflow: hidden;
}

.scanner-viewfinder-wrapper {
    background-color: #070a10;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Scanner viewport target customization */
#reader {
    background-color: #070a10;
    border: none !important;
}

#reader video {
    border-radius: 8px;
    object-fit: cover;
}

/* Interactive elements from html5-qrcode library hidden or themed */
#reader__dashboard, #reader__header {
    display: none !important;
}

/* Corners for targeting */
.scanner-corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid #3b82f6;
    z-index: 10;
    pointer-events: none;
}

.top-left { top: 12px; left: 12px; border-right: none; border-bottom: none; border-top-left-radius: 4px; }
.top-right { top: 12px; right: 12px; border-left: none; border-bottom: none; border-top-right-radius: 4px; }
.bottom-left { bottom: 12px; left: 12px; border-right: none; border-top: none; border-bottom-left-radius: 4px; }
.bottom-right { bottom: 12px; right: 12px; border-left: none; border-top: none; border-bottom-right-radius: 4px; }

/* Glowing scanner line animation */
.scan-laser-line {
    position: absolute;
    height: 4px;
    width: calc(100% - 24px);
    left: 12px;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0) 0%, rgba(59, 130, 246, 1) 50%, rgba(59, 130, 246, 0) 100%);
    box-shadow: 0 0 10px #3b82f6, 0 0 20px #3b82f6;
    z-index: 5;
    animation: scan-laser 2.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes scan-laser {
    0% { top: 15px; }
    50% { top: calc(100% - 20px); }
    100% { top: 15px; }
}

.scanner-icon-bg {
    width: 80px;
    height: 80px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.1);
}

.file-upload-wrapper {
    background: rgba(255, 255, 255, 0.02);
    transition: var(--transition-smooth);
}

.file-upload-wrapper:hover {
    background: rgba(59, 130, 246, 0.05);
    border-color: #3b82f6 !important;
}

.border-dashed {
    border-style: dashed !important;
}

.cursor-pointer {
    cursor: pointer;
}

/* Results card animations and styles */
.result-state-view {
    transition: var(--transition-smooth);
}

.max-width-350 {
    max-width: 350px;
}

.max-width-400 {
    max-width: 400px;
}

/* Status icon wrapper */
.status-icon-wrapper {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-icon-wrapper.ready {
    background: rgba(156, 163, 175, 0.1);
    border: 1px solid rgba(156, 163, 175, 0.2);
}

.status-icon-wrapper.not-found {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Bounce & Shake micro-animations */
.animate-bounce {
    animation: simple-bounce 2s infinite;
}

@keyframes simple-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.animate-shake {
    animation: shake 0.6s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* Success profile styles */
.profile-card-container {
    width: 100%;
}

.bg-success-transparent {
    background: rgba(16, 185, 129, 0.08);
}

.border-success-custom {
    border: 1px solid rgba(16, 185, 129, 0.2) !important;
}

.text-success-light {
    color: #34d399;
}

.profile-avatar-frame {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(135deg, #3b82f6 0%, #10b981 100%);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.35);
}

.profile-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--bg-card);
}

.bg-dark-profile {
    background-color: #0d131f;
}

.font-label {
    letter-spacing: 0.05em;
}

.text-primary-light {
    color: #60a5fa;
}

.word-break-all {
    word-break: break-all;
}

.text-danger-light {
    color: #f87171;
}

.border-danger-custom {
    border: 1px solid rgba(239, 68, 68, 0.25) !important;
}

/* Skeleton Loading Screens */
.skeleton-avatar {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: linear-gradient(90deg, #1f2937 25%, #374151 50%, #1f2937 75%);
    background-size: 200% 100%;
    animation: skeleton-glow 1.5s infinite;
}

.skeleton-line {
    height: 16px;
    background: linear-gradient(90deg, #1f2937 25%, #374151 50%, #1f2937 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: skeleton-glow 1.5s infinite;
}

.skeleton-row {
    margin-top: 14px;
}

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

/* Custom Table Styles */
.table-custom {
    color: var(--text-primary) !important;
}

.table-custom th {
    background-color: #0d131f !important;
    color: var(--text-muted) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 12px 16px;
}

.table-custom td {
    background-color: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    padding: 14px 16px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.table-custom tr:hover td {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

/* Status circle indicators */
.status-circle {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-muted);
}

.status-circle.scanning {
    background-color: #3b82f6;
    box-shadow: 0 0 8px #3b82f6;
    animation: pulse-scanning 1.5s infinite;
}

@keyframes pulse-scanning {
    0% { transform: scale(0.9); opacity: 0.6; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.6; }
}

/* Utility styles */
.btn-xs {
    font-size: 0.75rem;
    padding: 2px 8px;
}
