/* =========================================
   Modern Booking Experience Styles (With Sidebar)
   ========================================= */

:root {
    --crm-primary: #2563eb;
    --crm-primary-hover: #1d4ed8;
    --crm-bg: #f8fafc;
    --crm-surface: #ffffff;
    --crm-border: #e2e8f0;
    --crm-text-main: #1e293b;
    --crm-text-muted: #64748b;
    --crm-success: #10b981;
    --crm-radius: 16px;
    --crm-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.crm-booking-page {
    max-width: 1100px; /* زيادة العرض لاستيعاب السايد بار */
    margin: 40px auto;
    font-family: system-ui, -apple-system, sans-serif;
    color: var(--crm-text-main);
    line-height: 1.5;
    padding: 0 20px;
}

.crm-booking-header-wrapper {
    text-align: center;
    margin-bottom: 40px;
}

.crm-booking-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--crm-text-main);
}

.crm-booking-subtitle {
    color: var(--crm-text-muted);
    font-size: 1.1rem;
}

/* --- Layout Grid --- */
.crm-booking-container-grid {
    display: grid;
    grid-template-columns: 2fr 1fr; /* عمودين: المحتوى (2) والسايد بار (1) */
    gap: 30px;
    align-items: start;
}

/* Mobile Responsive */
@media (max-width: 900px) {
    .crm-booking-container-grid {
        grid-template-columns: 1fr; /* عمود واحد في الموبايل */
    }
    .crm-booking-sidebar-col {
        order: -1; /* رفع السايد بار للأعلى اختيارياً، أو حذفه ليبقى في الأسفل */
        margin-bottom: 30px;
    }
}

/* --- Main Content Styles --- */
.crm-booking-section {
    background: var(--crm-surface);
    border-radius: var(--crm-radius);
    padding: 30px;
    box-shadow: var(--crm-shadow);
    border: 1px solid var(--crm-border);
    margin-bottom: 30px;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.crm-booking-section h2 {
    font-size: 1.25rem;
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--crm-bg);
    display: flex;
    align-items: center;
    gap: 10px;
}

.crm-step-number {
    background: var(--crm-primary);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: bold;
}

.crm-booking-section--step2 {
    display: none;
    opacity: 0;
    transform: translateY(20px);
}

.crm-booking-section--step2.is-visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* --- Sidebar Styles --- */
.crm-sidebar-card {
    background: var(--crm-surface);
    border-radius: var(--crm-radius);
    padding: 25px;
    box-shadow: var(--crm-shadow);
    border: 1px solid var(--crm-border);
    margin-bottom: 20px;
}

.crm-sidebar-card h3 {
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--crm-text-main);
    border-bottom: 1px solid var(--crm-border);
    padding-bottom: 10px;
}

.crm-sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.crm-sidebar-list li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: var(--crm-text-muted);
}

.crm-sidebar-list li .dashicons {
    color: var(--crm-success);
}

.crm-sidebar-contact p {
    font-size: 0.9rem;
    color: var(--crm-text-muted);
    margin-bottom: 15px;
}

.crm-sidebar-link {
    display: block;
    text-align: center;
    padding: 10px;
    background: #eff6ff;
    color: var(--crm-primary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: 0.2s;
}

.crm-sidebar-link:hover {
    background: var(--crm-primary);
    color: #fff;
}

/* --- Form Fields --- */
.crm-booking-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--crm-text-main);
}

.crm-booking-select, .crm-booking-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--crm-border);
    border-radius: 12px;
    font-size: 1rem;
    transition: border-color 0.2s;
    background: var(--crm-bg);
    box-sizing: border-box;
}

.crm-booking-select:focus, .crm-booking-input:focus {
    border-color: var(--crm-primary);
    outline: none;
    background: #fff;
}

/* --- Booking Grid --- */
.crm-booking-week-grid {
    border: 1px solid var(--crm-border);
    border-radius: 12px;
    overflow-x: auto;
    margin-top: 20px;
}

.crm-booking-week-grid-inner {
    display: grid;
    grid-template-columns: repeat(7, minmax(100px, 1fr));
    background: #fff;
}

.crm-booking-weekday {
    border-right: 1px solid var(--crm-border);
    min-height: 200px;
}

.crm-booking-weekday:last-child { border-right: none; }

.crm-booking-weekday-header {
    background: var(--crm-bg);
    padding: 10px;
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--crm-border);
    color: var(--crm-text-muted);
}

.crm-booking-weekday-body {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.crm-booking-slot-cell {
    display: block;
    width: 100%;
    padding: 8px 4px;
    text-align: center;
    background: #fff;
    border: 1px solid var(--crm-primary);
    color: var(--crm-primary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}

.crm-booking-slot-cell:hover {
    background: #eff6ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.1);
}

.crm-booking-slot-cell.is-selected {
    background: var(--crm-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transform: scale(1.05);
}

.crm-booking-slot-cell.is-booked {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
    text-decoration: line-through;
    opacity: 0.6;
    pointer-events: none;
}

.crm-week-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    background: var(--crm-bg);
    padding: 10px;
    border-radius: 12px;
}

.crm-week-nav button {
    background: #fff;
    border: 1px solid var(--crm-border);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: var(--crm-text-main);
    transition: 0.2s;
}

.crm-week-nav button:hover {
    border-color: var(--crm-primary);
    color: var(--crm-primary);
}

.crm-week-label {
    font-weight: 700;
    font-size: 1rem;
}

/* --- Messages --- */
.crm-booking-slots-empty,
.crm-booking-slots-loading {
    text-align: center;
    padding: 40px;
    color: var(--crm-text-muted);
    font-style: italic;
}

.crm-booking-submit-button {
    width: 100%;
    padding: 16px;
    background: var(--crm-success);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    transition: background 0.2s;
}

.crm-booking-submit-button:hover { background: #059669; }
.crm-booking-submit-button:disabled { background: #cbd5e1; cursor: not-allowed; }

.crm-booking-message {
    padding: 20px;
    border-radius: 12px;
    margin-top: 15px;
    text-align: center;
    font-weight: 500;
}
.crm-booking-message--success {
    background: #dcfce7;
    color: #14532d;
    border: 1px solid #86efac;
}
.crm-booking-message--error {
    background: #fee2e2;
    color: #7f1d1d;
    border: 1px solid #fca5a5;
}

/* Success message bilingual styles */
.crm-success-dual h3 { margin: 0 0 5px; font-size: 1.1rem; }
.crm-success-dual p { margin: 0; font-size: 0.95rem; }
.crm-success-en { margin-bottom: 15px; }
.crm-success-fr { margin-top: 15px; }