/**
 * W_Booking Module Styles
 * 
 * CSS cho module booking - MVP version
 * Responsive design cho form đặt lịch và danh sách booking
 * 
 * @package W_Booking
 * @version 1.0.0
 */

/* ==========================================================================
   Booking Form Styles
   ========================================================================== */

.w-booking-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.w-booking-form-row {
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.w-booking-form-group {
    flex: 1;
    min-width: 200px;
}

.w-booking-form-half {
    flex: 0 0 calc(50% - 7.5px);
}

.w-booking-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.w-booking-form-group label .required {
    color: #e74c3c;
    margin-left: 3px;
}

.w-booking-form-group input,
.w-booking-form-group select,
.w-booking-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fff;
    box-sizing: border-box;
}

.w-booking-form-group input:focus,
.w-booking-form-group select:focus,
.w-booking-form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.w-booking-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Price Display */
.w-booking-price-display {
    background: linear-gradient(135deg, #ff9eb5 0%, #ff6b9d 100%) !important;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    text-align: center;
    margin: 10px 0;
    font-size: 18px;
}

/* Buttons */
.w-booking-submit-btn,
.w-booking-reset-btn {
    padding: 14px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 10px;
    position: relative;
    overflow: hidden;
}

.w-booking-submit-btn {
    background: linear-gradient(135deg, #ff9eb5 0%, #ff6b9d 100%) !important;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.w-booking-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.w-booking-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.w-booking-reset-btn {
    background: #95a5a6;
    color: white;
}

.w-booking-reset-btn:hover {
    background: #7f8c8d;
    transform: translateY(-1px);
}

/* Messages */
.w-booking-messages {
    margin-top: 20px;
}

.w-booking-success,
.w-booking-error {
    padding: 15px 20px;
    border-radius: 8px;
    font-weight: 500;
    margin-bottom: 15px;
}

.w-booking-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.w-booking-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ==========================================================================
   Booking List/Table Styles
   ========================================================================== */

.w-booking-list {
    margin: 20px 0;
}

.w-booking-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.w-booking-table thead {
    background: linear-gradient(135deg, #ff9eb5 0%, #ff6b9d 100%) !important;
    color: white;
}

.w-booking-table th,
.w-booking-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid #e1e8ed;
}

.w-booking-table th {
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.w-booking-table tbody tr:hover {
    background: #f8f9fa;
}

.w-booking-table tbody tr:last-child td {
    border-bottom: none;
}

/* Booking Status */
.booking-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.booking-status.status-pending {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.booking-status.status-confirmed {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.booking-status.status-completed {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.booking-status.status-cancelled {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.w-booking-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-style: italic;
}

/* ==========================================================================
   Admin Styles
   ========================================================================== */

.wp-admin .w-booking-admin-page {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.wp-admin .booking-status {
    display: inline-block;
}

/* ==========================================================================
   Preselected Services Styles
   ========================================================================== */

/* Preselected Services Styles */
.w-booking-preselected-services {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.w-preselected-service-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
}

.w-preselected-service-item:last-child {
    border-bottom: none;
    margin-bottom: 15px;
}

.w-preselected-service-item .service-info {
    flex: 1;
}

.w-preselected-service-item .service-name {
    font-weight: 600;
    color: #2c3e50;
    display: block;
    margin-bottom: 4px;
}

.w-preselected-service-item .service-details {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
}

.w-preselected-service-item .service-price {
    color: #28a745;
    font-weight: 500;
}

.w-preselected-service-item .service-duration {
    color: #6c757d;
}

.w-preselected-totals {
    background: #e9ecef;
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
}

.w-preselected-totals .total-price,
.w-preselected-totals .total-duration {
    margin-bottom: 8px;
}

.w-preselected-totals .total-price:last-child,
.w-preselected-totals .total-duration:last-child {
    margin-bottom: 0;
}

.w-preselected-totals .total-price {
    color: #28a745;
    font-size: 1.1rem;
}

.w-preselected-totals .total-duration {
    color: #495057;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .w-booking-form {
        padding: 20px;
        margin: 10px;
    }
    
    .w-booking-form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .w-booking-form-half {
        flex: 1;
        margin-bottom: 15px;
    }
    
    .w-booking-submit-btn,
    .w-booking-reset-btn {
        width: 100%;
        margin-bottom: 10px;
        margin-right: 0;
    }
    
    .w-booking-table {
        font-size: 14px;
    }
    
    .w-booking-table th,
    .w-booking-table td {
        padding: 10px 8px;
    }
    
    /* Stack table on mobile */
    .w-booking-table,
    .w-booking-table thead,
    .w-booking-table tbody,
    .w-booking-table th,
    .w-booking-table td,
    .w-booking-table tr {
        display: block;
    }
    
    .w-booking-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .w-booking-table tr {
        border: 1px solid #e1e8ed;
        margin-bottom: 10px;
        padding: 10px;
        border-radius: 8px;
        background: #fff;
    }
    
    .w-booking-table td {
        border: none;
        position: relative;
        padding-left: 50% !important;
        padding-top: 10px;
        padding-bottom: 10px;
    }
    
    .w-booking-table td:before {
        content: attr(data-label) ": ";
        position: absolute;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: 600;
        color: #333;
    }
}

@media (max-width: 480px) {
    .w-booking-form {
        padding: 15px;
    }
    
    .w-booking-form-group input,
    .w-booking-form-group select,
    .w-booking-form-group textarea {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.w-booking-loading {
    position: relative;
    overflow: hidden;
}

.w-booking-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.w-booking-form input:focus,
.w-booking-form select:focus,
.w-booking-form textarea:focus,
.w-booking-submit-btn:focus,
.w-booking-reset-btn:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.w-booking-form .required {
    speak: literal;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .w-booking-form {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .w-booking-submit-btn,
    .w-booking-reset-btn {
        display: none;
    }
    
    .w-booking-table {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}