/* Standard Calendar View */
.cabin-calendar {
    max-width: 100%;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.cabin-month {
    margin-bottom: 50px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 20px;
}

.month-header {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 20px 0;
    color: #333;
    text-align: center;
}

.calendar-grid {
    overflow-x: auto;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.calendar-header {
    display: flex;
    background-color: #f5f5f5;
    border-bottom: 2px solid #ddd;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.cabin-label {
    min-width: 150px;
    padding: 12px;
    border-right: 1px solid #ddd;
    display: flex;
    align-items: center;
    font-weight: 600;
    background-color: #f5f5f5;
    position: sticky;
    left: 0;
    z-index: 11;
}

.day-header {
    min-width: 35px;
    width: 35px;
    padding: 8px 4px;
    text-align: center;
    font-size: 13px;
    border-right: 1px solid #f0f0f0;
}

.cabin-row {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
}

.cabin-row:last-child {
    border-bottom: none;
}

.day-cell {
    min-width: 35px;
    width: 35px;
    height: 40px;
    border-right: 1px solid #f0f0f0;
    position: relative;
    transition: opacity 0.2s;
}

.day-cell.available {
    background-color: #fff;
}

.day-cell.available:hover {
    background-color: #f9f9f9;
}

.day-cell.booked {
    opacity: 0.85;
    cursor: pointer;
}

.day-cell.booked:hover {
    opacity: 1;
}

.day-cell.booking-start {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

.day-cell.booking-end {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

.group-name {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    z-index: 5;
}

.calendar-legend {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.calendar-legend h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #555;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    margin-right: 12px;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.1);
}

.legend-text {
    font-size: 14px;
    color: #333;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .cabin-label {
        min-width: 100px;
        font-size: 13px;
    }
    
    .day-header,
    .day-cell {
        min-width: 30px;
        width: 30px;
    }
    
    .group-name {
        font-size: 10px;
        left: 4px;
    }
    
    .month-header {
        font-size: 20px;
    }
}

/* Compact Calendar View Styles */
.cabin-calendar-compact {
    max-width: 1200px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.compact-month-container {
    margin-bottom: 40px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 25px;
}

.compact-month-header {
    font-size: 26px;
    font-weight: 600;
    margin: 0 0 25px 0;
    color: #1e293b;
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

.compact-cabin-section {
    margin-bottom: 30px;
}

.compact-cabin-section:last-of-type {
    margin-bottom: 20px;
}

.compact-cabin-name {
    font-size: 18px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 6px;
    border-left: 4px solid #3b82f6;
}

.compact-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 15px;
}

.compact-day-header {
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    color: #64748b;
    padding: 8px 4px;
    background: #f8fafc;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.compact-day-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    min-height: 45px;
}

.compact-day-cell.empty {
    background: transparent;
    cursor: default;
}

.compact-day-cell.available {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
}

.compact-day-cell.available:hover {
    background-color: #e2e8f0;
    transform: scale(1.05);
}

.compact-day-cell.booked {
    border: 2px solid rgba(0,0,0,0.1);
    color: white;
    font-weight: 600;
}

.compact-day-cell.booked:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 10;
}

.compact-day-number {
    font-size: 14px;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.compact-day-cell.booked .compact-day-number {
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.compact-legend {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #e2e8f0;
}

.compact-legend-title {
    font-size: 16px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 12px;
}

.compact-legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 6px 10px;
    background-color: #f8fafc;
    border-radius: 6px;
    font-size: 14px;
}

.compact-legend-color {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    margin-right: 10px;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.1);
}

.compact-legend-text {
    color: #334155;
    line-height: 1.4;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .compact-month-container {
        padding: 15px;
    }
    
    .compact-month-header {
        font-size: 22px;
    }
    
    .compact-cabin-name {
        font-size: 16px;
    }
    
    .compact-calendar-grid {
        gap: 2px;
    }
    
    .compact-day-header {
        font-size: 10px;
        padding: 6px 2px;
    }
    
    .compact-day-cell {
        min-height: 35px;
    }
    
    .compact-day-number {
        font-size: 12px;
    }
    
    .compact-legend-item {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .compact-day-header {
        font-size: 9px;
        padding: 4px 1px;
    }
    
    .compact-day-cell {
        min-height: 30px;
    }
    
    .compact-day-number {
        font-size: 11px;
    }
}

/* FIXED: Micro Calendar - Moved from inline styles */
.cabin-calendar-micro {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    font-size: 11px;
}

.micro-month {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 10px;
}

.micro-month-header {
    font-weight: 700;
    font-size: 12px;
    color: #1e293b;
    text-align: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.micro-cabins {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.micro-cabin {
    display: flex;
    align-items: center;
    gap: 6px;
}

.micro-cabin-label {
    font-weight: 600;
    font-size: 10px;
    color: #475569;
    min-width: 40px;
    max-width: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.micro-days {
    display: flex;
    flex-wrap: wrap;
    gap: 1px;
    flex: 1;
}

.micro-day {
    width: 4px;
    height: 4px;
    border-radius: 1px;
    display: inline-block;
    transition: transform 0.15s;
}

.micro-day.empty {
    background: transparent;
}

.micro-day.available {
    background: #f1f5f9;
}

.micro-day.booked {
    cursor: pointer;
}

.micro-day.booked:hover {
    transform: scale(1.8);
    z-index: 10;
}

.micro-legend {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.micro-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 9px;
    color: #475569;
}

.micro-color {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    display: inline-block;
}

@media (max-width: 768px) {
    .cabin-calendar-micro {
        grid-template-columns: 1fr;
    }
}