/**
 * 预约系统样式
 */

/* 日期选择字段 */
.booking-date-field {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.booking-date-field:focus {
    outline: none;
    border-color: #4CAF50;
}

/* 时间段容器 */
.booking-timeslots {
    margin-top: 10px;
}

.timeslot-hint,
.timeslot-loading,
.timeslot-error {
    padding: 15px;
    text-align: center;
    border-radius: 4px;
    font-size: 14px;
}

.timeslot-hint {
    background: #f5f5f5;
    color: #666;
}

.timeslot-loading {
    background: #e3f2fd;
    color: #1976d2;
}

.timeslot-error {
    background: #ffebee;
    color: #c62828;
}

/* 时间段网格 */
.timeslot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

/* 时间段项 */
.timeslot-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    background: #fff;
    position: relative;
}

.timeslot-item:hover:not(.disabled) {
    border-color: #4CAF50;
    background: #f1f8f4;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
}

.timeslot-item input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.timeslot-item input[type="checkbox"]:checked {
    accent-color: #4CAF50;
}

.timeslot-name {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: #333;
}

.timeslot-count {
    font-size: 13px;
    color: #666;
    background: #f5f5f5;
    padding: 3px 8px;
    border-radius: 12px;
    margin-left: 8px;
}

/* 已满/禁用状态 */
.timeslot-item.disabled {
    background: #f5f5f5;
    border-color: #e0e0e0;
    cursor: not-allowed;
    opacity: 0.6;
}

.timeslot-item.disabled .timeslot-name {
    color: #999;
}

.timeslot-item.disabled .timeslot-count {
    background: #e0e0e0;
    color: #999;
}

.timeslot-item.disabled input[type="checkbox"] {
    cursor: not-allowed;
}

/* 选中状态 */
.timeslot-item:has(input:checked) {
    border-color: #4CAF50;
    background: #e8f5e9;
}

.timeslot-item:has(input:checked) .timeslot-name {
    color: #2e7d32;
    font-weight: 600;
}

.timeslot-item:has(input:checked) .timeslot-count {
    background: #4CAF50;
    color: #fff;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .timeslot-grid {
        grid-template-columns: 1fr;
    }
    
    .timeslot-item {
        padding: 10px 12px;
    }
    
    .timeslot-name {
        font-size: 14px;
    }
    
    .timeslot-count {
        font-size: 12px;
    }
}

/* 过期状态 */
.timeslot-item.expired {
    background: #fafafa;
    border-color: #e0e0e0;
    cursor: not-allowed;
    opacity: 0.5;
}

.timeslot-item.expired .timeslot-name {
    color: #999;
    text-decoration: line-through;
}

.timeslot-item.expired .timeslot-count {
    background: #e0e0e0;
    color: #999;
}

.timeslot-item.expired input[type="checkbox"] {
    cursor: not-allowed;
}

.timeslot-status {
    font-size: 12px;
    color: #f44336;
    background: #ffebee;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 5px;
}

.timeslot-booked-names {
    font-size: 11px;
    color: #999;
    font-style: italic;
    margin-left: 4px;
}

/* 日期选择包装器 */
.booking-date-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.booking-date-wrapper .booking-date-field {
    flex: 1;
}

.custom-date-btn {
    padding: 12px 20px;
    background: #2196F3;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    transition: background 0.3s;
}

.custom-date-btn:hover {
    background: #1976D2;
}

/* 自定义日期时间模态框 */
.custom-date-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

.custom-date-modal-content {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-date-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
}

.custom-date-modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.close-modal-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.close-modal-btn:hover {
    color: #333;
}

.custom-date-modal-body {
    padding: 25px;
}

.custom-date-form-group {
    margin-bottom: 20px;
}

.custom-date-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.custom-date-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.custom-date-input:focus {
    outline: none;
    border-color: #2196F3;
}

.custom-date-hint {
    background: #e3f2fd;
    padding: 12px 15px;
    border-radius: 4px;
    margin-top: 10px;
}

.custom-date-hint p {
    margin: 0;
    font-size: 14px;
    color: #1976D2;
}

.custom-date-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 25px;
    border-top: 1px solid #e0e0e0;
}

.btn-cancel,
.btn-confirm {
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-cancel {
    background: #f5f5f5;
    color: #666;
}

.btn-cancel:hover {
    background: #e0e0e0;
}

.btn-confirm {
    background: #4CAF50;
    color: #fff;
}

.btn-confirm:hover {
    background: #45a049;
}

/* 自定义日期时间显示 */
.custom-datetime-display {
    background: #e8f5e9;
    border: 2px solid #4CAF50;
    border-radius: 6px;
    padding: 15px;
    margin-top: 10px;
}

.custom-datetime-label {
    font-size: 13px;
    color: #2e7d32;
    margin-bottom: 8px;
    font-weight: 500;
}

.custom-datetime-value {
    font-size: 16px;
    color: #1b5e20;
    font-weight: 600;
    margin-bottom: 10px;
}

.custom-datetime-clear {
    padding: 6px 12px;
    background: #fff;
    color: #f44336;
    border: 1px solid #f44336;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
}

.custom-datetime-clear:hover {
    background: #f44336;
    color: #fff;
}

/* Flatpickr 自定义样式 */
.flatpickr-input {
    cursor: pointer;
}

.flatpickr-input:read-only {
    background-color: #fff;
    cursor: pointer;
}

/* 禁用日期的样式 */
.flatpickr-day.flatpickr-disabled {
    color: #ccc !important;
    background: #f5f5f5 !important;
    cursor: not-allowed !important;
}

.flatpickr-day.flatpickr-disabled:hover {
    background: #f5f5f5 !important;
    border-color: transparent !important;
}

/* 今天的日期 */
.flatpickr-day.today {
    border-color: #4CAF50;
}

/* 选中的日期 */
.flatpickr-day.selected {
    background: #4CAF50 !important;
    border-color: #4CAF50 !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .booking-date-wrapper {
        flex-direction: column;
    }
    
    .custom-date-btn {
        width: 100%;
    }
    
    .custom-date-modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .custom-date-modal-header,
    .custom-date-modal-body,
    .custom-date-modal-footer {
        padding: 15px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.timeslot-grid {
    animation: fadeIn 0.3s ease-out;
}

.timeslot-item {
    animation: fadeIn 0.3s ease-out;
}

.timeslot-item:nth-child(1) { animation-delay: 0.05s; }
.timeslot-item:nth-child(2) { animation-delay: 0.1s; }
.timeslot-item:nth-child(3) { animation-delay: 0.15s; }
.timeslot-item:nth-child(4) { animation-delay: 0.2s; }
.timeslot-item:nth-child(5) { animation-delay: 0.25s; }
.timeslot-item:nth-child(6) { animation-delay: 0.3s; }

/* 统一预约流程 */
.unified-booking-form .unified-step {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}
.unified-booking-form .unified-step-title {
    font-size: 1.05rem;
    margin: 0 0 12px 0;
    color: #333;
}
.unified-package-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.unified-package-block {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.unified-package-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
}
.unified-package-inline-detail {
    margin-top: 8px;
    margin-bottom: 4px;
    padding: 12px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #eee;
}
.unified-package-inline-media {
    margin-bottom: 8px;
}
.unified-package-timeslots-section {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}
.unified-timeslots-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}
.unified-package-timeslots .timeslot-grid {
    margin-top: 6px;
}
.unified-package-detail {
    margin-top: 14px;
    padding: 12px;
    background: #fafafa;
    border-radius: 8px;
}
.unified-package-image-wrap {
    text-align: center;
    margin-bottom: 10px;
}
.unified-package-carousel {
    position: relative;
    width: 100%;
}
.unified-package-image {
    max-width: 100%;
    max-height: 220px;
    border-radius: 8px;
    object-fit: contain;
}
.unified-carousel-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
}
.unified-carousel-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #ccc;
    border-radius: 50%;
    background: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #333;
}
.unified-carousel-btn:hover {
    background: #f5f5f5;
}
.unified-carousel-counter {
    font-size: 13px;
    color: #666;
    min-width: 48px;
    text-align: center;
}
.unified-package-desc {
    font-size: 14px;
    color: #444;
    line-height: 1.6;
    white-space: pre-wrap;
}
.unified-person-row {
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    background: #fff;
}
.unified-person-label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
}
.unified-person-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 520px) {
    .unified-person-fields {
        grid-template-columns: 1fr;
    }
}
.unified-warning {
    padding: 14px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    color: #856404;
    margin-bottom: 16px;
}
.unified-hint {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}
