/* Scanner de tickets - Styles CSS */

.scanner-container {
    text-align: center;
    margin: 20px 0;
}

.scanner-video-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    width: 100%;
}

.scanner-video {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.scanner-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    border: 3px solid #28a745;
    border-radius: 10px;
    box-shadow: 0 0 0 5000px rgba(0, 0, 0, 0.3);
    animation: scanner-pulse 2s infinite;
}

.scanner-frame::before,
.scanner-frame::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: transparent;
}

.scanner-frame::before {
    top: -3px;
    left: -3px;
    border-top: 3px solid #28a745;
    border-left: 3px solid #28a745;
    border-top-left-radius: 10px;
}

.scanner-frame::after {
    bottom: -3px;
    right: -3px;
    border-bottom: 3px solid #28a745;
    border-right: 3px solid #28a745;
    border-bottom-right-radius: 10px;
}

@keyframes scanner-pulse {
    0% {
        opacity: 0.6;
        box-shadow: 0 0 0 5000px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(40, 167, 69, 0.6);
    }
    50% {
        opacity: 1;
        box-shadow: 0 0 0 5000px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(40, 167, 69, 1);
    }
    100% {
        opacity: 0.6;
        box-shadow: 0 0 0 5000px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(40, 167, 69, 0.6);
    }
}

/* Animation pour le scan en cours */
@keyframes scanning-line {
    0% {
        top: 0;
    }
    50% {
        top: calc(100% - 2px);
    }
    100% {
        top: 0;
    }
}

.scanning-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: rgba(40, 167, 69, 0.8);
    top: 0;
    left: 0;
    animation: scanning-line 3s linear infinite;
    box-shadow: 0 0 8px 2px rgba(40, 167, 69, 0.8);
}

.scanner-controls {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.scanner-controls button {
    padding: 12px 24px;
    font-size: 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
}

.scanner-controls button span {
    margin-right: 8px;
    display: inline-flex;
    align-items: center;
}

/* Styles pour les boutons */
._primaryButton, ._successButton, ._dangerButton, ._warningButton {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    margin: 5px;
    transition: background-color 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Styles pour les icônes dans les boutons */
._primaryButton span, ._successButton span, ._dangerButton span, ._warningButton span {
    display: inline-block;
    margin-right: 8px;
    vertical-align: middle;
}

._successButton {
    background-color: #28a745;
    color: white;
}

._successButton:hover {
    background-color: #218838;
    transform: translateY(-2px);
}

._dangerButton {
    background-color: #dc3545;
    color: white;
}

._dangerButton:hover {
    background-color: #c82333;
    transform: translateY(-2px);
}

._warningButton {
    background-color: #ffc107;
    color: #212529;
}

._warningButton:hover {
    background-color: #e0a800;
    transform: translateY(-2px);
}

.scanner-title {
    text-align: center;
    color: #495057;
    margin-bottom: 15px;
}

.scanner-interface {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.scanner-status {
    margin: 20px 0;
    padding: 15px;
    border-radius: 6px;
    font-weight: 500;
    text-align: center;
    min-height: 30px;
}

.status-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.status-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.scan-results {
    margin-top: 20px;
    padding: 15px;
    border-radius: 6px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
}

.scan-results.show {
    display: block !important;
}

.manual-input {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.manual-input h4 {
    margin-bottom: 20px;
    color: #495057;
}

.formControl {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.formControl:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.allCenter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
}

._divider {
    height: 1px;
    background-color: #dee2e6;
    margin: 20px 0;
}

._mR_xs {
    margin-right: 8px;
}

/* Résultats du scan */
#scan-results {
    margin-top: 30px;
}

.scan-alert {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.scan-success {
    background-color: #d4edda;
    color: #155724;
    border-left-color: #28a745;
}

.scan-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left-color: #ffc107;
}

.scan-alert h5 {
    margin: 0 0 8px 0;
    font-size: 18px;
}

.scan-alert p {
    margin: 0;
    font-size: 14px;
}

.ticket-section {
    margin-bottom: 25px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.ticket-section h5 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .scanner-video {
        max-width: 100%;
        height: 250px;
    }
    
    .scanner-frame {
        width: 150px;
        height: 150px;
    }
    
    .scanner-controls button {
        display: block;
        width: 100%;
        margin: 10px 0;
    }
    
    .allCenter {
        flex-direction: column;
        text-align: center;
    }
    
    .allCenter span {
        margin-bottom: 5px;
    }
}

@media (max-width: 480px) {
    .scanner-video {
        height: 200px;
    }
    
    .scanner-frame {
        width: 120px;
        height: 120px;
    }
    
    .ticket-section {
        padding: 15px;
    }
}

/* Animation de chargement */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Styles pour les icônes Font Awesome */
.fas {
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
}

.fa-camera:before {
    content: "\f030";
}

.fa-stop:before {
    content: "\f04d";
}

.fa-ticket-alt:before {
    content: "\f3ff";
}

.fa-check-circle:before {
    content: "\f058";
}

.fa-exclamation-triangle:before {
    content: "\f071";
}