/**
 * RTO Grow - Booking Table Styles
 * 
 * Styles for the course instance booking table
 * Mobile-responsive with card view on smaller screens
 */

/* =====================================================
   BOOKING SECTION
   ===================================================== */

.rto-booking-section {
    margin: 40px 0;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 12px;
}

.rto-booking-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 25px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rto-booking-title-icon {
    font-size: 28px;
}

/* =====================================================
   NO INSTANCES MESSAGE
   ===================================================== */

.rto-booking-no-instances {
    text-align: center;
    padding: 40px 20px;
    background: #fff;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

.rto-no-instances-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.rto-booking-no-instances p {
    color: #666;
    margin: 0 0 15px 0;
    font-size: 16px;
}

/* =====================================================
   TABLE STYLES
   ===================================================== */

.rto-booking-table-wrapper {
    overflow-x: visible;
    overflow: visible;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.rto-booking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    table-layout: auto;
}

.rto-booking-table thead {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    color: #fff;
}

.rto-booking-table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.rto-booking-table th:first-child {
    border-radius: 8px 0 0 0;
}

.rto-booking-table th:last-child {
    border-radius: 0 8px 0 0;
    text-align: center;
}

.rto-booking-table td {
    padding: 18px 12px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.rto-booking-table tbody tr:last-child td {
    border-bottom: none;
}

.rto-booking-table tbody tr:hover {
    background: #f8f9fa;
}

/* Column Widths - optimized to prevent scroll */
.rto-col-name { width: 18%; min-width: 100px; }
.rto-col-date { width: 12%; min-width: 80px; }
.rto-col-time { width: 12%; min-width: 80px; }
.rto-col-location { width: 16%; min-width: 90px; }
.rto-col-spaces { width: 10%; min-width: 70px; text-align: center; }
.rto-col-cost { width: 10%; min-width: 60px; }
.rto-col-action { width: 12%; min-width: 90px; text-align: center; }

/* Delivery Mode Label */
.rto-delivery-mode {
    display: inline-block;
    background: #e9ecef;
    color: #666;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    margin-top: 4px;
}

/* Online Location */
.rto-location-online {
    color: #0066cc;
    font-weight: 500;
}

/* =====================================================
   AVAILABILITY INDICATORS
   ===================================================== */

.rto-availability {
    display: inline-block;
    min-width: 40px;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 14px;
    text-align: center;
}

.rto-availability-open {
    background: #d4edda;
    color: #155724;
}

.rto-availability-limited {
    background: #fff3cd;
    color: #856404;
}

.rto-availability-full {
    background: #f8d7da;
    color: #721c24;
}

.rto-availability-closed,
.rto-availability-cancelled {
    background: #e9ecef;
    color: #666;
    font-size: 12px;
}

/* =====================================================
   BUTTONS
   ===================================================== */

.rto-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    min-width: 130px;
}

.rto-btn-primary {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    color: #fff !important;
    box-shadow: 0 2px 4px rgba(230, 126, 34, 0.3);
}

.rto-btn-primary:hover {
    background: linear-gradient(135deg, #d35400 0%, #c0392b 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(230, 126, 34, 0.4);
    color: #fff !important;
    text-decoration: none;
}

.rto-btn-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: #fff !important;
    box-shadow: 0 2px 4px rgba(243, 156, 18, 0.3);
    animation: pulse 2s infinite;
}

.rto-btn-warning:hover {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    transform: translateY(-1px);
    color: #fff !important;
    text-decoration: none;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 2px 4px rgba(243, 156, 18, 0.3); }
    50% { box-shadow: 0 2px 12px rgba(243, 156, 18, 0.6); }
}

.rto-btn-disabled {
    background: #e9ecef;
    color: #666 !important;
    cursor: not-allowed;
    box-shadow: none;
}

.rto-btn-disabled:hover {
    transform: none;
    background: #e9ecef;
}

.rto-btn-full {
    background: #f8d7da;
    color: #721c24 !important;
}

.rto-btn-cancelled {
    background: #f5c6cb;
    color: #721c24 !important;
    text-decoration: line-through;
}

.rto-enquiry-btn {
    margin-top: 10px;
}

/* =====================================================
   ROW STATUS STYLES
   ===================================================== */

.rto-instance-row.rto-status-cancelled {
    opacity: 0.6;
    background: #f8f9fa;
}

.rto-instance-row.rto-status-cancelled td {
    text-decoration: line-through;
    color: #999;
}

.rto-instance-row.rto-status-cancelled .rto-col-action,
.rto-instance-row.rto-status-cancelled .rto-availability {
    text-decoration: none;
}

.rto-instance-row.rto-status-full {
    background: #fff5f5;
}

/* =====================================================
   MOBILE CARDS (Hidden by default)
   ===================================================== */

.rto-booking-cards {
    display: none;
}

.rto-booking-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 15px;
    overflow: hidden;
}

.rto-card-header {
    display: flex;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.rto-card-date {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    color: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    text-align: center;
    margin-right: 15px;
    min-width: 60px;
}

.rto-card-day {
    display: block;
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
}

.rto-card-month {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    margin-top: 4px;
}

.rto-card-info {
    flex: 1;
}

.rto-card-info h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
}

.rto-card-time,
.rto-card-location {
    margin: 0 0 4px 0;
    font-size: 13px;
    color: #666;
}

.rto-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
}

.rto-card-price {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
}

.rto-card-availability {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.rto-card-action .rto-btn {
    min-width: 110px;
    padding: 10px 15px;
}

/* Card Status Styles */
.rto-booking-card.rto-status-cancelled {
    opacity: 0.6;
}

.rto-booking-card.rto-status-full {
    border-left: 4px solid #dc3545;
}

.rto-booking-card.rto-status-limited {
    border-left: 4px solid #ffc107;
}

/* =====================================================
   RESPONSIVE STYLES
   ===================================================== */

@media (max-width: 992px) {
    .rto-booking-table-wrapper {
        display: none;
    }
    
    .rto-booking-cards {
        display: block;
    }
}

@media (max-width: 768px) {
    .rto-booking-section {
        padding: 20px 15px;
        margin: 30px -15px;
        border-radius: 0;
    }
    
    .rto-booking-title {
        font-size: 20px;
    }
    
    .rto-card-info h4 {
        font-size: 15px;
    }
    
    .rto-card-price {
        font-size: 18px;
    }
    
    .rto-card-action .rto-btn {
        min-width: auto;
        padding: 8px 12px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .rto-card-footer {
        flex-direction: column;
        gap: 12px;
    }
    
    .rto-card-details {
        text-align: center;
    }
    
    .rto-card-action {
        width: 100%;
    }
    
    .rto-card-action .rto-btn {
        width: 100%;
        display: block;
    }
}

/* =====================================================
   ELEMENTOR COMPATIBILITY
   ===================================================== */

.elementor-widget-container .rto-booking-section {
    margin: 0;
}

/* =====================================================
   PRINT STYLES
   ===================================================== */

@media print {
    .rto-booking-section {
        background: none;
        padding: 0;
    }
    
    .rto-btn {
        border: 1px solid #333;
        background: none !important;
        color: #333 !important;
    }
    
    .rto-booking-cards {
        display: none !important;
    }
    
    .rto-booking-table-wrapper {
        display: block !important;
        box-shadow: none;
    }
    
    .rto-booking-table thead {
        background: #333 !important;
        -webkit-print-color-adjust: exact;
    }
}
