/* Clean mobile styles for upcoming pages */

@media (max-width: 768px) {
    /* Page shell */
    body {
        padding: 0;
        margin: 0;
        overflow-x: hidden;
    }

    /* Shared containers */
    .container {
        width: 100%;
        max-width: 100%;
        padding: 0 12px;
    }

    /* Section titles */
    .section-title,
    .section-header h2 {
        font-size: 1.6rem;
        margin-bottom: 0.75rem;
    }

    /* Consultants page */
    .consultants-section {
        padding-top: 55px;
        padding-bottom: 24px;
    }

    .consultants-section .container {
        padding: 0 12px;
    }

    .page-title-section {
        margin-bottom: 1rem;
        padding: 0;
    }

    .page-title {
        font-size: 1.8rem;
        margin-bottom: 0.35rem;
    }

    .page-subtitle {
        font-size: 0.95rem;
    }

    /* الهيدر - نفس تنسيق الصفحة الرئيسية */
    html body {
        padding-top: 0;
    }
    
    main,
    #main-content {
        padding-top: 0;
    }
    
    .main-nav {
        display: block;
        padding: 6px 0;
        min-height: 45px;
    }
    
    .main-nav .container {
        min-height: 45px;
        position: relative;
        padding: 0 15px;
        display: flex;
        align-items: center;
    }
    
    .main-nav .nav-list,
    .main-nav .nav-actions {
        display: none;
    }
    
    .main-nav .nav-logo {
        display: block;
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1050;
        height: auto;
        padding-left: 5px;
    }
    
    .main-nav .nav-logo img {
        height: 38px;
        width: auto;
        max-width: 120px;
    }
    
    .toggle-sidebar {
        display: flex;
        position: fixed;
        top: calc(6px + 22.5px);
        right: 5px;
        z-index: 1100;
        transform: translateY(-50%);
    }

    /* شريط البحث في سطر منفصل */
    .search-bar-wrapper {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    .search-bar {
        width: 100%;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        margin-bottom: 12px;
    }

    .categories-dropdown {
        flex: 0 0 auto;
        min-width: 120px;
    }

    .search-input {
        flex: 1;
    }

    .categories-button {
        width: auto;
        min-width: 120px;
        justify-content: center;
    }

    .categories-menu {
        width: auto;
        min-width: 200px;
    }

    .search-input input {
        font-size: 0.95rem;
        padding: 0.75rem 2.75rem 0.75rem 1rem;
    }

    /* الفلاتر في سطر واحد */
    .filter-buttons {
        width: 100%;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        margin-bottom: 1.25rem;
    }

    .consultants-section .filter-button,
    .consultants-section .filter-button.available {
        flex: 1;
        min-width: 0;
        justify-content: center;
    }

    .consultants-section .filter-button.available {
        max-width: none;
    }

    .search-bar {
        position: relative;
        z-index: 100;
    }

    .categories-dropdown {
        position: relative;
        z-index: 100;
    }

    .categories-menu {
        left: 0;
        right: 0;
        z-index: 101;
    }

    .filter-buttons {
        position: relative;
        z-index: 100;
    }

    .consultants-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .consultant-card {
        max-width: none;
        min-height: 240px;
        padding: 0.9rem;
    }

    .consultant-image {
        width: 72px;
        height: 72px;
    }

    .pagination-container {
        padding: 0 10px;
    }

    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }

    /* حاويات المواقيت بعرض الشاشة بالكامل */
    .time-slots {
        margin-top: 1.5rem;
        gap: 1.25rem;
        width: 100vw;
        margin-left: calc(-50vw + 50%);
        margin-right: calc(-50vw + 50%);
        padding: 0;
    }

    .time-slot {
        padding: 1rem 12px;
        width: 100%;
        margin: 0;
    }

    .time-slot h3 {
        padding: 0 12px;
        margin-bottom: 1rem;
    }

    /* عند تفعيل "أقرب مستشار متاح" - 2 أعمدة في السلايدر (عرض أكبر) */
    .time-slots.active .time-swiper {
        width: 100%;
        padding: 0 12px;
    }

    .time-slots.active .time-swiper .swiper-wrapper {
        padding: 0;
    }

    .time-slots.active .time-swiper .swiper-slide {
        width: auto;
        flex-shrink: 0;
        min-width: calc(50% - 4px);
    }

    .time-slots.active .time-swiper .consultant-card {
        width: 100%;
        max-width: none;
        min-height: 260px;
        padding: 1.1rem;
    }

    .time-slots.active .time-swiper .consultant-image {
        width: 85px;
        height: 85px;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 10px;
    }

    .section-title,
    .section-header h2 {
        font-size: 1.5rem;
    }

    /* البطاقات تبقى في عمودين حتى في الشاشات الصغيرة */
    .consultants-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .consultant-card {
        min-height: 220px;
        padding: 0.75rem;
    }

    .consultant-image {
        width: 65px;
        height: 65px;
    }
}

/* صفحة الحجز الفوري (booking.html) */
@media (max-width: 768px) {
    /* الهيدر - نفس تنسيق الصفحات الأخرى */
    html body {
        padding-top: 0;
    }
    
    main,
    #main-content {
        padding-top: 0;
    }
    
    .main-nav {
        display: block;
        padding: 6px 0;
        min-height: 45px;
    }
    
    .main-nav .container {
        min-height: 45px;
        position: relative;
        padding: 0 15px;
        display: flex;
        align-items: center;
    }
    
    .main-nav .nav-list,
    .main-nav .nav-actions {
        display: none;
    }
    
    .main-nav .nav-logo {
        display: block;
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1050;
        height: auto;
        padding-left: 5px;
    }
    
    .main-nav .nav-logo img {
        height: 38px;
        width: auto;
        max-width: 120px;
    }
    
    .toggle-sidebar {
        display: flex;
        position: fixed;
        top: calc(6px + 22.5px);
        right: 5px;
        z-index: 1100;
        transform: translateY(-50%);
    }

    /* صفحة الحجز */
    section.booking-section {
        padding-top: 75px;
        padding-bottom: 24px;
    }

    section.booking-section .container {
        padding: 0 12px;
    }

    .booking-section .page-title-section {
        margin-bottom: 1.5rem;
        padding: 0;
        margin-top: 1rem;
    }

    .page-title {
        font-size: 1.8rem;
        margin-bottom: 0.35rem;
    }

    .page-subtitle {
        font-size: 0.95rem;
    }

    /* النموذج */
    .booking-form {
        padding: 1.5rem 1rem;
        border-radius: 16px;
        margin-bottom: 1.5rem;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    .booking-form h2 {
        font-size: 1.25rem;
        margin-bottom: 1.5rem;
        text-align: center;
    }

    /* حقول الإدخال */
    .form-group,
    .mb-3 {
        margin-bottom: 1.25rem;
    }

    .form-label {
        font-size: 0.95rem;
        font-weight: 600;
        margin-bottom: 0.5rem;
        display: block;
        color: var(--text-color);
    }

    .form-control {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
        border-radius: 10px;
        border: 2px solid #e9ecef;
        width: 100%;
        transition: all 0.3s ease;
    }

    .form-control:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 0.2rem rgba(39, 179, 246, 0.15);
        outline: none;
    }

    textarea.form-control {
        min-height: 80px;
        resize: vertical;
    }

    /* مجموعة رقم الجوال */
    .phone-input-group {
        display: flex;
        gap: 0.75rem;
        align-items: stretch;
        width: 100%;
        border: 2px solid #e9ecef;
        border-radius: 10px;
        padding: 0;
        overflow: hidden;
        transition: all 0.3s ease;
    }

    .phone-input-group:focus-within {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 0.2rem rgba(39, 179, 246, 0.15);
    }

    .phone-input-group .select-wrapper {
        flex: 0 0 100px;
        min-width: 100px;
        max-width: 100px;
        width: 100px;
        position: relative;
        border-right: 2px solid #e9ecef;
        padding-right: 8px;
        padding-left: 8px;
        overflow: visible;
    }

    .phone-input-group .select-wrapper select {
        width: 100%;
        padding: 0.75rem 0;
        padding-right: 1.5rem;
        font-size: 0.85rem;
        border: none;
        background: #f8f9fa;
        appearance: none;
        cursor: pointer;
        white-space: nowrap;
        overflow: visible;
        text-overflow: clip;
    }

    .phone-input-group .select-wrapper i {
        position: absolute;
        right: 0.5rem;
        top: 50%;
        transform: translateY(-50%);
        pointer-events: none;
        color: #666;
        font-size: 0.75rem;
    }

    .phone-input-group input[type="tel"] {
        flex: 1;
        min-width: 0;
        flex-grow: 1;
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
        border: none;
        outline: none;
        background: white;
    }

    .whatsapp-badge {
        font-size: 0.85rem;
        margin-top: 0.75rem;
        padding: 0.6rem 0.9rem;
        background: #e8f5e9;
        border-radius: 8px;
        color: #2e7d32;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .whatsapp-badge i {
        color: #25D366;
        font-size: 1rem;
    }

    /* خيارات مدة الاستشارة */
    .booking-form .consultation-duration-options {
        display: flex;
        flex-direction: row;
        gap: 0.75rem;
        margin-top: 0.5rem;
        flex-wrap: nowrap;
        width: 100%;
    }

    .booking-form .consultation-duration-options .form-check {
        flex: 1;
        min-width: 0;
        padding: 1rem 0.5rem;
        border-radius: 10px;
        border: 2px solid #e9ecef;
        background: white;
        text-align: center;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .consultation-duration-options .form-check:hover {
        border-color: var(--primary-color);
        background: #f8f9fa;
    }

    .consultation-duration-options .form-check.selected {
        border-color: var(--primary-color);
        background: rgba(39, 179, 246, 0.05);
        box-shadow: 0 2px 8px rgba(39, 179, 246, 0.15);
    }

    .consultation-duration-options .form-check-label {
        font-size: 0.9rem;
        font-weight: 500;
        cursor: pointer;
        margin: 0;
        display: block;
    }

    .consultation-duration-options .form-check.selected .form-check-label {
        color: var(--primary-color);
        font-weight: 600;
    }

    /* زر البحث */
    .btn-primary {
        width: 100%;
        padding: 0.85rem 1.5rem;
        font-size: 1rem;
        border-radius: 10px;
    }

    /* بطاقات المستشارين */
    #consultantsGrid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        margin-top: 1.5rem;
        width: 100%;
    }

    .consultant-card {
        max-width: none;
        min-height: 240px;
        padding: 0.9rem;
        border-radius: 12px;
        width: 100%;
    }

    .consultant-image {
        width: 72px;
        height: 72px;
    }

    .consultant-name {
        font-size: 0.95rem;
        margin-bottom: 0.4rem;
    }

    .consultant-specialization,
    .consultant-specialty {
        font-size: 0.8rem;
    }

    .consultant-rating {
        font-size: 0.85rem;
    }

    .consultant-price {
        font-size: 0.9rem;
        margin: 0.5rem 0;
    }

    .book-button {
        width: 100%;
        padding: 0.65rem 1rem;
        font-size: 0.9rem;
        border-radius: 8px;
    }

    /* رسالة عدم وجود مستشارين */
    #noConsultantsMessage {
        padding: 2rem 1rem;
        text-align: center;
    }

    #noConsultantsMessage i {
        font-size: 3rem;
    }

    #noConsultantsMessage h3 {
        font-size: 1.3rem;
        margin-bottom: 0.75rem;
    }

    #noConsultantsMessage p {
        font-size: 0.9rem;
        margin-bottom: 1.25rem;
    }

    /* Loader */
    #searchLoader {
        text-align: center;
        padding: 2rem 1rem;
    }

    #searchLoader p {
        margin-top: 1rem;
        font-size: 0.95rem;
    }

    /* نتائج البحث */
    #searchResults h2 {
        font-size: 1.5rem;
        margin-bottom: 1.25rem;
    }

    /* التأكد من أن البطاقات في عمودين */
    #consultantsGrid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        width: 100%;
    }
}

@media (max-width: 576px) {
    .booking-section .container {
        padding: 0 10px;
    }

    .page-title {
        font-size: 1.6rem;
    }

    .page-subtitle {
        font-size: 0.9rem;
    }

    .booking-form {
        padding: 1rem;
    }

    .booking-form h2 {
        font-size: 1.2rem;
    }

    #consultantsGrid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .consultant-card {
        min-height: 220px;
        padding: 0.75rem;
    }

    .consultant-image {
        width: 65px;
        height: 65px;
    }
}

/* التأكد من أن قواعد سطح المكتب تطبق بشكل صحيح */
@media (min-width: 769px) {
    .consultants-section .filter-button.available {
        flex: none !important;
        min-width: auto !important;
        width: 220px !important;
        max-width: 220px !important;
    }
    
    .consultants-section .filter-buttons {
        justify-content: center;
    }
}


@media (max-width: 768px) {
    /* Page shell */
    body {
        padding: 0;
        margin: 0;
        overflow-x: hidden;
    }

    /* Shared containers */
    .container {
        width: 100%;
        max-width: 100%;
        padding: 0 12px;
    }

    /* Section titles */
    .section-title,
    .section-header h2 {
        font-size: 1.6rem;
        margin-bottom: 0.75rem;
    }

    /* Consultants page */
    .consultants-section {
        padding-top: 55px;
        padding-bottom: 24px;
    }

    .consultants-section .container {
        padding: 0 12px;
    }

    .page-title-section {
        margin-bottom: 1rem;
        padding: 0;
    }

    .page-title {
        font-size: 1.8rem;
        margin-bottom: 0.35rem;
    }

    .page-subtitle {
        font-size: 0.95rem;
    }

    /* الهيدر - نفس تنسيق الصفحة الرئيسية */
    html body {
        padding-top: 0;
    }
    
    main,
    #main-content {
        padding-top: 0;
    }
    
    .main-nav {
        display: block;
        padding: 6px 0;
        min-height: 45px;
    }
    
    .main-nav .container {
        min-height: 45px;
        position: relative;
        padding: 0 15px;
        display: flex;
        align-items: center;
    }
    
    .main-nav .nav-list,
    .main-nav .nav-actions {
        display: none;
    }
    
    .main-nav .nav-logo {
        display: block;
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1050;
        height: auto;
        padding-left: 5px;
    }
    
    .main-nav .nav-logo img {
        height: 38px;
        width: auto;
        max-width: 120px;
    }
    
    .toggle-sidebar {
        display: flex;
        position: fixed;
        top: calc(6px + 22.5px);
        right: 5px;
        z-index: 1100;
        transform: translateY(-50%);
    }

    /* شريط البحث في سطر منفصل */
    .search-bar-wrapper {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    .search-bar {
        width: 100%;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        margin-bottom: 12px;
    }

    .categories-dropdown {
        flex: 0 0 auto;
        min-width: 120px;
    }

    .search-input {
        flex: 1;
    }

    .categories-button {
        width: auto;
        min-width: 120px;
        justify-content: center;
    }

    .categories-menu {
        width: auto;
        min-width: 200px;
    }

    .search-input input {
        font-size: 0.95rem;
        padding: 0.75rem 2.75rem 0.75rem 1rem;
    }

    /* الفلاتر في سطر واحد */
    .filter-buttons {
        width: 100%;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        margin-bottom: 1.25rem;
    }

    .consultants-section .filter-button,
    .consultants-section .filter-button.available {
        flex: 1;
        min-width: 0;
        justify-content: center;
    }

    .consultants-section .filter-button.available {
        max-width: none;
    }

    .search-bar {
        position: relative;
        z-index: 100;
    }

    .categories-dropdown {
        position: relative;
        z-index: 100;
    }

    .categories-menu {
        left: 0;
        right: 0;
        z-index: 101;
    }

    .filter-buttons {
        position: relative;
        z-index: 100;
    }

    .consultants-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .consultant-card {
        max-width: none;
        min-height: 240px;
        padding: 0.9rem;
    }

    .consultant-image {
        width: 72px;
        height: 72px;
    }

    .pagination-container {
        padding: 0 10px;
    }

    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }

    .time-slots {
        margin-top: 1.5rem;
        gap: 1.25rem;
    }

    .time-slot {
        padding: 1rem;
    }

    /* عند تفعيل "أقرب مستشار متاح" - 3 أعمدة */
    .time-slots.active .time-swiper {
        width: 100%;
    }

    .time-slots.active .time-swiper .swiper-slide {
        width: auto;
        min-width: calc(33.333% - 8px);
    }

    .time-slots.active .time-swiper .consultant-card {
        width: 100%;
        max-width: none;
        min-height: 240px;
        padding: 1rem;
    }

    .time-slots.active .time-swiper .consultant-image {
        width: 80px;
        height: 80px;
    }

    .time-slots.active .time-swiper .swiper-pagination {
        display: block;
        margin-top: 10px;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 10px;
    }

    .section-title,
    .section-header h2 {
        font-size: 1.5rem;
    }

    /* البطاقات تبقى في عمودين حتى في الشاشات الصغيرة */
    .consultants-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .consultant-card {
        min-height: 220px;
        padding: 0.75rem;
    }

    .consultant-image {
        width: 65px;
        height: 65px;
    }
}
