/* rates-module.css - Stile Octorate Calendar 
 * Redesign completo: multi-riga per camera, colori stato, righe alte
 * Versione 2.0
 */

/* ===== LAYOUT GENERALE ===== */
.rates-grid-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    border: 1px solid #dce0e6;
}

.advanced-rates-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
}

/* ===== HEADER DATE ===== */
.advanced-rates-table thead th {
    background: #2c3e50;
    color: #fff;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 0;
    border: 1px solid #1a2a3a;
    position: sticky;
    top: 0;
    z-index: 10;
}

.room-header {
    min-width: 180px;
    max-width: 200px;
    background: #1a2a3a !important;
    text-align: left;
    padding: 12px 14px !important;
    font-size: 13px !important;
}

.week-header {
    background: #1a2a3a !important;
    text-align: center;
    padding: 10px !important;
    font-size: 14px !important;
}

.week-header button {
    background: rgba(255,255,255,0.15);
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
}

.week-header button:hover {
    background: rgba(255,255,255,0.3);
}

/* Celle header date */
#dates-header th {
    min-width: 100px;
    padding: 8px 4px;
    text-align: center;
    line-height: 1.3;
}

#dates-header th .day-name {
    font-size: 11px;
    opacity: 0.8;
    text-transform: uppercase;
}

#dates-header th .day-num {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}

#dates-header th .day-month {
    font-size: 10px;
    opacity: 0.7;
}

/* Weekend header */
#dates-header th.weekend-header {
    background: #e74c3c !important;
}

/* ===== CORPO TABELLA - RIGHE MULTIPLE PER CAMERA ===== */

/* Riga separatore nome camera */
.room-group-header td {
    background: #ecf0f5;
    font-weight: 700;
    font-size: 14px;
    color: #2c3e50;
    padding: 10px 14px;
    border-top: 3px solid #bdc3c7;
    border-bottom: 1px solid #dce0e6;
    letter-spacing: 0.3px;
}

.room-group-header td .room-icon {
    margin-right: 8px;
}

.room-group-header td .room-channels {
    float: right;
    display: flex;
    gap: 4px;
}

.room-group-header td .channel-badge {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    text-align: center;
    line-height: 20px;
    font-size: 10px;
    font-weight: 700;
    color: white;
}

.channel-badge.booking { background: #003580; }
.channel-badge.airbnb { background: #FF5A5F; }
.channel-badge.expedia { background: #FBCF32; color: #333; }

/* ===== RIGHE DATI (Unità, Prezzo, Restrizioni) ===== */

/* Label riga a sinistra */
.row-label-cell {
    background: #f7f9fb;
    font-weight: 600;
    font-size: 11px;
    color: #7f8c9b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 14px;
    border-right: 2px solid #dce0e6;
    border-bottom: 1px solid #e8ecf0;
    white-space: nowrap;
    min-width: 180px;
    max-width: 200px;
}

.row-label-cell .label-icon {
    margin-right: 6px;
    font-size: 12px;
}

/* --- RIGA UNITÀ IN VENDITA --- */
.unit-row td {
    text-align: center;
    padding: 8px 4px;
    font-weight: 700;
    font-size: 15px;
    border-bottom: 1px solid #e8ecf0;
    border-right: 1px solid #e8ecf0;
    height: 38px;
    transition: background 0.15s;
}

/* Unità disponibili = verde */
.unit-cell-available {
    background: #d5f5e3;
    color: #27ae60;
}

/* Nessuna unità = rosso */
.unit-cell-zero {
    background: #fadbd8;
    color: #e74c3c;
}

/* Unità con poca disponibilità = giallo */
.unit-cell-low {
    background: #fef9e7;
    color: #f39c12;
}

/* --- RIGA PREZZO --- */
.price-row td {
    text-align: center;
    padding: 8px 4px;
    font-weight: 700;
    font-size: 14px;
    color: #2c3e50;
    border-bottom: 1px solid #e8ecf0;
    border-right: 1px solid #e8ecf0;
    height: 40px;
    cursor: pointer;
    transition: all 0.15s;
}

.price-row td:hover {
    background: #eaf2fd;
    transform: scale(1.03);
}

.price-row td.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,0.4);
}

/* Prezzo su cella chiusa */
.price-row td.rate-closed {
    background: #e74c3c !important;
    color: white !important;
    text-decoration: line-through;
    opacity: 0.9;
}

/* Prezzo zero/non settato */
.price-row td.price-empty {
    color: #bdc3c7;
    font-weight: 400;
    font-style: italic;
}

/* --- RIGA RESTRIZIONI --- */
.restriction-row td {
    text-align: center;
    padding: 5px 4px;
    font-size: 11px;
    font-weight: 600;
    color: #7f8c9b;
    border-bottom: 2px solid #dce0e6;
    border-right: 1px solid #e8ecf0;
    height: 30px;
}

.restriction-row td .min-stay-badge {
    display: inline-block;
    background: #eaf2fd;
    color: #2980b9;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
}

.restriction-row td .closed-badge {
    display: inline-block;
    background: #e74c3c;
    color: white;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.restriction-row td .no-restriction {
    color: #ccc;
    font-size: 16px;
}

/* ===== WEEKEND COLUMNS ===== */
.weekend-col {
    background-color: rgba(231, 76, 60, 0.04) !important;
}

.price-row td.weekend-col {
    background-color: rgba(231, 76, 60, 0.06) !important;
}

.price-row td.weekend-col.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.price-row td.weekend-col.rate-closed {
    background: #c0392b !important;
}

/* ===== PLAN TABS ===== */
.plan-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.plan-tab {
    padding: 10px 22px;
    border: 2px solid #dce0e6;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: #555;
    transition: all 0.2s;
}

.plan-tab:hover {
    border-color: #667eea;
    color: #667eea;
}

.plan-tab.active {
    background: #2c3e50;
    color: white;
    border-color: #2c3e50;
}

/* ===== MEAL BUTTONS ===== */
.meal-buttons, .meal-plan-selector .meal-buttons {
    display: flex !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
}

.meal-btn {
    background: white !important;
    color: #495057 !important;
    border: 2px solid #dee2e6 !important;
    padding: 10px 18px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    font-size: 13px !important;
    flex: 1 !important;
    min-width: 130px !important;
}

.meal-btn:hover {
    border-color: #667eea !important;
    background: #f8f9ff !important;
}

.meal-btn.active {
    background: #667eea !important;
    color: white !important;
    border-color: #667eea !important;
}

/* ===== CONTROLLI RAPIDI ===== */
.quick-controls {
    background: #f7f9fb;
    border-radius: 10px;
    padding: 16px 20px;
}

.quick-controls h4 {
    margin: 0 0 12px;
    font-size: 14px;
    color: #2c3e50;
}

.controls-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    align-items: end;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #fff;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.control-group label {
    font-weight: 600;
    color: #7f8c9b;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.control-group input,
.control-group select {
    padding: 10px;
    border: 2px solid #dce0e6;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.control-group input:focus,
.control-group select:focus {
    outline: none;
    border-color: #667eea;
}

/* ===== BOTTONI MINI ===== */
.btn-mini {
    padding: 8px 14px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
}

.btn-mini.btn-primary {
    background: #667eea !important;
    color: white !important;
}

.btn-mini.btn-success {
    background: #27ae60 !important;
    color: white !important;
}

.btn-mini.btn-danger {
    background: #e74c3c !important;
    color: white !important;
}

.btn-mini.btn-secondary {
    background: #95a5a6 !important;
    color: white !important;
}

.btn-mini.btn-warning {
    background: #f39c12 !important;
    color: white !important;
}

.btn-mini:hover {
    transform: translateY(-1px) !important;
    filter: brightness(1.1) !important;
}

/* ===== SELEZIONE INFO ===== */
.selection-info {
    background: #eaf2fd;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid #667eea30;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .room-header,
    .row-label-cell {
        min-width: 130px;
        font-size: 11px;
        padding: 0 8px;
    }
    
    .price-row td,
    .unit-row td {
        font-size: 12px;
        min-width: 70px;
    }
    
    #dates-header th .day-num {
        font-size: 16px;
    }
}