/* Styles pour l'interface frontend E-Tickets */
.eticket-scanner-frontend,
.eticket-validation-frontend {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.eticket-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.eticket-header h2 {
    margin: 0;
    font-size: 1.8em;
}

.eticket-user-info {
    text-align: right;
}

.eticket-user-info .logout-link {
    color: white;
    text-decoration: underline;
    font-size: 0.9em;
}

.scanner-interface {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 768px) {
    .scanner-interface {
        grid-template-columns: 1fr;
    }
}

.scanner-section,
.manual-section,
.results-section {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
}

.scanner-section h3,
.manual-section h3,
.results-section h3 {
    margin-top: 0;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.scanner-container {
    text-align: center;
}

#qr-video-frontend {
    width: 100%;
    max-width: 400px;
    border: 3px solid #3498db;
    border-radius: 8px;
    background: #000;
}

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

.eticket-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.eticket-btn-primary {
    background: #3498db;
    color: white;
}

.eticket-btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.eticket-btn-secondary {
    background: #95a5a6;
    color: white;
}

.eticket-btn-secondary:hover {
    background: #7f8c8d;
}

.eticket-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

.status-message {
    padding: 12px;
    border-radius: 6px;
    margin: 10px 0;
    font-weight: 500;
}

.status-info {
    background: #d6eaf8;
    color: #2874a6;
    border: 1px solid #aed6f1;
}

.status-success {
    background: #d5f5e3;
    color: #27ae60;
    border: 1px solid #a3e4d7;
}

.status-error {
    background: #fadbd8;
    color: #c0392b;
    border: 1px solid #f5b7b1;
}

.manual-form .form-group {
    margin-bottom: 20px;
}

.manual-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.manual-form input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #bdc3c7;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.manual-form input[type="text"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.manual-form small {
    display: block;
    margin-top: 5px;
    color: #7f8c8d;
    font-size: 0.85em;
}

.validation-results {
    max-height: 400px;
    overflow-y: auto;
}

.validation-item {
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
}

.validation-success {
    border-left: 4px solid #27ae60;
}

.validation-error {
    border-left: 4px solid #e74c3c;
}

.validation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9em;
}

.validation-type {
    font-weight: 600;
    color: #2c3e50;
}

.validation-time {
    color: #7f8c8d;
    font-size: 0.85em;
}

.validation-details p {
    margin: 5px 0;
    font-size: 0.9em;
}

.validation-details p strong {
    color: #2c3e50;
    min-width: 120px;
    display: inline-block;
}

.validation-status {
    margin-top: 10px;
    font-weight: bold;
    text-align: right;
    font-size: 0.9em;
}

.validation-status.success {
    color: #27ae60;
}

.validation-status.error {
    color: #e74c3c;
}

.empty-state {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    padding: 40px 20px;
}

.eticket-access-denied {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.eticket-access-denied h3 {
    color: #e74c3c;
    margin-bottom: 15px;
}

.eticket-stats-frontend {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
}

.stat-number {
    display: block;
    font-size: 2em;
    font-weight: bold;
    color: #3498db;
}

.stat-label {
    font-size: 0.9em;
    color: #7f8c8d;
    margin-top: 5px;
}

.validation-loading {
    text-align: center;
    padding: 20px;
    color: #3498db;
    font-style: italic;
}

.manual-validation-interface {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.form-container {
    max-width: 400px;
    margin: 0 auto 30px;
}

.recent-validations {
    margin-top: 30px;
}

.recent-validations h4 {
    color: #2c3e50;
    border-bottom: 1px solid #bdc3c7;
    padding-bottom: 10px;
}

/* Styles pour les statistiques améliorées */
.eticket-stats-frontend {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.stats-filters {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stats-filters form {
    display: flex;
    gap: 15px;
    align-items: end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-weight: 600;
    font-size: 0.9em;
    color: #2c3e50;
}

.stats-grid-main {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    border-left: 4px solid #3498db;
}

.stat-icon {
    font-size: 2em;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2em;
    font-weight: bold;
    color: #2c3e50;
    line-height: 1;
}

.stat-label {
    color: #7f8c8d;
    font-size: 0.9em;
    margin-top: 5px;
}

.stats-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.chart-container {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.chart-container h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.stats-details {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.details-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.details-section h3 {
    margin-top: 0;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.recent-validations-list {
    max-height: 300px;
    overflow-y: auto;
}

.validation-item-small {
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
    background: #f8f9fa;
    font-size: 0.9em;
}

.performance-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.performance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #ecf0f1;
}

.perf-label {
    color: #7f8c8d;
}

.perf-value {
    font-weight: bold;
    color: #2c3e50;
}

.stats-loading {
    text-align: center;
    padding: 40px;
    color: #3498db;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 2s linear infinite;
    margin: 0 auto 15px;
}

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

@media (max-width: 768px) {
    .stats-filters form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .stats-details {
        grid-template-columns: 1fr;
    }
    
    .stats-charts {
        grid-template-columns: 1fr;
    }
}

        /* Style de vérification*/
        .eticket-check-status-frontend {
            max-width: 1000px;
            margin: 0 auto;
            padding: 20px;
        }
        
        .check-status-container {
            background: white;
            border-radius: 10px;
            padding: 30px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }
        
        .status-description {
            text-align: center;
            margin-bottom: 30px;
            padding: 20px;
            background: #f8f9fa;
            border-radius: 8px;
        }
        
        .info-note {
            font-style: italic;
            color: #7f8c8d;
            margin-top: 10px;
            font-size: 0.9em;
        }
        
        .check-status-interface {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 30px;
            margin-bottom: 40px;
        }
        
        @media (max-width: 768px) {
            .check-status-interface {
                grid-template-columns: 1fr;
            }
        }
        
        .check-form-section,
        .check-scanner-section,
        .check-results-section {
            background: #f8f9fa;
            padding: 25px;
            border-radius: 8px;
            border: 1px solid #e1e5e9;
        }
        
        .check-results-section {
            grid-column: 1 / -1;
        }
        
        .status-form {
            display: flex;
            flex-direction: column;
            gap: 20px;
        }
        
        .check-status-container {
            overflow-y: auto;
        }
        
        .status-result-container {
            min-height: 200px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .status-result {
            text-align: center;
            padding: 30px;
            border-radius: 10px;
            width: 100%;
        }
        
        .status-active {
            background: #d5f5e3;
            border: 2px solid #27ae60;
            color: #27ae60;
        }
        
        .status-used {
            background: #fadbd8;
            border: 2px solid #e74c3c;
            color: #e74c3c;
        }
        
        .status-invalid {
            background: #fef9e7;
            border: 2px solid #f39c12;
            color: #f39c12;
        }
        
        .status-icon {
            font-size: 3em;
            margin-bottom: 15px;
        }
        
        .status-title {
            font-size: 1.5em;
            font-weight: bold;
            margin-bottom: 10px;
        }
        
        .status-details {
            text-align: left;
            margin-top: 20px;
            padding: 15px;
            background: rgba(255, 255, 255, 0.7);
            border-radius: 5px;
        }
        
        .detail-item {
            display: flex;
            justify-content: space-between;
            margin-bottom: 8px;
            padding-bottom: 8px;
            border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        }
        
        .detail-label {
            font-weight: bold;
            color: #2c3e50;
        }
        
        .detail-value {
            color: #34495e;
        }
        
        .status-info-section {
            margin-top: 40px;
        }
        
        .info-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 20px;
            margin-top: 20px;
        }
        
        .info-item {
            display: flex;
            align-items: flex-start;
            gap: 15px;
            padding: 20px;
            background: white;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            border-left: 4px solid #3498db;
        }
        
        .info-icon {
            font-size: 2em;
            flex-shrink: 0;
        }
        
        .info-content h4 {
            margin: 0 0 8px 0;
            color: #2c3e50;
        }
        
        .info-content p {
            margin: 0;
            color: #7f8c8d;
            font-size: 0.9em;
        }
        
        .scanner-controls {
            margin: 15px 0;
            display: flex;
            gap: 10px;
            justify-content: center;
            flex-wrap: wrap;
        }

/* Statut online offline */
.connection-status {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    margin-left: 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.connection-status.online {
    background: #2ecc71;
    color: white;
}

.connection-status.offline {
    background: #e74c3c;
    color: white;
}

.sync-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    animation: pulse 2s infinite;
}

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

.eticket-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    color: white;
    z-index: 10000;
    max-width: 300px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: between;
    align-items: center;
    gap: 10px;
}

.eticket-notification.success {
    background: #27ae60;
}

.eticket-notification.warning {
    background: #f39c12;
}

.eticket-notification.error {
    background: #e74c3c;
}

.eticket-notification.info {
    background: #3498db;
}

.notification-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    margin: 0;
}

.offline-stats {
    margin-left: 10px;
    font-size: 12px;
    color: #7f8c8d;
}

/* Gestion du cache */
.cache-management-section {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    background: #f9f9f9;
}

.cache-management-section h3 {
    margin-top: 0;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.cache-stats {
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: white;
    border-radius: 4px;
    border-left: 4px solid #3498db;
}

.stat-label {
    font-weight: bold;
    color: #555;
}

.stat-value {
    font-weight: bold;
}

.stat-value.online {
    color: #27ae60;
}

.stat-value.offline {
    color: #e74c3c;
}

.cache-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.eticket-btn-warning {
    background: #e74c3c;
    color: white;
}

.eticket-btn-warning:hover {
    background: #c0392b;
}

.cache-result {
    min-height: 40px;
}

.cache-loading {
    color: #3498db;
    font-style: italic;
}

.cache-success {
    color: #27ae60;
    background: #d5f4e6;
    padding: 10px;
    border-radius: 4px;
    border-left: 4px solid #27ae60;
}

.cache-error {
    color: #e74c3c;
    background: #fadbd8;
    padding: 10px;
    border-radius: 4px;
    border-left: 4px solid #e74c3c;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .cache-actions {
        flex-direction: column;
    }
    
    .cache-actions .eticket-btn {
        width: 100%;
    }
}

/* Badges dans l'interface de validation */
.category-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    margin-left: 5px;
}

.category-badge.vip {
    background: linear-gradient(135deg, #f39c12, #d35400);
    color: white;
}

.category-badge.vvip {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    color: white;
}

.category-badge.premium {
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
    color: white;
}

.category-badge.normal {
    background: #95a5a6;
    color: white;
}

.pos-badge {
    background: #e74c3c;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.validation-details p strong {
    color: #2c3e50;
    min-width: 140px;
    display: inline-block;
}

/* Améliorer l'affichage des détails */
.validation-details {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.validation-details p {
    margin: 8px 0;
    padding-bottom: 8px;
    border-bottom: 1px dashed #ecf0f1;
}

.validation-details p:last-child {
    border-bottom: none;
}