/* ==============================================================================
   SCANNER INTERFACE STYLING
   Optimized for Fast Mobile & Desktop QR Attendance
   ============================================================================== */

.scanner-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.scanner-header {
    text-align: center;
    padding: 1.25rem 0.5rem;
    position: relative;
}

.scanner-app-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--secondary);
    letter-spacing: -0.02em;
}

.scanner-prayer-box {
    margin-top: 0.75rem;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px var(--primary-glow);
    animation: glowPulse 2.5s infinite;
}

@keyframes glowPulse {
    0% { box-shadow: 0 10px 25px var(--primary-glow); }
    50% { box-shadow: 0 10px 30px rgba(16, 185, 129, 0.45); }
    100% { box-shadow: 0 10px 25px var(--primary-glow); }
}

.scanner-prayer-name {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.scanner-prayer-time {
    font-size: 0.875rem;
    opacity: 0.9;
    font-weight: 500;
}

.scanner-prayer-inactive {
    background: #475569;
    box-shadow: none;
    animation: none;
}

/* Camera Viewport Wrapper */
.camera-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 380px;
    background: #0f172a;
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin: 1rem 0;
    box-shadow: var(--shadow-xl);
    border: 3px solid #1e293b;
}

#reader {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
}

#reader video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Laser Scan Animation Overlay */
.scan-overlay-frame {
    position: absolute;
    top: 15%;
    left: 15%;
    right: 15%;
    bottom: 15%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-md);
    pointer-events: none;
    z-index: 5;
}

.scan-overlay-frame::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 3px solid transparent;
    border-top-color: var(--primary);
    border-bottom-color: var(--primary);
    border-radius: var(--radius-md);
}

.laser-beam {
    position: absolute;
    left: 5%;
    right: 5%;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, #10b981 50%, transparent 100%);
    box-shadow: 0 0 12px #10b981, 0 0 4px #ffffff;
    top: 10%;
    animation: laserScan 2s infinite ease-in-out;
    z-index: 6;
}

@keyframes laserScan {
    0% { top: 10%; opacity: 0.8; }
    50% { top: 90%; opacity: 1; }
    100% { top: 10%; opacity: 0.8; }
}

/* Result Overlay Popups */
.scan-result-card {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 20;
    padding: 1.5rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.scan-result-card.success {
    display: flex;
    background: rgba(6, 95, 70, 0.96);
    color: #ffffff;
}

.scan-result-card.duplicate {
    display: flex;
    background: rgba(30, 64, 175, 0.96);
    color: #ffffff;
}

.scan-result-card.warning {
    display: flex;
    background: rgba(146, 64, 14, 0.96);
    color: #ffffff;
}

.scan-result-card.error {
    display: flex;
    background: rgba(153, 27, 27, 0.96);
    color: #ffffff;
}

.result-icon {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    animation: bounceIcon 0.5s ease-out;
}

@keyframes bounceIcon {
    0% { transform: scale(0); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.result-status-title {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.result-santri-name {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 0.2rem;
    line-height: 1.2;
}

.result-santri-code {
    font-size: 0.9rem;
    opacity: 0.85;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.result-prayer-name {
    font-size: 1.15rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 1rem;
    border-radius: var(--radius-full);
    margin-bottom: 0.5rem;
}

.result-time-text {
    font-size: 1.1rem;
    font-weight: 600;
}

.result-msg-text {
    font-size: 0.95rem;
    margin-top: 0.5rem;
    opacity: 0.9;
}

/* Scanner Controls */
.scanner-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 0.5rem 0;
}

.scanner-tip {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 0.5rem;
}

.scanner-tip i {
    color: var(--primary);
}

/* Recent Scans Strip */
.recent-scans-strip {
    margin-top: auto;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}

.strip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.recent-scans-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.recent-scan-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
    background: var(--bg-main);
}
