/**
 * Parkone Health Booking Frontend Styles
 */

/* Color Theme Variables - Updated color scheme */
:root {
    --ph-primary: #CD907E;      /* Warm terracotta - primary actions, titles, G SKUs */
    --ph-secondary: #DDCBB3;    /* Soft beige - secondary elements, I SKUs */
    --ph-tertiary: #788760;     /* Olive green - other SKUs */
    --ph-primary-light: rgba(205, 144, 126, 0.1);
    --ph-secondary-light: rgba(221, 203, 179, 0.1);
}

/* Reset browser default margins for h4 */
.ph-booking-form h4 {
    margin: 8px 0;
}

/* Booking Form Wrapper */
.ph-booking-form-wrapper {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

.ph-booking-form {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 40px;
}

.ph-booking-title {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 40px;
}

/* Form Sections */
.ph-form-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
}

.ph-form-section:last-child {
    border-bottom: none;
}

.ph-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 600;
    color: var(--ph-primary);
    margin-bottom: 25px;
}

.ph-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--ph-primary);
    color: white;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 700;
}

/* Package Selection */
.ph-package-selection {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.ph-package-option {
    cursor: pointer;
}

.ph-package-option input[type="radio"] {
    display: none;
}

.ph-package-card {
    position: relative;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 25px;
    transition: all 0.3s ease;
    background: #fafafa;
    height: 100%;
}

.ph-package-card:hover {
    border-color: var(--ph-secondary);
    box-shadow: 0 4px 12px rgba(205, 144, 126, 0.15);
    transform: translateY(-2px);
}

.ph-package-option input:checked + .ph-package-card {
    border-color: var(--ph-primary);
    background: var(--ph-primary-light);
    box-shadow: 0 6px 16px rgba(120, 135, 96, 0.25);
}

.ph-package-name {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
}

.ph-package-description {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.ph-package-select-badge {
    display: inline-block;
    padding: 6px 14px;
    background: var(--ph-secondary);
    color: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.ph-package-option input:checked + .ph-package-card .ph-package-select-badge {
    background: var(--ph-primary);
}

/* Package Items Display */
.ph-package-items {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 25px;
}

.ph-items-group {
    margin-bottom: 6px;
}

.ph-items-group:last-child {
    margin-bottom: 0;
}

.ph-items-group h4 {
    font-size: 16px;
    font-weight: 800;
    color: #333;
    margin: 8px 0;
}

.ph-items-list {
    list-style: none;
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.ph-items-list li {
    padding: 0;
    color: #333;
    line-height: 1.0;
    border-bottom: none;
    list-style: none;
    list-style-type: none;
}

.ph-items-list li:last-child {
    border-bottom: none;
}

.ph-items-list li::before {
    display: none;
    content: none;
}

/* Bilingual Item Name Display */
.ph-item-name-zh {
    display: inline;
    font-size: 12px;
    color: #333;
    font-weight: 400;
}

.ph-item-name-en {
    display: inline;
    font-size: 9px;
    color: #999999;
    font-weight: 300;
}

/* Category title English text - extra bolder */
.ph-items-group h4 .ph-item-name-en {
    font-weight: 700 !important;
    color: #333 !important;
}

/* Category title Chinese text - ensure consistency */
.ph-items-group h4 .ph-item-name-zh {
    font-weight: 800 !important;
    color: #333 !important;
    font-size: 16px !important;
}

/* Category Group Styling */
.ph-category-group {
    background: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    border-left: 4px solid #CD907E; /* Primary theme color */
}

/* SKU-based border colors - Three-color theme */
.ph-category-group.sku-g {
    border-left-color: #CD907E; /* Primary theme color for G */
}

.ph-category-group.sku-i {
    border-left-color: #DDCBB3; /* Secondary theme color for I */
}

.ph-category-group.sku-other {
    border-left-color: #788760; /* Tertiary theme color for others */
}

/* Gender items keep their special colors */
.ph-female-items {
    border-left-color: #e91e63;
}

.ph-male-items {
    border-left-color: #2196f3;
}

/* Category sections within grouped boxes */
.ph-category-section {
    /* Each category section within the grouped box */
}

.ph-category-separator {
    /* Add spacing between categories in the same box */
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

/* Make category titles bolder and ensure identical styling */
.ph-category-group h4,
.ph-gender-items h4 {
    font-size: 16px !important;      /* Larger for better visibility */
    font-weight: 800 !important;     /* Extra bold */
    color: #333 !important;          /* Dark color for consistency */
    margin: 8px 0 !important;        /* 8px top and bottom */
}

/* Field Error Messages */
.ph-field-error {
    display: none;
    color: #d63638;
    font-size: 13px;
    margin-top: 5px;
}

.ph-field-error.show {
    display: block;
}

.ph-addons-list li {
    color: #9c27b0;
    font-style: italic;
}

.ph-gender-items {
    background: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    border-left: 4px solid #e91e63;
}

.ph-choice-notice {
    background: #fff3cd;
    padding: 4px 8px;
    border-radius: 6px;
    border-left: 4px solid #ff9800;
}

.ph-notice {
    margin: 0;
    color: #856404;
}

/* Form Fields */
.ph-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.ph-form-field {
    margin-bottom: 20px;
}

.ph-form-field label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 15px;
}

.required {
    color: #d63638;
}

.ph-form-field input[type="text"],
.ph-form-field input[type="email"],
.ph-form-field input[type="tel"],
.ph-form-field select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s ease;
}

.ph-form-field input:focus,
.ph-form-field select:focus {
    outline: none;
    border-color: var(--ph-primary);
    box-shadow: 0 0 0 3px var(--ph-primary-light);
}

.ph-field-help {
    font-size: 13px;
    color: #666;
    margin-top: 6px;
}

/* Availability Status */
.ph-availability-status {
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

.ph-available {
    background: rgba(120, 135, 96, 0.1);
    color: #4a5a3c;
    padding: 12px;
    border-radius: 6px;
    border-left: 4px solid var(--ph-primary);
}

.ph-unavailable {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 6px;
    border-left: 4px solid #dc3545;
}

.ph-checking {
    background: var(--ph-secondary-light);
    color: #6b5242;
    padding: 12px;
    border-radius: 6px;
    border-left: 4px solid var(--ph-secondary);
}
}

/* Choice Groups */
.ph-choice-group {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 2px solid #e0e0e0;
}

.ph-choice-group h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--ph-primary);
    margin-bottom: 10px;
}

.ph-choice-instruction {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.ph-choice-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.ph-choice-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ph-choice-option:hover {
    border-color: var(--ph-secondary);
}

.ph-choice-option input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.ph-choice-option input:checked {
    accent-color: var(--ph-primary);
}

.ph-choice-label {
    flex: 1;
    font-size: 15px;
    color: #333;
}

/* Submit Button */
.ph-form-actions {
    text-align: center;
    margin-top: 30px;
}

.ph-submit-button {
    background: var(--ph-primary);
    color: white;
    border: none;
    padding: 16px 48px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ph-submit-button:hover {
    background: var(--ph-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(205, 144, 126, 0.3);
}

.ph-submit-button:disabled {
    background: #999;
    cursor: not-allowed;
    transform: none;
}

/* Messages */
.ph-form-messages {
    margin-top: 30px;
}

.ph-message {
    padding: 16px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
}

.ph-message-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.ph-message-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

/* Loading State */
.ph-loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .ph-booking-form {
        padding: 25px;
    }
    
    .ph-booking-title {
        font-size: 24px;
    }
    
    .ph-package-selection {
        grid-template-columns: 1fr;
    }
    
    .ph-form-row {
        grid-template-columns: 1fr;
    }
    
    .ph-choice-options {
        grid-template-columns: 1fr;
    }
    
    .ph-submit-button {
        width: 100%;
    }
}

/* No Packages Message */
.ph-no-packages {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

/* ========================================
   Smart Calendar - Availability Display
   ======================================== */

/* Loading state */
.ph-loading-calendar {
    opacity: 0.6;
    pointer-events: none;
}

/* Available dates - normal appearance */
.ui-datepicker-calendar td.ph-available a {
    background-color: #ffffff !important;
    color: #2c3e50 !important;
    font-weight: 500;
    cursor: pointer;
}

.ui-datepicker-calendar td.ph-available a:hover {
    background-color: #CD907E !important; /* Your theme color */
    color: #ffffff !important;
}

/* Unavailable dates - very light, unclickable */
.ui-datepicker-calendar td.ph-unavailable,
.ui-datepicker-calendar td.ph-unavailable a {
    background-color: #f5f5f5 !important;
    color: #e0e0e0 !important;
    cursor: not-allowed !important;
    pointer-events: none;
    font-weight: 300;
}

/* Weekend days - very light */
.ui-datepicker-calendar td.ph-weekend,
.ui-datepicker-calendar td.ph-weekend a {
    background-color: #fafafa !important;
    color: #d0d0d0 !important;
    cursor: not-allowed !important;
    pointer-events: none;
    text-decoration: line-through;
}

/* Checking state (temporary while loading) */
.ui-datepicker-calendar td.ph-checking a {
    background-color: #fff8e1 !important;
    color: #999 !important;
    cursor: wait;
}

/* Selected date highlight */
.ui-datepicker-calendar td.ui-datepicker-current-day a,
.ui-datepicker-calendar td.ph-available.ui-datepicker-current-day a {
    background-color: #CD907E !important; /* Your theme color */
    color: #ffffff !important;
    font-weight: 700 !important;
}

/* Today marker */
.ui-datepicker-calendar td.ui-datepicker-today.ph-available a {
    border: 2px solid #CD907E !important;
}

/* Ensure disabled dates don't respond to hover */
.ui-datepicker-calendar td.ph-unavailable:hover a,
.ui-datepicker-calendar td.ph-weekend:hover a {
    background-color: #f5f5f5 !important;
    color: #e0e0e0 !important;
}

/* Calendar loading indicator */
.ph-loading-calendar::after {
    content: "載入中... Loading...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 13px;
    color: #666;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1000;
}
