/* QR Scanner Styles */

.scanner-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.scanner-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.scanner-view {
    width: 100%;
    height: 100%;
    position: relative;
    background: #000;
}

#scanner-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.scanner-box {
    width: 250px;
    height: 250px;
    border: 3px solid #fff;
    border-radius: 12px;
    box-shadow: 0 0 0 99999px rgba(0, 0, 0, 0.5);
    position: relative;
}

.scanner-box::before,
.scanner-box::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    border: 4px solid #4CAF50;
}

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

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

.scanner-text {
    color: #fff;
    margin-top: 30px;
    font-size: 16px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    padding: 0 20px;
}

.scanner-controls {
    padding: 20px;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
}

.scanner-controls .btn {
    border-radius: 25px;
    padding: 12px 40px;
    font-size: 16px;
    font-weight: 600;
}

/* Mobile optimizations */
@media (max-width: 576px) {
    .scanner-box {
        width: 200px;
        height: 200px;
    }
    
    .scanner-text {
        font-size: 14px;
    }
}

/* Landscape mode */
@media (orientation: landscape) and (max-height: 500px) {
    .scanner-box {
        width: 150px;
        height: 150px;
    }
    
    .scanner-text {
        margin-top: 15px;
        font-size: 12px;
    }
    
    .scanner-controls {
        padding: 10px;
    }
}

/* Loading state */
.scanner-container .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Error state */
.scanner-container .alert {
    margin: 20px;
    border-radius: 12px;
}

/* Tech HUD Overlay */
.scanner-hud {
    z-index: 10;
}

.hud-corner {
    position: absolute;
    width: 40px;
    height: 40px;
    border-color: #00ff00;
    border-style: solid;
    border-width: 4px;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.top-left {
    top: 20px;
    left: 20px;
    border-right: none;
    border-bottom: none;
    border-radius: 8px 0 0 0;
}

.top-right {
    top: 20px;
    right: 20px;
    border-left: none;
    border-bottom: none;
    border-radius: 0 8px 0 0;
}

.bottom-left {
    bottom: 20px;
    left: 20px;
    border-right: none;
    border-top: none;
    border-radius: 0 0 0 8px;
}

.bottom-right {
    bottom: 20px;
    right: 20px;
    border-left: none;
    border-top: none;
    border-radius: 0 0 8px 0;
}

.scan-line {
    position: absolute;
    top: 0;
    left: 20px;
    right: 20px;
    height: 2px;
    background: #00ff00;
    box-shadow: 0 0 10px #00ff00;
    animation: scanAnim 2s linear infinite;
    opacity: 0.6;
}

@keyframes scanAnim {
    0% { top: 20px; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: calc(100% - 20px); opacity: 0; }
}

.hud-text {
    position: absolute;
    bottom: 30px;
    width: 100%;
    text-align: center;
}

.animate-pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% { opacity: 0.8; }
    50% { opacity: 1; }
    100% { opacity: 0.8; }
}

/* Camera switch button spin animation */
.spin {
    animation: spin 0.5s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Flash button glow effect when active */
.btn-warning {
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.5) !important;
}

/* Scanner slide-in animation */
.animate-slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scanning progress indicator */
.scanning-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 2rem;
    color: #fff;
    font-size: 0.875rem;
}

/* Camera overlay controls */
.camera-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    z-index: 20;
}

.camera-control-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.camera-control-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.camera-control-btn:active {
    transform: scale(0.95);
}

.camera-control-btn.active {
    background: #ffc107;
    color: #000;
}

/* Token input enhancement */
.token-input-group .form-control {
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    text-transform: uppercase;
}

