/**
 * Styles pour le popup de siège verrouillé - VERSION FRONTEND
 * Design simple et épuré qui correspond au style de la carte principale
 * COPIE EXACTE : Bordures grises, texte noir, fond blanc
 */

/* Overlay sombre */
.rb-seat-lock-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.7) !important;
    z-index: 999999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    animation: rbFadeIn 0.3s ease;
    visibility: visible !important;
    opacity: 1 !important;
}

@keyframes rbFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Conteneur du popup */
.rb-seat-lock-popup {
    background: #fff !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important;
    max-width: 650px !important;
    width: 90% !important;
    max-height: 85vh !important;
    overflow: visible !important;
    animation: rbSlideUp 0.3s ease;
    display: flex !important;
    flex-direction: column !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
}

@keyframes rbSlideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Header du popup */
.rb-popup-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #fff !important;
    padding: 20px 25px !important;
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
    visibility: visible !important;
    flex-shrink: 0 !important;
    border-radius: 12px 12px 0 0 !important;
}

.rb-popup-icon {
    font-size: 32px;
    line-height: 1;
}

.rb-popup-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

/* Contenu du popup */
.rb-popup-content {
    padding: 25px !important;
    flex: 1 !important;
    overflow-y: auto !important;
    display: block !important;
    visibility: visible !important;
    min-height: 0 !important;
}

.rb-popup-message {
    font-size: 15px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 20px;
}

.rb-locked-seat-info {
    background: #f8f9fa;
    border-left: 4px solid #dc3545;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.rb-locked-seat-info strong {
    color: #dc3545;
    font-size: 18px;
}

/* Section sièges disponibles */
.rb-available-seats-section {
    margin-top: 25px;
}

.rb-available-seats-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rb-available-seats-title::before {
    content: "✓";
    display: inline-block;
    width: 24px;
    height: 24px;
    background: #28a745;
    color: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-weight: bold;
}

/* Grille de sièges - STYLE SIMPLE comme la carte principale */
.rb-available-seats-grid {
    display: block !important;
    max-height: 400px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 15px !important;
    background: #f8f9fa !important;
    border-radius: 6px !important;
}

/* ⭐ DISPOSITION 2-2 AVEC ALLÉE ⭐ */
.rb-popup-seat-plan {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding: 10px !important;
    background: #fff !important;
    border-radius: 6px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.rb-popup-row {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
}

.rb-popup-row.layout-2-2 {
    gap: 1.5rem !important;
    
}

.rb-popup-row.layout-5 {
    gap: 6px !important;
}

.rb-popup-seat-group {
    display: flex !important;
    gap: 6px !important;
}

.rb-popup-aisle {
    width: 30px !important;
    min-width: 30px !important;
    height: 50px !important;
}

.rb-popup-seat-placeholder {
    width: 70px !important;
    height: 50px !important;
    background: transparent !important;
}

/* --- BOUTON DE SIÈGE POPUP - STYLE EXACT FRONTE END --- */
.rb-available-seat-btn,
.rb-popup-seat-plan .rb-available-seat-btn {
    /* Forme et taille */
    width: 70px !important;
    height: 50px !important;
    min-height: 50px !important;
    padding: 5px !important;
    border-radius: 16px 16px 0 0 !important;
    box-sizing: border-box !important;
    
    /* Mise en page du texte */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    
    /* Typographie */
    color: #333 !important; /* Texte noir/gris foncé */
    font-weight: 500 !important;
    font-size: 14px !important;

    /* Style simple - fond BLANC avec bordure GRISE */
    background: #ffffff !important;
    border: 1px solid #ddd !important; /* Bordure fine grise */
    box-shadow: none !important;
    text-shadow: none !important;
    
    /* Transitions */
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

/* IMPORTANT: Ne pas surcharger le fond si une classe spécifique est appliquée (pour le rose) */
/* On utilise :where() pour réduire la spécificité si possible, mais ici on veut forcer */
/* Donc on cible spécifiquement les sièges "standard" */

.rb-available-seat-btn:not(.selected):not(.locked):not(.booked):not([style*="background"]) {
    background: #ffffff !important;
    border-color: #ddd !important;
    border-radius: 16px 16px 0 0 !important;

}

/* Effet au survol */
.rb-available-seat-btn:hover:not(.locked):not(.booked) {
    background: #f5f5f5 !important;
    border-color: #bbb !important;
    transform: translateY(-1px) !important;
}

/* --- ÉTAT SÉLECTIONNÉ (Bleu) --- */
.rb-available-seat-btn.selected {
    background: #e3f2fd !important;
    border-color: #2196f3 !important;
    color: #1565c0 !important;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2) !important;
}

/* --- ÉTAT VERROUILLÉ/RÉSERVÉ (Rouge) --- */
.rb-available-seat-btn.locked,
.rb-available-seat-btn.booked,
.rb-available-seat-btn.rb-seat-unavailable {
    background: #ffebee !important;
    border-color: #ef5350 !important;
    color: #c62828 !important;
    cursor: not-allowed !important;
    opacity: 0.8 !important;
    pointer-events: none !important;
    user-select: none !important;
}

.rb-no-seats-available {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-style: italic;
}

/* Footer du popup */
.rb-popup-footer {
    padding: 20px 25px !important;
    background: #f8f9fa !important;
    border-top: 1px solid #dee2e6 !important;
    display: flex !important;
    gap: 10px !important;
    justify-content: flex-end !important;
    visibility: visible !important;
    flex-shrink: 0 !important;
    border-radius: 0 0 12px 12px !important;
}

.rb-popup-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rb-popup-btn-primary {
    background: #667eea;
    color: #fff;
}

.rb-popup-btn-primary:hover {
    background: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.rb-popup-btn-secondary {
    background: #6c757d;
    color: #fff;
}

.rb-popup-btn-secondary:hover {
    background: #5a6268;
}

/* Scrollbar personnalisée */
.rb-available-seats-grid::-webkit-scrollbar,
.rb-popup-content::-webkit-scrollbar {
    width: 8px;
}

.rb-available-seats-grid::-webkit-scrollbar-track,
.rb-popup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.rb-available-seats-grid::-webkit-scrollbar-thumb,
.rb-popup-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.rb-available-seats-grid::-webkit-scrollbar-thumb:hover,
.rb-popup-content::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Animation de chargement */
.rb-popup-loading {
    text-align: center;
    padding: 20px;
}

.rb-popup-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: rbSpin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .rb-seat-lock-popup {
        width: 95% !important;
        max-height: 90vh !important;
    }
    
    .rb-available-seat-btn {
        width: 55px !important;
        height: 45px !important;
        font-size: 12px !important;
    }
    
    .rb-popup-row.layout-2-2 {
        gap: 0vw !important;
    }
    
    .rb-popup-seat-group {
        gap: 5px !important;
    }
    
    .rb-popup-aisle {
        width: 20px !important;
    }
    
    .rb-popup-seat-placeholder {
        width: 55px !important;
    }
    
    .rb-popup-footer {
        flex-direction: column !important;
    }
    
    .rb-popup-btn {
        width: 100% !important;
    }
}
