/**
 * 前端日历样式
 */

.tpc-calendar-container {
    margin: 15px 0;
    padding: 15px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* 在 wb2 侧栏中紧凑布局 */
.wb2 .tpc-calendar-container {
    margin-top: 15px;
    padding: 12px;
}

.wb2 .tpc-calendar-header h3 {
    font-size: 16px;
}

.wb2 .tpc-month-title {
    font-size: 15px;
}

.wb2 .tpc-calendar-day {
    min-height: 45px;
    padding: 5px 2px;
}

.wb2 .tpc-day-date {
    font-size: 13px;
}

.wb2 .tpc-day-price {
    font-size: 10px;
}

.wb2 .tpc-day-inventory {
    font-size: 9px;
}

.wb2 .tpc-people-selector {
    padding: 10px;
}

.wb2 .tpc-price-total {
    font-size: 22px;
}

.wb2 .tpc-submit-btn {
    padding: 12px;
    font-size: 16px;
}

.tpc-calendar-header {
    text-align: center;
    margin-bottom: 20px;
}

.tpc-calendar-header h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 20px;
}

.tpc-month-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.tpc-month-nav button {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.tpc-month-nav button:hover {
    background: #005177;
}

.tpc-month-nav button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.tpc-month-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.tpc-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 10px;
}

.tpc-calendar-day-header {
    text-align: center;
    padding: 10px 5px;
    font-weight: 600;
    color: #666;
    font-size: 14px;
}

.tpc-calendar-day {
    text-align: center;
    padding: 10px 5px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.tpc-calendar-day:hover {
    background: #f0f8ff;
    border-color: #0073aa;
}

.tpc-calendar-day.tpc-today {
    border: 2px solid #0073aa;
}

.tpc-calendar-day.tpc-selected {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.tpc-calendar-day.tpc-in-range {
    background: #e0f0ff;
    border-color: #0073aa;
}

.tpc-calendar-day.tpc-unavailable {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    text-decoration: line-through;
}

.tpc-calendar-day.tpc-low-inventory {
    position: relative;
}

.tpc-calendar-day.tpc-low-inventory::after {
    content: '紧张';
    position: absolute;
    top: 2px;
    right: 2px;
    background: #ff9800;
    color: #fff;
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 2px;
}

.tpc-calendar-day.tpc-no-inventory {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.tpc-calendar-day.tpc-no-inventory::after {
    content: '已满';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #999;
    color: #fff;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
}

.tpc-day-date {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
}

.tpc-day-price {
    font-size: 12px;
    color: #46b450;
    font-weight: 600;
}

.tpc-calendar-day.tpc-selected .tpc-day-price {
    color: #fff;
}

.tpc-day-inventory {
    font-size: 10px;
    color: #666;
    margin-top: 3px;
}

.tpc-calendar-day.tpc-selected .tpc-day-inventory {
    color: #fff;
}

.tpc-selected-dates {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
    text-align: center;
}

.tpc-selected-dates h4 {
    margin: 0 0 10px 0;
    color: #333;
}

.tpc-selected-dates p {
    margin: 5px 0;
    color: #666;
}

.tpc-people-selector {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 4px;
}

.tpc-people-selector h4 {
    margin: 0 0 15px 0;
    color: #333;
}

.tpc-people-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.tpc-people-row:last-child {
    border-bottom: none;
}

.tpc-people-info {
    flex: 1;
}

.tpc-people-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.tpc-people-price {
    font-size: 14px;
    color: #46b450;
}

.tpc-people-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tpc-people-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tpc-people-btn:hover {
    background: #f0f0f0;
}

.tpc-people-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tpc-people-input {
    width: 50px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px;
    font-size: 16px;
}

.tpc-mandatory-fees {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
}

.tpc-mandatory-fees h4 {
    margin: 0 0 10px 0;
    color: #333;
}

.tpc-mandatory-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
    color: #666;
}

.tpc-mandatory-row:last-child {
    border-bottom: none;
}

.tpc-price-summary {
    margin: 15px 0;
    padding: 15px;
    background: #fff8e1;
    border: 2px solid #ffc107;
    border-radius: 8px;
}

/* 日期信息区 */
.tpc-price-dates {
    margin-bottom: 5px;
}

.tpc-price-date-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 14px;
    color: #333;
}

.tpc-price-date-row span:last-child {
    font-weight: 600;
}

/* 分隔线 */
.tpc-price-divider {
    border-top: 1px dashed #e0c88a;
    margin: 8px 0;
}

/* 费用明细 */
.tpc-price-detail {
    font-size: 13px;
    color: #555;
}

.tpc-price-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
}

.tpc-price-detail-total {
    font-weight: 600;
    color: #333;
    padding-top: 6px;
    border-top: 1px solid #e0c88a;
    margin-top: 4px;
}

/* 总计 */
.tpc-price-grand {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 700;
    color: #333;
}

.tpc-price-total {
    font-size: 24px;
    color: #ff5722;
}

.tpc-submit-btn {
    display: block;
    width: 100%;
    padding: 15px;
    background: #ff5722;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: background 0.3s;
}

.tpc-submit-btn:hover {
    background: #e64a19;
}

.tpc-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.tpc-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.tpc-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #0073aa;
    border-top-color: transparent;
    border-radius: 50%;
    animation: tpc-spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes tpc-spin {
    to { transform: rotate(360deg); }
}

/* 弹窗表单 */
.tpc-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tpc-modal {
    background: #fff;
    border-radius: 10px;
    width: 400px;
    max-width: 90vw;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.tpc-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.tpc-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.tpc-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.tpc-modal-close:hover {
    color: #333;
}

.tpc-modal-body {
    padding: 20px;
}

.tpc-form-group {
    margin-bottom: 15px;
}

.tpc-form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: #333;
    font-weight: 600;
}

.tpc-required {
    color: #ff5722;
}

.tpc-form-group input,
.tpc-form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.tpc-form-group input:focus,
.tpc-form-group textarea:focus {
    border-color: #0073aa;
    outline: none;
}

.tpc-form-group textarea {
    resize: vertical;
}

.tpc-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #eee;
}

.tpc-modal-cancel {
    padding: 10px 20px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.tpc-modal-submit {
    padding: 10px 25px;
    border: none;
    background: #ff5722;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.tpc-modal-submit:hover {
    background: #e64a19;
}

.tpc-modal-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .tpc-calendar-container {
        padding: 15px;
    }
    
    .tpc-calendar-day {
        min-height: 50px;
        padding: 8px 3px;
    }
    
    .tpc-day-date {
        font-size: 14px;
    }
    
    .tpc-day-price {
        font-size: 10px;
    }
    
    .tpc-people-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .tpc-people-control {
        width: 100%;
        justify-content: flex-start;
    }

    /* 小屏幕下 wb2 变全宽，日历恢复正常大小 */
    .wb2 .tpc-calendar-container {
        padding: 15px;
    }

    .wb2 .tpc-calendar-day {
        min-height: 50px;
        padding: 8px 3px;
    }

    .wb2 .tpc-day-date {
        font-size: 14px;
    }

    .wb2 .tpc-day-price {
        font-size: 10px;
    }

    .wb2 .tpc-price-total {
        font-size: 28px;
    }

    .wb2 .tpc-submit-btn {
        padding: 15px;
        font-size: 18px;
    }
}
