/**
 * PSU Simple Booking Frontend Styles - Elegant Blue Edition
 * ออกแบบเรียบง่าย หรูหรา โทนสีน้ำเงิน #2B3F6A
 */

/* ตัวแปรสี */
:root {
    --psu-primary: #2B3F6A;
    --psu-primary-light: #3A5080;
    --psu-primary-dark: #1E2B47;
    --psu-primary-gradient: linear-gradient(135deg, #2B3F6A 0%, #3A5080 100%);
    --psu-white: #FFFFFF;
    --psu-off-white: #FAFBFC;
    --psu-light-blue: #F0F4F8;
    --psu-border: #E2E8F0;
    --psu-border-light: #F1F5F9;
    --psu-text: #334155;
    --psu-text-light: #64748B;
    --psu-text-muted: #94A3B8;
    --psu-success: #059669;
    --psu-warning: #D97706;
    --psu-error: #DC2626;
    
    /* Shadows - เรียบง่าย */
    --psu-shadow: 0 1px 3px rgba(43, 63, 106, 0.1);
    --psu-shadow-md: 0 4px 12px rgba(43, 63, 106, 0.15);
    
    /* Border Radius */
    --psu-radius: 8px;
    --psu-radius-lg: 12px;
    
    /* Fonts */
    --psu-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Base Styles */
.psu-booking-container,
.psu-booking-history-container {
    font-family: var(--psu-font);
    line-height: 1.6;
    color: var(--psu-text);
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* Main Form Container */
.psu-booking-form {
    background: var(--psu-white);
    border-radius: var(--psu-radius-lg);
    box-shadow: var(--psu-shadow-md);
    border: 1px solid var(--psu-border-light);
}

/* Steps */
.psu-step {
    padding: 40px;
    min-height: 500px;
}

.psu-step-hidden {
    display: none;
}

.psu-step-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--psu-primary);
    margin: 0 0 30px 0;
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--psu-light-blue);
}

/* Service Cards */
.psu-services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.psu-category-title {
    grid-column: 1 / -1;
    font-size: 18px;
    font-weight: 600;
    color: var(--psu-primary);
    margin: 25px 0 15px 0;
    padding: 12px 0 12px 15px;
    border-left: 3px solid var(--psu-primary);
    background: var(--psu-light-blue);
}

.psu-service-card {
    background: var(--psu-white);
    border: 1px solid var(--psu-border);
    border-radius: var(--psu-radius);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.psu-service-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--psu-shadow-md);
}

.psu-service-image {
    height: 180px;
    overflow: hidden;
    background: var(--psu-light-blue);
}

.psu-service-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.psu-service-content {
    padding: 20px;
}

.psu-service-content h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--psu-primary);
    margin: 0 0 10px 0;
}

.psu-service-content p {
    color: var(--psu-text-light);
    margin: 0 0 15px 0;
    font-size: 14px;
}

.psu-service-details {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 12px;
    background: var(--psu-off-white);
    border-radius: var(--psu-radius);
    font-size: 14px;
}

.psu-price {
    color: var(--psu-primary);
    font-weight: 600;
}

.psu-duration {
    color: var(--psu-text-light);
}

/* Buttons */
.psu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: var(--psu-radius);
    font-family: var(--psu-font);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
    min-height: 44px;
}

.psu-btn-primary {
    background: var(--psu-primary);
    color: var(--psu-white);
}

.psu-btn-primary:hover:not(.psu-btn-disabled) {
    background: var(--psu-primary-dark);
}

.psu-btn-secondary {
    background: var(--psu-white);
    color: var(--psu-primary);
    border: 1px solid var(--psu-border);
}

.psu-btn-secondary:hover {
    background: var(--psu-light-blue);
    color: var(--psu-primary);
}

.psu-btn-disabled {
    background: var(--psu-border-light) !important;
    color: var(--psu-text-muted) !important;
    cursor: not-allowed !important;
}

/* Calendar */
.psu-calendar-container {
    background: var(--psu-white);
    border-radius: var(--psu-radius);
    border: 1px solid var(--psu-border);
    overflow: hidden;
}

.psu-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: var(--psu-primary);
    color: var(--psu-white);
}

.psu-calendar-header h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: var(--psu-white);
}

.psu-calendar-header button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--psu-white);
    width: 32px;
    height: 32px;
    border-radius: var(--psu-radius);
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.psu-calendar-header button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.psu-calendar {
    padding: 20px;
}

.psu-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--psu-border-light);
    border-radius: var(--psu-radius);
    overflow: hidden;
}

.psu-calendar-header-day {
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    color: var(--psu-primary);
    background: var(--psu-light-blue);
    font-size: 13px;
}

.psu-calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--psu-white);
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
    min-height: 44px;
    font-size: 14px;
}

.psu-calendar-day-empty {
    cursor: default;
    background: var(--psu-off-white);
}

.psu-calendar-day-disabled {
    color: var(--psu-text-muted);
    cursor: not-allowed;
    background: var(--psu-border-light);
}

.psu-calendar-day-available {
    color: var(--psu-text);
}

.psu-calendar-day-available:hover {
    background: var(--psu-light-blue);
}

.psu-calendar-day-selected {
    background: var(--psu-primary) !important;
    color: var(--psu-white) !important;
}

/* Calendar booking status indicators */
.psu-calendar-day-partial {
    background: #FEF3C7 !important;
    color: #92400E !important;
}

.psu-calendar-day-partial:hover {
    background: #FDE68A !important;
}

.psu-calendar-day-full {
    background: #FEE2E2 !important;
    color: #991B1B !important;
    cursor: not-allowed;
}

.psu-calendar-day-unavailable {
    background: #F3F4F6 !important;
    color: #9CA3AF !important;
    cursor: not-allowed;
}

.psu-calendar-day-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.psu-calendar-day-indicator.available {
    background: var(--psu-success);
}

.psu-calendar-day-indicator.partial {
    background: var(--psu-warning);
}

.psu-calendar-day-indicator.full {
    background: var(--psu-error);
}

.psu-calendar-day-indicator.unavailable {
    background: #9CA3AF;
}

/* Timeslots */
.psu-timeslot-category {
    margin-bottom: 25px;
}

.psu-timeslot-category h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--psu-primary);
    margin: 0 0 15px 0;
    padding: 12px 15px;
    background: var(--psu-light-blue);
    border-radius: var(--psu-radius);
    border-left: 3px solid var(--psu-primary);
}

.psu-timeslots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.psu-timeslot {
    padding: 15px;
    border-radius: var(--psu-radius);
    border: 1px solid var(--psu-border);
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    background: var(--psu-white);
}

.psu-timeslot-available:hover {
    border-color: var(--psu-primary);
    background: var(--psu-light-blue);
}

.psu-timeslot-booked {
    background: var(--psu-border-light);
    color: var(--psu-text-muted);
    cursor: not-allowed;
    opacity: 0.6;
}

.psu-timeslot-selected {
    background: var(--psu-primary) !important;
    color: var(--psu-white) !important;
    border-color: var(--psu-primary) !important;
}

.psu-timeslot-time {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
}

.psu-timeslot-price {
    font-size: 13px;
    color: var(--psu-primary);
    font-weight: 500;
}

.psu-timeslot-selected .psu-timeslot-price {
    color: var(--psu-white);
}

/* Selected Timeslots Summary */
.psu-selected-timeslots {
    margin-top: 25px;
    padding: 20px;
    background: var(--psu-light-blue);
    border-radius: var(--psu-radius);
    border: 1px solid var(--psu-border);
}

.psu-selected-timeslots h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--psu-primary);
    margin: 0 0 15px 0;
}

.psu-selected-timeslots ul {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
}

.psu-selected-timeslots li {
    padding: 8px 0;
    border-bottom: 1px solid var(--psu-border);
    font-size: 14px;
}

.psu-selected-timeslots li:last-child {
    border-bottom: none;
}

.psu-total-price {
    font-size: 16px;
    font-weight: 600;
    color: var(--psu-primary);
    text-align: center;
    padding: 12px;
    background: var(--psu-white);
    border-radius: var(--psu-radius);
    border: 1px solid var(--psu-border);
}

/* Form Elements */
.psu-form-group {
    margin-bottom: 20px;
}

.psu-form-group label {
    display: block;
    font-weight: 500;
    color: var(--psu-text);
    margin-bottom: 6px;
    font-size: 14px;
}

.psu-form-group input,
.psu-form-group textarea,
.psu-form-group select {
    width: 100%;
    /* padding: 12px 15px; */
    border: 1px solid var(--psu-border);
    border-radius: var(--psu-radius);
    font-family: var(--psu-font);
    font-size: 14px;
    transition: border-color 0.2s ease;
    background: var(--psu-white);
    color: var(--psu-text);
}

.psu-form-group input:focus,
.psu-form-group textarea:focus,
.psu-form-group select:focus {
    outline: none;
    border-color: var(--psu-primary);
}

.psu-form-group input::placeholder,
.psu-form-group textarea::placeholder {
    color: var(--psu-text-muted);
}

/* Field Validation */
.psu-field-error-group input,
.psu-field-error-group textarea,
.psu-field-error-group select {
    border-color: var(--psu-error);
}

.psu-field-error {
    color: var(--psu-error);
    font-size: 13px;
    margin-top: 5px;
    padding: 8px 12px;
    background: rgba(220, 38, 38, 0.1);
    border-radius: var(--psu-radius);
    border-left: 3px solid var(--psu-error);
}

/* Step Actions */
.psu-step-actions {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--psu-border-light);
}

/* Success Message */
.psu-success-message {
    text-align: center;
    padding: 40px;
}

.psu-success-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.psu-success-message h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--psu-success);
    margin: 0 0 10px 0;
}

.psu-success-message p {
    font-size: 14px;
    color: var(--psu-text-light);
    margin: 0 0 8px 0;
}

/* No Services/Content */
.psu-no-services,
.psu-no-bookings {
    text-align: center;
    padding: 40px 20px;
    background: var(--psu-light-blue);
    border: 1px dashed var(--psu-border);
    border-radius: var(--psu-radius);
    color: var(--psu-text-light);
}

.psu-no-services h4,
.psu-no-bookings h3 {
    color: var(--psu-text);
    margin: 10px 0;
    font-weight: 600;
}

.psu-no-bookings-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.6;
}

/* Loading States */
.psu-loading {
    text-align: center;
    padding: 30px;
    color: var(--psu-text-light);
}

/* Booking History Styles */
.psu-booking-history-container h2 {
    font-size: 28px;
    font-weight: 600;
    color: var(--psu-primary);
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--psu-light-blue);
}

.psu-booking-history-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.psu-booking-history-item {
    background: var(--psu-white);
    border: 1px solid var(--psu-border);
    border-radius: var(--psu-radius);
    padding: 25px;
    transition: box-shadow 0.2s ease;
}

.psu-booking-history-item:hover {
    box-shadow: var(--psu-shadow-md);
}

.psu-booking-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--psu-border-light);
}

.psu-booking-info h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--psu-primary);
    margin: 0 0 8px 0;
}

.psu-booking-date {
    color: var(--psu-text-light);
    margin: 0;
    font-size: 14px;
}

.psu-booking-status {
    flex-shrink: 0;
}

.psu-status {
    padding: 6px 12px;
    border-radius: var(--psu-radius);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.psu-status-pending {
    background: #FEF3C7;
    color: #92400E;
}

.psu-status-approved {
    background: #D1FAE5;
    color: #065F46;
}

.psu-status-rejected {
    background: #FEE2E2;
    color: #991B1B;
}

.psu-status-cancelled {
    background: #F3F4F6;
    color: #374151;
}

.psu-booking-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.psu-booking-detail-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.5;
}

.psu-booking-detail-row strong {
    color: var(--psu-text);
    white-space: nowrap;
    min-width: 160px;
    font-weight: 500;
}

.psu-booking-detail-row span {
    color: var(--psu-text-light);
    flex: 1;
}

.psu-rejection-reason {
    background: #FEF2F2;
    padding: 15px;
    border-radius: var(--psu-radius);
    border-left: 3px solid var(--psu-error);
    margin: 10px 0;
}

.psu-rejection-reason strong {
    color: var(--psu-error) !important;
    font-weight: 600;
}

/* Calendar Status Legend */
.psu-calendar-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 15px 0;
    font-size: 13px;
}

.psu-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.psu-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.psu-legend-color.available { background: var(--psu-success); }
.psu-legend-color.partial { background: var(--psu-warning); }
.psu-legend-color.full { background: var(--psu-error); }
.psu-legend-color.unavailable { background: #9CA3AF; }

/* Responsive Design */
@media (max-width: 768px) {
    .psu-booking-container,
    .psu-booking-history-container {
        padding: 20px 15px;
    }
    
    .psu-step {
        padding: 25px 20px;
        min-height: auto;
    }
    
    .psu-step-title {
        font-size: 20px;
    }
    
    .psu-services-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .psu-service-content {
        padding: 15px;
    }
    
    .psu-service-details {
        flex-direction: column;
        gap: 8px;
    }
    
    .psu-calendar {
        padding: 15px;
    }
    
    .psu-calendar-header {
        padding: 12px 15px;
    }
    
    .psu-timeslots-grid {
        grid-template-columns: 1fr;
    }
    
    .psu-step-actions {
        flex-direction: column;
    }
    
    .psu-booking-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .psu-booking-detail-row {
        flex-direction: column;
        gap: 5px;
    }
    
    .psu-booking-detail-row strong {
        min-width: auto;
    }
    
    .psu-calendar-legend {
        flex-wrap: wrap;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .psu-booking-container,
    .psu-booking-history-container {
        padding: 15px 10px;
    }
    
    .psu-step {
        padding: 20px 15px;
    }
    
    .psu-step-title {
        font-size: 18px;
    }
    
    .psu-booking-history-container h2 {
        font-size: 22px;
    }
    
    .psu-booking-history-item {
        padding: 20px;
    }
    
    .psu-service-content h4 {
        font-size: 16px;
    }
    
    .psu-calendar-header button {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .psu-calendar-day {
        min-height: 36px;
        font-size: 13px;
    }
    
    .psu-timeslot {
        padding: 12px;
    }
    
    .psu-form-group input,
    .psu-form-group textarea,
    .psu-form-group select {
        padding: 10px 12px;
        font-size: 14px;
    }
} 

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

/* Custom Form Field Styles */
.psu-radio-group,
.psu-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.psu-radio-label,
.psu-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: normal !important;
    margin-bottom: 0 !important;
    padding: 15px 20px;
    border: 2px solid var(--psu-border-light);
    border-radius: var(--psu-radius);
    transition: all 0.3s ease;
    background: var(--psu-white);
    font-size: 15px;
}

.psu-radio-label:hover,
.psu-checkbox-label:hover {
    background: var(--psu-cream);
    border-color: var(--psu-primary);
    transform: translateY(-1px);
    box-shadow: var(--psu-shadow-soft);
}

.psu-radio-label input,
.psu-checkbox-label input {
    margin: 0 !important;
    width: auto !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
    transform: scale(1.2);
}

.psu-field-description {
    display: block;
    margin-top: 8px;
    color: var(--psu-text-light);
    font-style: italic;
    font-size: 14px;
    line-height: 1.5;
    padding: 8px 12px;
    background: var(--psu-cream);
    border-radius: var(--psu-radius);
    border-left: 3px solid var(--psu-primary);
}

/* File Input Styling */
.psu-form-group input[type="file"] {
    padding: 15px;
    border: 2px dashed var(--psu-border);
    border-radius: var(--psu-radius);
    background: var(--psu-cream);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 15px;
}

.psu-form-group input[type="file"]:hover {
    border-color: var(--psu-primary);
    background: var(--psu-off-white);
}

/* Summary Styles */
.summary-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(43, 63, 106, 0.1);
}

.summary-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    font-weight: 600;
    font-size: 16px;
    color: var(--psu-primary);
}

.summary-item strong {
    margin: 0 8px;
    min-width: 100px;
}

.summary-item span {
    flex: 1;
    text-align: right;
}

/* Enhanced responsive */
@media (max-width: 768px) {
    .psu-radio-label,
    .psu-checkbox-label {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    #service-date-summary {
        flex-direction: column;
        text-align: center;
    }
    
    #service-date-summary > div {
        margin-bottom: 15px;
    }
    
    #service-date-summary > div:last-child {
        margin-bottom: 0;
    }
    
    .summary-item {
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }
    
    .summary-item strong {
        min-width: auto;
    }
    
    .summary-item span {
        text-align: center;
    }
    
    /* Progress Indicator Responsive */
    .progress-indicator {
        flex-direction: column;
        gap: 15px;
    }
    
    .progress-indicator > div:nth-child(2n) {
        width: 2px;
        height: 20px;
        margin: 0 auto;
    }
}