/* === STYLES GÉNÉRAUX === */
.rtm-wrap {
    padding: 20px;
}

/* Styles spécifiques pour le frontend */
.rtm-frontend {
    max-width: 100%;
    margin: 0 auto;
}

.rtm-frontend .button-primary {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
    text-decoration: none;
    text-shadow: none;
    padding: 8px 12px;
    font-size: 13px;
    line-height: 1.5;
    border-radius: 3px;
    cursor: pointer;
    border: 1px solid;
}

.rtm-frontend .button-primary:hover {
    background: #135e96;
    border-color: #135e96;
}

.rtm-frontend .button {
    display: inline-block;
    text-decoration: none;
    font-size: 13px;
    line-height: 2.15384615;
    min-height: 30px;
    margin: 0;
    padding: 0 10px;
    cursor: pointer;
    border-width: 1px;
    border-style: solid;
    border-radius: 3px;
    white-space: nowrap;
    box-sizing: border-box;
    background: #f6f7f7;
    border-color: #dcdcde;
    color: #2c3338;
}

.rtm-frontend .button:hover {
    background: #f0f0f1;
    border-color: #8c8f94;
    color: #1d2327;
}

/* === BOUTONS D'AJOUT DE TABLES === */
.add-table {
    margin-right: 10px !important;
    margin-bottom: 10px !important;
    color: white !important;
    border: none !important;
    font-weight: bold !important;
}

.capacity-btn-1 {
    background: #00BCD4 !important;
}

.capacity-btn-1:hover {
    background: #0097A7 !important;
}

.capacity-btn-2 {
    background: #4CAF50 !important;
}

.capacity-btn-2:hover {
    background: #388E3C !important;
}

.capacity-btn-4 {
    background: #FF9800 !important;
}

.capacity-btn-4:hover {
    background: #F57C00 !important;
}

.capacity-btn-6 {
    background: #9C27B0 !important;
}

.capacity-btn-6:hover {
    background: #7B1FA2 !important;
}

.capacity-btn-8 {
    background: #F44336 !important;
}

.capacity-btn-8:hover {
    background: #D32F2F !important;
}

.capacity-btn-10 {
    background: #3F51B5 !important;
}

.capacity-btn-10:hover {
    background: #303F9F !important;
}

/* === ZONE DE CONTRÔLES (EN HAUT) === */
.rtm-controls {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.rtm-control-group {
    flex: 1;
    min-width: 200px;
}

.rtm-control-group h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
}

.rtm-control-group button {
    margin-right: 10px;
    margin-bottom: 10px;
}

.rtm-control-group input[type="date"] {
    padding: 5px 10px;
    font-size: 14px;
    width: 100%;
    max-width: 200px;
}

.rtm-control-group select {
    padding: 5px 10px;
    font-size: 14px;
    width: 100%;
    max-width: 200px;
}

.rtm-control-group label {
    display: block;
    margin-bottom: 10px;
}

/* === LAYOUT 80/20 : CONTENEUR PRINCIPAL === */
.rtm-main-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.rtm-left-section {
    flex: 0 0 78%;
}

.rtm-right-section {
    flex: 0 0 20%;
}

/* === COLONNE GAUCHE - PLAN DE SALLE === */
.rtm-restaurant-layout {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
}

.plan-size-btn {
    margin-left: 5px !important;
}

.plan-size-btn.active {
    background: #2196F3 !important;
    color: white !important;
    border-color: #2196F3 !important;
}

.rtm-floor-plan {
    position: relative;
    min-height: 600px;
    background: #f9f9f9;
    border: 2px dashed #ddd;
    background-image: 
        linear-gradient(0deg, transparent 24%, rgba(0, 0, 0, .05) 25%, rgba(0, 0, 0, .05) 26%, transparent 27%, transparent 74%, rgba(0, 0, 0, .05) 75%, rgba(0, 0, 0, .05) 76%, transparent 77%, transparent),
        linear-gradient(90deg, transparent 24%, rgba(0, 0, 0, .05) 25%, rgba(0, 0, 0, .05) 26%, transparent 27%, transparent 74%, rgba(0, 0, 0, .05) 75%, rgba(0, 0, 0, .05) 76%, transparent 77%, transparent);
    background-size: 50px 50px;
    transition: all 0.3s ease;
}

/* === COLONNE DROITE - RÉSERVATIONS === */
.rtm-reservations-container {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 15px;
    height: fit-content;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    position: sticky;
    top: 20px;
}

.rtm-reservations-container h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
    position: sticky;
    top: 0;
    background: #fff;
    padding-bottom: 10px;
    border-bottom: 2px solid #ddd;
    z-index: 10;
}

/* === STYLES DES TABLES - TAILLE RÉDUITE === */
.rtm-table {
    position: absolute;
    background: #4CAF50;
    color: white;
    border-radius: 8px;
    padding: 8px;
    cursor: move;
    min-width: 70px;
    max-width: 90px;
    text-align: center;
    box-shadow: 0 3px 5px rgba(0,0,0,0.3);
    transition: all 0.3s;
}

.rtm-table:hover {
    transform: scale(1.08);
    box-shadow: 0 5px 10px rgba(0,0,0,0.4);
}

.rtm-table.capacity-1 {
    background: #00BCD4;
}

.rtm-table.capacity-2 {
    background: #4CAF50;
}

.rtm-table.capacity-4 {
    background: #FF9800;
}

.rtm-table.capacity-6 {
    background: #9C27B0;
}

.rtm-table.capacity-8 {
    background: #F44336;
}

.rtm-table.capacity-10 {
    background: #3F51B5;
}

.rtm-table.assigned.capacity-1 {
    background: #0097A7;
}

.rtm-table.assigned.capacity-2 {
    background: #1976D2;
}

.rtm-table.assigned.capacity-4 {
    background: #F57C00;
}

.rtm-table.assigned.capacity-6 {
    background: #7B1FA2;
}

.rtm-table.assigned.capacity-8 {
    background: #D32F2F;
}

.rtm-table.assigned.capacity-10 {
    background: #303F9F;
}

.rtm-table-number {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 3px;
}

.rtm-table-capacity {
    font-size: 10px;
    opacity: 0.9;
}

.rtm-table-select {
    width: calc(100% - 6px);
    margin: 5px 3px;
    padding: 3px;
    border: 2px solid rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.9);
    border-radius: 3px;
    font-size: 9px;
    cursor: pointer;
    color: #333;
    font-weight: 500;
}

.rtm-table-select:focus {
    outline: none;
    border-color: #fff;
    background: #fff;
}

.rtm-table-select option:disabled {
    color: #999;
}

.rtm-table-customer {
    font-size: 10px;
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid rgba(255,255,255,0.3);
    font-weight: bold;
    line-height: 1.2;
}

.rtm-table-time {
    font-size: 9px;
    margin-top: 3px;
    opacity: 0.9;
}

.rtm-table-delete {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: none;
}

.rtm-table:hover .rtm-table-delete {
    display: block;
}

/* === LISTE DES RÉSERVATIONS - FORMAT VERTICAL COMPACT === */
#reservations-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reservation-item {
    padding: 10px;
    background: #f5f5f5;
    border-radius: 5px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 12px;
}

.reservation-item:hover {
    background: #e0e0e0;
    border-color: #2196F3;
}

.reservation-item.assigned {
    background: #c8e6c9;
    border-color: #4CAF50;
}

.reservation-item.selected {
    background: #bbdefb;
    border-color: #2196F3;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.reservation-item strong {
    color: #333;
    font-size: 13px;
    font-weight: 600;
    margin: 0;
    word-break: break-word;
}

.reservation-item small {
    color: #666;
    font-size: 11px;
    line-height: 1.4;
    display: block;
}

.reservation-unassign {
    margin-top: 5px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 4px 8px;
    font-size: 10px;
    cursor: pointer;
    display: none;
    width: fit-content;
    align-self: flex-end;
}

.reservation-item.assigned .reservation-unassign {
    display: block;
}

/* === BOUTON SAUVEGARDER === */
.save-layout {
    display: block;
    width: 100%;
}

/* === RESPONSIVE - VERSION MOBILE === */
@media screen and (max-width: 1200px) {
    .rtm-main-container {
        flex-direction: column;
    }
    
    .rtm-left-section {
        flex: 1;
        width: 100%;
    }
    
    .rtm-right-section {
        flex: 1;
        width: 100%;
    }
    
    .rtm-reservations-container {
        max-height: 400px;
        position: relative;
        top: 0;
    }
}

@media screen and (max-width: 768px) {
    .rtm-controls {
        flex-direction: column;
    }
    
    .rtm-control-group {
        min-width: auto;
    }
    
    .rtm-table {
        min-width: 60px;
        max-width: 80px;
        padding: 6px;
    }
    
    .rtm-table-number {
        font-size: 12px;
    }
    
    .rtm-table-capacity {
        font-size: 9px;
    }
}

/* === AUTRES === */
.ui-draggable-dragging {
    opacity: 0.7;
    z-index: 1000;
}

#reservation-count {
    font-weight: normal;
    font-size: 13px;
    color: #666;
}