/* ==================== 预订情况视图布局修复 ==================== */
/* 修复：当窗口变窄时，日视图、周视图、月视图改为左右滚动而不是压缩 */

/* ==================== 周视图修复 ==================== */
.week-view {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 14px;
    transition: all 0.3s ease;
}

/* 窗口变窄时改为水平滚动 */
@media (max-width: 1200px) {
    .week-view {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 10px;
        gap: 12px;
        scrollbar-width: thin;
        scrollbar-color: #c5c5c5 #f0f0f0;
    }
    
    .week-view::-webkit-scrollbar {
        height: 6px;
    }
    
    .week-view::-webkit-scrollbar-track {
        background: #f0f0f0;
        border-radius: 3px;
    }
    
    .week-view::-webkit-scrollbar-thumb {
        background: #c5c5c5;
        border-radius: 3px;
    }
    
    .week-view::-webkit-scrollbar-thumb:hover {
        background: #a5a5a5;
    }
    
    .day-column {
        min-width: 180px;
        flex-shrink: 0;
    }
}

/* 更小的屏幕 */
@media (max-width: 768px) {
    .week-view {
        gap: 10px;
        padding-bottom: 8px;
    }
    
    .day-column {
        min-width: 160px;
    }
}

/* 非常小的屏幕 */
@media (max-width: 480px) {
    .week-view {
        gap: 8px;
    }
    
    .day-column {
        min-width: 140px;
    }
}

/* ==================== 月视图修复 ==================== */
.month-calendar .calendar-header {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 8px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.month-calendar .calendar-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    transition: all 0.3s ease;
}

/* 窗口变窄时改为水平滚动 */
@media (max-width: 1200px) {
    .month-calendar {
        overflow-x: auto;
        overflow-y: hidden;
    }
    
    .month-calendar .calendar-header {
        min-width: 800px;
        display: grid !important;
        grid-template-columns: repeat(7, 1fr) !important;
    }
    
    .month-calendar .calendar-body {
        min-width: 800px;
        display: grid;
        grid-template-columns: repeat(7, 1fr);
    }
    
    .calendar-day {
        min-width: 110px;
    }
}

/* 更小的屏幕 */
@media (max-width: 768px) {
    .month-calendar .calendar-header {
        min-width: 700px;
        gap: 6px;
    }
    
    .month-calendar .calendar-body {
        min-width: 700px;
        gap: 6px;
    }
    
    .calendar-day {
        min-width: 100px;
    }
}

/* ==================== 日视图修复 ==================== */
.booking-card {
    display: flex;
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    min-height: 80px;
}

/* 确保卡片内容不会被压扁 */
@media (max-width: 768px) {
    .booking-card {
        flex-direction: column;
        padding: 12px;
    }
    
    .card-left,
    .card-center,
    .card-right {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .card-right {
        text-align: right;
    }
    
    .booking-card:last-child {
        margin-bottom: 0;
    }
}

/* 日视图时间段卡片优化 */
.period-bookings {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 确保在窄窗口中卡片宽度合适 */
@media (max-width: 480px) {
    .booking-card {
        padding: 10px;
    }
    
    .card-time {
        font-size: 13px;
    }
    
    .card-activity {
        font-size: 14px;
    }
}

/* ==================== 视图切换按钮优化 ==================== */
.view-switcher {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.view-btn {
    padding: 8px 16px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #495057;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.view-btn:hover {
    background: #e9ecef;
    border-color: #ced4da;
}

.view-btn.active {
    background: #1976D2;
    color: white;
    border-color: #1976D2;
}

.nav-btn {
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #495057;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: #e9ecef;
    border-color: #ced4da;
}

.current-date {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #495057;
    font-weight: 500;
}

/* 移动端视图切换优化 */
@media (max-width: 768px) {
    .view-switcher {
        gap: 8px;
    }
    
    .view-btn,
    .nav-btn {
        padding: 6px 12px;
        font-size: 14px;
    }
    
    .current-date {
        padding: 6px 12px;
        font-size: 14px;
    }
}

/* 确保内容区域在窄窗口中正常显示 */
.section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .section {
        padding: 20px;
        border-radius: 10px;
    }
}

/* ==================== 滚动提示 ==================== */
.scroll-hint {
    display: none;
    text-align: center;
    color: #6c757d;
    font-size: 14px;
    margin-top: 10px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px dashed #dee2e6;
}

@media (max-width: 1200px) {
    .scroll-hint {
        display: block;
    }
}

/* ==================== 通用滚动容器样式 ==================== */
.scrollable-container {
    position: relative;
}

.scrollable-container::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 40px;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.9));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

@media (max-width: 1200px) {
    .scrollable-container::after {
        opacity: 1;
    }
    
    .scrollable-container.scrolled-to-end::after {
        opacity: 0;
    }
}