/**
 * Styles pour le popup de siège verrouillé
 * Design moderne et élégant
 */

/* 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;
}

.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 avec disposition 2-2 (A-B | allée | D-E) */
.rb-available-seats-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-content: flex-start !important;
    gap: 6px !important;
    max-height: 400px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 15px !important;
    background: #f8f9fa !important;
    border-radius: 6px !important;
    max-width: 450px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
}

/* Éléments de layout pour disposition 2-2 */
.rb-layout-break {
    flex-basis: 100% !important;
    height: 8px !important;
    width: 100% !important;
}

.rb-layout-aisle {
    width: 20px !important;
    height: 45px !important;
    flex-shrink: 0 !important;
}

.rb-layout-placeholder {
    width: 70px !important;
    height: 45px !important;
    visibility: hidden !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    flex-shrink: 0 !important;
}

/* ⭐ NOUVELLE DISPOSITION 2-2 AVEC ALLÉE ⭐ */

/* Conteneur du plan de sièges dans le popup */
.rb-popup-seat-plan {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

/* Rangée de sièges */
.rb-popup-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
}

/* Layout 2-2 avec allée centrale */
.rb-popup-row.layout-2-2 {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2vw !important;
    
}

/* Layout 5 colonnes (dernière rangée) */
.rb-popup-row.layout-5 {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

/* Groupe de sièges (gauche ou droit) */
.rb-popup-seat-group {
    display: flex;
    gap: 6px;
}

/* Allée centrale */
.rb-popup-aisle {
    width: 20px;
    height: 45px;
}

/* Placeholder pour siège manquant */
.rb-popup-seat-placeholder {
    width: 70px;
    height: 45px;
    background: transparent;
}

/* --- BOUTON DE SIÈGE POPUP (Style 3D) --- */
.rb-available-seat-btn,
.rb-popup-seat-plan .mp_seat {
    /* Forme et taille - IDENTIQUE À LA CARTE PRINCIPALE */
    width: 70px !important;
    height: 45px !important;
    min-height: 45px !important;
    padding: 0px 5px !important;
    border-radius: 5px !important;
    box-sizing: border-box !important;
    
    /* Mise en page du texte */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    
    /* Typographie */
    color: #fff !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;

    /* --- L'EFFET VISUEL 3D --- */
    border: none !important;
    
    /* Couleur de fond (Vert) */
    background-color: #4CAF50 !important;
    
    /* Le dégradé magique : 30% de vert clair en haut, 70% de vert normal en bas */
    background: linear-gradient(to bottom, 
        #81C784 0%, 
        #81C784 30%, 
        #4CAF50 30%, 
        #4CAF50 100%
    ) !important;

    /* Ombre portée sous le bouton */
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2) !important;
    
    /* Transitions */
    cursor: pointer !important;
    transition: transform 0.1s ease, filter 0.1s ease !important;
}

/* Effet au survol */
.rb-available-seat-btn:hover {
    transform: translateY(-2px) !important;
    filter: brightness(1.1) !important;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3) !important;
}

/* --- ÉTAT SÉLECTIONNÉ (Bleu) --- */
.rb-available-seat-btn.selected,
.rb-popup-seat.selected,
.rb-popup-seat-plan .mp_seat.seat_selected,
.rb-popup-seat-plan .mp_seat.wbtm_selected_seat {
    background-color: #2196F3 !important;
    background: linear-gradient(to bottom, 
        #64B5F6 0%, 
        #64B5F6 30%, 
        #2196F3 30%, 
        #2196F3 100%
    ) !important;
    border: none !important;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,0.3), 0 3px 5px rgba(0,0,0,0.2) !important;
}

/* --- ÉTAT VERROUILLÉ/OCCUPÉ (Rouge) --- */
.rb-available-seat-btn.locked,
.rb-available-seat-btn.occupied,
.rb-available-seat-btn.rb-seat-unavailable,
.rb-popup-seat-plan .mp_seat.locked,
.rb-popup-seat-plan .mp_seat.seat_booked {
    cursor: not-allowed !important;
    background-color: #F44336 !important;
    background: linear-gradient(to bottom, 
        #E57373 0%, 
        #E57373 30%, 
        #F44336 30%, 
        #F44336 100%
    ) !important;
    opacity: 0.7 !important;
}

/* --- ÉTAT RÉSERVÉ (Gris/Rouge) - Sièges dans le popup qui sont déjà pris --- */
.rb-available-seat-btn.rb-seat-reserved,
.rb-available-seat-btn:disabled,
.rb-available-seat-btn[disabled] {
    cursor: not-allowed !important;
    background-color: #9E9E9E !important;
    background: linear-gradient(to bottom, 
        #BDBDBD 0%, 
        #BDBDBD 30%, 
        #9E9E9E 30%, 
        #9E9E9E 100%
    ) !important;
    opacity: 0.6 !important;
    pointer-events: none !important;
    color: #fff !important;
    text-decoration: line-through !important;
}

.rb-available-seat-btn.rb-seat-reserved:hover,
.rb-available-seat-btn:disabled:hover {
    transform: none !important;
    filter: none !important;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2) !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;
}

.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: #888;
    border-radius: 4px;
}

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

/* 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-seats-grid {
        gap: 5px !important;
        max-width: 320px !important;
    }
    
    /* Responsive pour la disposition 2-2 */
    .rb-popup-row.layout-2-2 {
        gap: 2vw !important;
    }
    
    .rb-popup-seat-group {
        gap: 5px !important;
    }
    
    .rb-available-seat-btn,
    .rb-popup-seat-plan .mp_seat {
        width: 55px !important;
        height: 40px !important;
        font-size: 12px !important;
    }
    
    .rb-popup-aisle,
    .rb-layout-aisle {
        width: 15px !important;
    }
    
    .rb-popup-seat-placeholder,
    .rb-layout-placeholder {
        width: 55px !important;
        height: 40px !important;
    }
    
    .rb-popup-footer {
        flex-direction: column !important;
    }
    
    .rb-popup-btn {
        width: 100% !important;
    }
}
