/**
 * Rehearsal Room Availability Calendar Styles
 */

.rb-calendar-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

/* Header */
.rb-calendar-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rb-calendar-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.rb-nav-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 16px;
    font-weight: bold;
}

.rb-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.rb-calendar-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    min-width: 200px;
    text-align: center;
}

.rb-view-switcher {
    display: flex;
    gap: 5px;
}

.rb-view-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.rb-view-btn:hover,
.rb-view-btn.active {
    background: rgba(255, 255, 255, 0.3);
}

/* Calendar Content */
.rb-calendar-content {
    padding: 0;
    min-height: 400px;
}

.rb-calendar-loading,
.rb-calendar-error {
    padding: 40px;
    text-align: center;
    font-size: 16px;
}

.rb-calendar-error {
    color: #dc3545;
}

/* Month View */
.rb-calendar-month {
    width: 100%;
}

.rb-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.rb-weekday {
    padding: 12px;
    text-align: center;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.rb-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.rb-calendar-day {
    aspect-ratio: 1;
    padding: 8px;
    border: 1px solid #e9ecef;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: #fff;
}

.rb-calendar-day:hover {
    background: #f8f9fa;
    transform: scale(1.05);
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.rb-calendar-day.rb-selected {
    background: #007bff;
    color: white;
}

.rb-calendar-day.rb-other-month {
    background: #f8f9fa;
    cursor: default;
}

.rb-calendar-day.rb-other-month:hover {
    background: #f8f9fa;
    transform: none;
    box-shadow: none;
}

.rb-day-number {
    font-weight: 600;
    font-size: 14px;
}

/* Availability Status Colors */
.rb-calendar-day.rb-available {
    background: #d4edda;
    border-color: #c3e6cb;
}

.rb-calendar-day.rb-available:hover {
    background: #c3e6cb;
}

.rb-calendar-day.rb-limited {
    background: #fff3cd;
    border-color: #ffeaa7;
}

.rb-calendar-day.rb-limited:hover {
    background: #ffeaa7;
}

.rb-calendar-day.rb-fully-booked {
    background: #f8d7da;
    border-color: #f5c6cb;
}

.rb-calendar-day.rb-fully-booked:hover {
    background: #f5c6cb;
}

.rb-calendar-day.rb-past {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}

.rb-calendar-day.rb-past:hover {
    background: #e9ecef;
    transform: none;
    box-shadow: none;
}

/* Week View */
.rb-calendar-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e9ecef;
    padding: 1px;
}

.rb-week-day {
    background: white;
    min-height: 200px;
}

.rb-week-day-header {
    padding: 12px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    text-align: center;
}

.rb-day-name {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    font-weight: 600;
}

.rb-day-number {
    font-size: 18px;
    font-weight: 600;
    margin-top: 4px;
}

.rb-week-day-slots {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rb-time-slot {
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.rb-time-slot.rb-available {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.rb-time-slot.rb-available:hover {
    background: #c3e6cb;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.rb-time-slot.rb-booked {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    cursor: not-allowed;
}

/* Date Detail Panel */
.rb-date-detail {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90vw;
    max-height: 80vh;
    overflow: hidden;
    z-index: 1000;
    display: none;
}

.rb-date-detail-header {
    background: #667eea;
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rb-date-detail-header h4 {
    margin: 0;
    font-size: 16px;
}

.rb-close-detail {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rb-date-detail-content {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.rb-available-slots {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rb-slot-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.rb-slot-item.rb-available {
    background: #d4edda;
    border-color: #c3e6cb;
}

.rb-slot-item.rb-booked {
    background: #f8d7da;
    border-color: #f5c6cb;
}

.rb-slot-time {
    font-weight: 600;
    font-size: 14px;
}

.rb-slot-status {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
}

.rb-book-slot {
    background: #007bff;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.rb-book-slot:hover {
    background: #0056b3;
}

/* Calendar Legend */
.rb-calendar-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 16px 20px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    font-size: 12px;
}

.rb-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rb-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid #dee2e6;
}

.rb-legend-color.rb-available {
    background: #d4edda;
    border-color: #c3e6cb;
}

.rb-legend-color.rb-limited {
    background: #fff3cd;
    border-color: #ffeaa7;
}

.rb-legend-color.rb-fully-booked {
    background: #f8d7da;
    border-color: #f5c6cb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .rb-calendar-container {
        margin: 0;
        border-radius: 0;
    }
    
    .rb-calendar-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .rb-calendar-nav {
        order: 2;
    }
    
    .rb-view-switcher {
        order: 1;
    }
    
    .rb-calendar-legend {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }
    
    .rb-weekday {
        font-size: 10px;
        padding: 8px 4px;
    }
    
    .rb-calendar-day {
        padding: 4px;
    }
    
    .rb-day-number {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .rb-calendar-week {
        grid-template-columns: repeat(1, 1fr);
    }
    
    .rb-week-day {
        min-height: 120px;
    }
    
    .rb-week-day-slots {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .rb-time-slot {
        flex: 0 0 auto;
        min-width: 60px;
    }
}