/* ===== 商品頁面預約Modal樣式 ===== */

/* Modal 基礎樣式 */
.booking-modal .modal-dialog {
    max-width: 95%;
    width: 1400px;
    margin: 1rem auto;
}

.booking-modal .modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(46, 139, 123, 0.15);
    overflow: hidden;
}

.booking-modal .modal-header {
    background: linear-gradient(135deg, #2e8b7b 0%, #4a9d8f 100%);
    color: white;
    border-bottom: none;
    padding: 1.5rem 2rem;
}

.booking-modal .modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.booking-modal .btn-close {
    background: white;
    border-radius: 50%;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.booking-modal .btn-close:hover {
    opacity: 1;
}

.booking-modal .modal-body {
    padding: 0;
    max-height: 80vh;
    overflow-y: auto;
}

/* Modal 內容布局 */
.modal-booking-container {
    display: flex;
    min-height: 600px;
}

/* 左側商品信息 */
.modal-product-info {
    width: 350px;
    background: #f8f9fa;
    padding: 2rem;
    border-right: 1px solid #e9ecef;
}

.modal-product-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(46, 139, 123, 0.1);
}

.modal-product-image {
    width: 100%;
    height: 160px;
    border-radius: 8px;
    object-fit: cover;
    margin-bottom: 1rem;
}

.modal-product-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2e8b7b;
    margin-bottom: 0.5rem;
}

.modal-product-desc {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.modal-product-details {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.modal-detail-item {
    text-align: center;
}

.modal-detail-icon {
    display: block;
    color: #2e8b7b;
    margin-bottom: 0.25rem;
}

.modal-detail-text {
    font-size: 0.8rem;
    color: #6c757d;
}

.modal-product-pricing {
    background: #e8f5f3;
    border-radius: 8px;
    padding: 1rem;
}

.modal-price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.modal-price-item:last-child {
    margin-bottom: 0;
}

.modal-price-label {
    color: #495057;
    font-size: 0.9rem;
}

.modal-price-value {
    font-weight: 600;
    color: #2e8b7b;
    font-size: 1.1rem;
}

/* 人數選擇區域 */
.modal-guest-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(46, 139, 123, 0.1);
}

.modal-guest-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2e8b7b;
    margin-bottom: 1rem;
}

.modal-guest-type {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e9ecef;
}

.modal-guest-type:last-child {
    border-bottom: none;
}

.modal-guest-info {
    flex: 1;
}

.modal-guest-name {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.25rem;
}

.modal-guest-desc {
    font-size: 0.8rem;
    color: #6c757d;
}

.modal-guest-counter {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-guest-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-guest-btn:hover {
    background: #2e8b7b;
    color: white;
    border-color: #2e8b7b;
}

.modal-guest-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.modal-guest-count {
    font-weight: 600;
    color: #495057;
    min-width: 30px;
    text-align: center;
}

/* 右側預約區域 */
.modal-booking-area {
    flex: 1;
    padding: 2rem;
    background: white;
}

/* 日曆樣式 */
.modal-calendar-section {
    margin-bottom: 2rem;
}

.modal-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.modal-calendar-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2e8b7b;
    margin: 0;
}

.modal-month-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.modal-month-btn {
    background: white;
    border: 1px solid #2e8b7b;
    color: #2e8b7b;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-month-btn:hover {
    background: #2e8b7b;
    color: white;
}

.modal-current-month {
    font-weight: 600;
    color: #495057;
    min-width: 120px;
    text-align: center;
}

.modal-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(46, 139, 123, 0.1);
}

.modal-calendar-day-header {
    background: #2e8b7b;
    color: white;
    padding: 1rem 0;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.modal-calendar-date {
    background: white;
    padding: 1rem 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.modal-calendar-date:hover {
    background: #f8f9fa;
}

.modal-calendar-date.other-month {
    opacity: 0.3;
    cursor: not-allowed;
}

.modal-calendar-date.today {
    background: #fff3cd;
    border: 2px solid #ffc107;
}

.modal-calendar-date.selected {
    background: #d4edda;
    border: 2px solid #28a745;
}

.modal-calendar-date.has-slots {
    border-left: 4px solid #28a745;
}

/* 週末可預約日期特殊樣式 */
.modal-calendar-date.weekend-bookable {
    border-left: 4px solid #ff6b35 !important;
    background: linear-gradient(135deg, #fff8f1 0%, #ffe4d1 100%);
}

.modal-calendar-date.weekend-bookable:hover {
    background: linear-gradient(135deg, #ffe4d1 0%, #ffd4b8 100%);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.2);
}

.modal-calendar-date.weekend-bookable .modal-calendar-slots-indicator {
    color: #e55a2b;
    font-weight: 600;
}

/* 週末標記 */
.modal-calendar-date.weekend-bookable::before {
    content: "🎉";
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.7rem;
    opacity: 0.8;
}

.modal-calendar-date.weekend-bookable .modal-calendar-date-number {
    color: #d63031;
    font-weight: 700;
}

/* 日曆說明區域 */
.modal-calendar-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #495057;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    position: relative;
}

.legend-color.has-slots {
    background: white;
    border: 2px solid #28a745;
    border-left: 4px solid #28a745;
}

.legend-color.weekend-bookable {
    background: linear-gradient(135deg, #fff8f1 0%, #ffe4d1 100%);
    border: 2px solid #ff6b35;
    border-left: 4px solid #ff6b35;
}

.legend-color.weekend-bookable::before {
    content: "🎉";
    position: absolute;
    top: -2px;
    right: -2px;
    font-size: 0.6rem;
    line-height: 1;
}

.legend-color.fully-booked {
    background: #f8d7da;
    border: 2px solid #dc3545;
    border-left: 4px solid #dc3545;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .modal-calendar-legend {
        flex-direction: column;
        gap: 0.75rem;
        align-items: center;
    }
    
    .legend-item {
        justify-content: center;
        min-width: 120px;
    }
}

.modal-calendar-date.fully-booked {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    cursor: not-allowed;
}

.modal-calendar-date-number {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.modal-calendar-slots-indicator {
    font-size: 0.7rem;
    color: #28a745;
    font-weight: 500;
}

/* 時段選擇區域 */
.modal-timeslot-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e9ecef;
}

.modal-selected-date-info {
    margin-bottom: 1.5rem;
}

.modal-selected-date-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2e8b7b;
    margin-bottom: 0.5rem;
}

.modal-selected-date-subtitle {
    color: #6c757d;
    margin: 0;
}

.modal-timeslot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.modal-timeslot-item {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.modal-timeslot-item:hover {
    border-color: #2e8b7b;
    background: #f8fffe;
}

.modal-timeslot-item.selected {
    border-color: #28a745;
    background: #d4edda;
}

.modal-timeslot-item.unavailable {
    background: #f8d7da;
    border-color: #dc3545;
    cursor: not-allowed;
    opacity: 0.6;
}

.modal-timeslot-time {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.25rem;
}

.modal-timeslot-status {
    font-size: 0.8rem;
    color: #6c757d;
}

.modal-timeslot-item.unavailable .modal-timeslot-status {
    color: #dc3545;
}

/* Modal 底部按鈕區域 */
.modal-footer {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-booking-summary {
    flex: 1;
    margin-right: 2rem;
}

.modal-summary-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2e8b7b;
    margin-bottom: 0.5rem;
}

.modal-summary-details {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.4;
}

.modal-action-buttons {
    display: flex;
    gap: 1rem;
}

.modal-btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn-secondary:hover {
    background: #5a6268;
}

.modal-btn-primary {
    background: #2e8b7b;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.modal-btn-primary:hover {
    background: #267a6b;
}

.modal-btn-primary:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* 響應式設計 */
@media (max-width: 1200px) {
    .booking-modal .modal-dialog {
        width: 95%;
    }
    
    .modal-product-info {
        width: 300px;
    }
}

@media (max-width: 992px) {
    .modal-booking-container {
        flex-direction: column;
    }
    
    .modal-product-info {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }
    
    .modal-calendar-grid {
        font-size: 0.9rem;
    }
    
    .modal-calendar-date {
        min-height: 60px;
        padding: 0.75rem 0.25rem;
    }
}

@media (max-width: 768px) {
    .booking-modal .modal-dialog {
        margin: 0.5rem;
        width: calc(100% - 1rem);
    }
    
    .modal-product-info,
    .modal-booking-area {
        padding: 1.5rem;
    }
    
    .modal-footer {
        padding: 1rem 1.5rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .modal-booking-summary {
        margin-right: 0;
        text-align: center;
    }
    
    .modal-action-buttons {
        width: 100%;
        justify-content: center;
    }
}

/* 載入動畫 */
.modal-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

.modal-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #2e8b7b;
    border-radius: 50%;
    animation: modal-spin 1s linear infinite;
}

@keyframes modal-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 成功訊息 */
.modal-success-message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    color: #155724;
    text-align: center;
}

.modal-success-icon {
    color: #28a745;
    font-size: 2rem;
    margin-bottom: 0.5rem;
} 

/* 時段按鈕基本樣式 */
.modal-timeslot-btn {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 0.5rem;
    color: #333 !important; /* 確保基本文字對比度 */
    font-weight: 500;
}

.modal-timeslot-btn:hover:not([disabled]) {
    border-color: var(--primary-color, #007bff);
    box-shadow: 0 2px 8px rgba(0,123,255,0.2);
}

.modal-timeslot-btn.selected {
    border-color: var(--primary-color, #007bff);
    background: var(--primary-color, #007bff);
    color: white;
}

/* 時段狀態樣式 */
.modal-timeslot-btn.available {
    border-color: #28a745;
    background: #f8fff9;
}

.modal-timeslot-btn.available:hover {
    border-color: #28a745;
    background: #e8f5e8;
}

.modal-timeslot-btn.full {
    border-color: #dc3545;
    background: #fdf2f2;
    color: #721c24 !important;
    cursor: not-allowed;
    font-weight: 600;
}

.modal-timeslot-btn.inactive {
    border-color: #6c757d;
    background: #f1f3f5;
    color: #495057 !important; /* 增強對比度 */
    cursor: not-allowed;
    font-weight: 600;
}

.modal-timeslot-btn.unavailable {
    border-color: #dee2e6;
    background: #f8f9fa;
    color: #6c757d !important; /* 增強對比度 */
    cursor: not-allowed;
    font-weight: 600;
}

.modal-timeslot-btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 時段內容樣式 */
.timeslot-time {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.timeslot-name {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.timeslot-status {
    font-size: 0.85rem;
    font-weight: 500;
}

.timeslot-price {
    font-size: 0.8rem;
    color: #28a745;
    margin-top: 0.25rem;
    font-weight: 500;
}

/* 日曆載入和錯誤狀態 */
.modal-calendar-loading,
.modal-calendar-error,
.modal-no-bookable-dates {
    grid-column: 1 / -1;
    padding: 2rem;
}

/* 無可預約日期提示樣式 */
.modal-no-bookable-dates {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    margin: 1rem;
    border: 1px solid #dee2e6;
}

.modal-no-bookable-dates h5 {
    color: #495057;
    font-weight: 600;
}

.modal-no-bookable-dates .fa-calendar-times {
    color: #adb5bd;
}

.modal-no-bookable-dates .btn-outline-primary {
    border-width: 2px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.modal-no-bookable-dates .btn-outline-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,123,255,0.2);
}

.modal-no-bookable-dates .btn-link {
    text-decoration: none;
    transition: all 0.3s ease;
}

.modal-no-bookable-dates .btn-link:hover {
    color: #007bff !important;
    text-decoration: underline;
}

/* 日曆日期狀態增強 */
.modal-calendar-date.blocked {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    cursor: not-allowed;
}

.modal-calendar-date.unavailable {
    background: #f8f9fa;
    color: #adb5bd;
    cursor: not-allowed;
}

.modal-calendar-date.past {
    background: #f8f9fa;
    color: #adb5bd;
    cursor: not-allowed;
}

.modal-calendar-blocked-reason {
    font-size: 0.7rem;
    color: #e67e22;
    margin-top: 2px;
    text-align: center;
}

/* 預約摘要樣式 */
.booking-summary-content {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.summary-row {
    margin-bottom: 0.5rem;
    line-height: 1.3;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    justify-content: space-between;
}

.info-group {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex: 1;
    min-width: 0;
}

.info-group strong {
    color: #495057;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.info-group span {
    color: #6c757d;
    font-weight: 500;
}

.price-section {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid #dee2e6;
}

.price-breakdown {
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.price-item {
    color: #6c757d;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    background: rgba(108, 117, 125, 0.05);
    margin-bottom: 0.15rem;
}

.price-item span:first-child {
    font-weight: 500;
}

.price-item span:last-child {
    font-weight: 600;
    color: #495057;
}

.total-amount {
    margin-top: 0.5rem !important;
    padding: 0.4rem 0.6rem;
    border-top: 1px solid #dee2e6;
    border-radius: 6px;
    background: linear-gradient(135deg, #f8fff9 0%, #e8f5e8 100%);
    font-size: 1.1rem !important;
    color: #28a745 !important;
    font-weight: 600;
    text-align: center;
}

.total-amount strong {
    color: #28a745 !important;
}

/* 響應式調整 */
@media (max-width: 576px) {
    .summary-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        justify-content: flex-start;
    }
    
    .info-group {
        justify-content: space-between;
        padding: 0.25rem 0.5rem;
        background: rgba(108, 117, 125, 0.03);
        border-radius: 4px;
    }
    
    .price-item {
        padding: 0.3rem 0.5rem;
    }
    
    .total-amount {
        margin-top: 0.3rem !important;
        padding: 0.5rem !important;
    }
} 