/* Scanner Container */
.scanner-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.scanner-header {
    text-align: center;
    margin-bottom: 30px;
}

.scanner-title {
    font-size: 2rem;
    font-weight: 700;
    color: #212529;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.scanner-title i {
    font-size: 2.5rem;
    color: #0d6efd;
}

/* Video Wrapper */
.video-wrapper {
    position: relative;
    width: 100%;
    max-width: 640px;
    height: 480px;
    margin: 0 auto 30px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

#scannerVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Scan Line Animation */
.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #0d6efd, transparent);
    box-shadow: 0 0 10px #0d6efd;
    animation: scan 2s linear infinite;
    display: none;
}

@keyframes scan {
    0% {
        top: 0;
    }
    100% {
        top: 100%;
    }
}

.video-wrapper.scanning .scan-line {
    display: block;
}

/* Controls */
.controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 30px;
}

.controls .btn {
    padding: 12px 32px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.controls .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.controls .btn i {
    font-size: 1.2rem;
}

/* Result Section */
.result-section {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 2px solid #4caf50;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
    text-align: center;
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #2e7d32;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.result-header i {
    font-size: 1.5rem;
}

.result-code {
    font-family: 'Courier New', monospace;
    font-size: 1.8rem;
    font-weight: bold;
    color: #1b5e20;
    word-break: break-all;
    background: rgba(255, 255, 255, 0.7);
    padding: 16px;
    border-radius: 8px;
}

/* Debug Section */
.debug-section {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
}

.debug-header {
    font-weight: 600;
    color: #495057;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.debug-log {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #6c757d;
    line-height: 1.6;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
    background: #fff;
    padding: 12px;
    border-radius: 8px;
}

/* Modal Customization */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    border-bottom: none;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .scanner-container {
        padding: 15px;
    }

    .scanner-title {
        font-size: 1.5rem;
    }

    .video-wrapper {
        height: 360px;
    }

    .controls {
        flex-direction: column;
    }

    .controls .btn {
        width: 100%;
    }

    .result-code {
        font-size: 1.4rem;
    }
}
