/* SwitchQ Appointments Scheduling - Enhanced RTL (Hebrew) Styles */

/* ===== RTL BASE OVERRIDES ===== */
body.rtl {
    direction: rtl;
    text-align: right;
    font-family: var(--font-family-hebrew);
}

/* ===== LAYOUT ADJUSTMENTS ===== */
.rtl .step-number {
    margin-right: 0;
    margin-left: var(--spacing-sm);
}

.rtl .navigation-buttons {
    flex-direction: row-reverse;
}

.rtl .loading {
    margin-right: 0;
    margin-left: var(--spacing-sm);
}

/* ===== FORM ELEMENTS RTL ===== */
.rtl .form-control {
    text-align: right;
    padding-right: var(--spacing-lg);
    padding-left: var(--spacing);
}

.rtl .date-input {
    text-align: center;
    /* Keep date input centered for better UX */
}

.rtl .form-label {
    text-align: right;
}

/* ===== BOOKING SUMMARY RTL ===== */
.rtl .summary-item {
    flex-direction: row-reverse;
    text-align: right;
}

.rtl .summary-label {
    text-align: right;
}

.rtl .summary-value {
    text-align: left;
    /* Keep values left-aligned for numbers/dates */
}

/* ===== BUTTON ADJUSTMENTS ===== */
.rtl .btn {
    text-align: center;
    /* Keep buttons centered */
}

.rtl .btn::before {
    /* Reverse the shimmer animation direction */
    background: linear-gradient(270deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

/* ===== TIME SLOTS RTL ===== */
.rtl .time-slot {
    text-align: center;
    /* Keep time slots centered */
}

.rtl .time-slot::before {
    /* Reverse the hover animation direction */
    left: 100%;
    background: linear-gradient(270deg, transparent, rgba(79, 70, 229, 0.1), transparent);
}

.rtl .time-slot:hover::before {
    left: -100%;
}

/* ===== ALERTS RTL ===== */
.rtl .alert {
    text-align: right;
}

/* ===== BOOKING STEPS RTL ===== */
.rtl .booking-steps {
    direction: rtl;
    /* Remove flex-direction: row-reverse to maintain proper step order */
}

/* ===== CARD HEADER RTL ===== */
.rtl .card-header {
    text-align: center;
    /* Keep header centered */
}

.rtl .app-title {
    font-weight: 700;
    /* Hebrew fonts often look better with slightly adjusted weight */
    letter-spacing: 0;
    /* Remove letter spacing for Hebrew */
}

.rtl .app-subtitle {
    font-weight: 400;
}

/* ===== SECTION TITLES RTL ===== */
.rtl .section-title {
    text-align: center;
    font-weight: 700;
    letter-spacing: 0;
    /* Remove letter spacing for Hebrew */
}

/* ===== RESPONSIVE RTL ADJUSTMENTS ===== */
@media (max-width: 768px) {
    .rtl .card-header {
        padding: var(--spacing-lg) var(--spacing);
        text-align: center;
    }

    .rtl .card-body {
        padding: var(--spacing-lg) var(--spacing);
    }

    .rtl .app-title {
        font-size: 1.75rem;
        text-align: center;
        line-height: 1.2;
    }

    .rtl .app-subtitle {
        font-size: 1rem;
        text-align: center;
    }

    .rtl .booking-steps {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-xs);
        direction: rtl;
        padding: 0;
    }

    .rtl .step {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-xs);
        direction: rtl;
    }

    .rtl .step-number {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.7rem;
        margin-left: 0;
        margin-right: 0;
        margin-bottom: var(--spacing-xs);
    }

    .rtl .step-text {
        font-size: 0.7rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-align: center;
    }

    .rtl .section-title {
        font-size: 1.25rem;
        text-align: center;
        margin-bottom: var(--spacing);
    }

    .rtl .business-hours-info {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .rtl .info-card {
        flex-direction: row;
        text-align: right;
        justify-content: flex-start;
        gap: var(--spacing-sm);
        padding: var(--spacing-sm) var(--spacing);
    }

    .rtl .info-content {
        text-align: right;
    }

    .rtl .info-title {
        font-size: 0.75rem;
        text-align: right;
    }

    .rtl .info-text {
        font-size: 0.75rem;
        text-align: right;
    }

    .rtl .time-slots-header {
        display: flex;
        justify-content: space-around;
        direction: rtl;
        text-align: center;
    }

    .rtl .time-slots-grid {
        direction: rtl;
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-xs);
        width: 100%;
        padding: 0;
        margin-left: 0;
        margin-right: 0;
    }

    .rtl .time-slot {
        direction: ltr;
        text-align: center;
        padding: var(--spacing-xs);
        font-size: 0.75rem;
        min-height: 36px;
        white-space: nowrap;
        border-width: 1px;
    }

    .rtl .form-group {
        margin-bottom: var(--spacing);
    }

    .rtl .form-label {
        text-align: right;
        font-size: 0.875rem;
    }

    .rtl .form-control {
        text-align: right;
        padding: var(--spacing-sm) var(--spacing);
        font-size: 1rem;
    }

    .rtl .navigation-buttons {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .rtl .navigation-buttons .btn {
        width: 100%;
    }

    .rtl .summary-header {
        flex-direction: row;
        text-align: right;
        gap: var(--spacing-sm);
        padding: var(--spacing) var(--spacing);
    }

    .rtl .summary-content {
        padding: var(--spacing);
    }

    .rtl .summary-item {
        flex-direction: column;
        align-items: flex-start;
        text-align: right;
        gap: var(--spacing-xs);
    }

    .rtl .summary-label {
        font-size: 0.75rem;
        text-align: right;
    }

    .rtl .summary-value {
        font-size: 0.875rem;
        text-align: right;
    }

    .rtl .alert {
        text-align: right;
        padding: var(--spacing);
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {


    .rtl .app-title {
        font-size: 1.5rem;
        text-align: center;
    }

    .rtl .time-slots-container {
        margin: 0;
        padding: 0;
        width: 100%;
    }

    .rtl .time-slots-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-xs);
        padding: 0;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
        direction: rtl;
    }

    .rtl .time-slot {
        padding: var(--spacing-xs);
        font-size: 0.7rem;
        min-height: 32px;
        border-width: 1px;
        box-sizing: border-box;
    }

    .rtl .booking-steps {
        gap: var(--spacing-xs);
        margin: 0 0 var(--spacing-sm) 0;
        padding: 0;
        justify-content: space-between;
    }

    .rtl .step {
        font-size: 0.65rem;
        direction: rtl;
    }

    .rtl .step-number {
        width: 1.5rem;
        height: 1.5rem;
        font-size: 0.65rem;
    }

    .rtl .step-text {
        font-size: 0.65rem;
    }

    .rtl .section-title {
        font-size: 1.125rem;
        margin-bottom: var(--spacing-xs);
        text-align: center;
    }
}

/* ===== HEBREW TYPOGRAPHY ENHANCEMENTS ===== */
.rtl {
    font-family: "Segoe UI", Tahoma, Arial, "Noto Sans Hebrew", "David", sans-serif;
    font-feature-settings: "kern" 1, "liga" 1;
    /* Enable kerning and ligatures for better Hebrew rendering */
}

.rtl .app-title {
    font-family: "Segoe UI", Tahoma, "Arial Hebrew", "Noto Sans Hebrew", sans-serif;
    font-weight: 700;
    text-rendering: optimizeLegibility;
}

.rtl .section-title {
    font-family: "Segoe UI", Tahoma, "Arial Hebrew", "Noto Sans Hebrew", sans-serif;
    font-weight: 700;
    text-rendering: optimizeLegibility;
}

.rtl .form-label {
    font-family: "Segoe UI", Tahoma, "Arial Hebrew", "Noto Sans Hebrew", sans-serif;
    font-weight: 600;
    letter-spacing: 0;
}

/* ===== ACCESSIBILITY RTL ===== */
.rtl .sr-only {
    direction: rtl;
    text-align: right;
}

/* ===== FOCUS STYLES RTL ===== */
.rtl .btn:focus,
.rtl .form-control:focus,
.rtl .time-slot:focus,
.rtl .language-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===== CUSTOM RTL ANIMATIONS ===== */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.rtl .booking-section {
    animation: slideInRight 0.4s ease-out;
}

/* ===== RTL GRID ADJUSTMENTS ===== */
.rtl .time-slots-grid {
    direction: rtl;
    /* Set grid direction to RTL so time slots flow from right to left */
}

.rtl .time-slots-grid .time-slot {
    direction: ltr;
    /* Individual time slot text should remain LTR for readability */
    text-align: center;
}

/* ===== RTL FORM LAYOUT ===== */
.rtl .row {
    direction: rtl;
}

.rtl .col-md-6 {
    direction: rtl;
}

/* ===== RTL SPECIFIC HOVER EFFECTS ===== */
.rtl .language-btn:hover {
    transform: translateY(-1px);
    /* Keep consistent hover effects */
}

.rtl .btn-primary:hover {
    transform: translateY(-2px);
    /* Keep consistent hover effects */
}

.rtl .btn-secondary:hover {
    transform: translateY(-2px);
    /* Keep consistent hover effects */
}

.rtl .time-slot:hover {
    transform: translateY(-2px);
    /* Keep consistent hover effects */
}

.rtl .form-control:focus {
    transform: translateY(-1px);
    /* Keep consistent focus effects */
}

.rtl .date-input:focus {
    transform: translateY(-1px);
    /* Keep consistent focus effects */
}

/* ===== RTL STEP INDICATORS ===== */
.rtl .step.active .step-number {
    transform: scale(1.05);
    /* Keep consistent active state */
}

/* ===== RTL SHADOW ADJUSTMENTS ===== */
.rtl .booking-card {
    /* Shadows work the same in RTL */
    box-shadow: var(--shadow-xl);
}

.rtl .btn {
    /* Shadows work the same in RTL */
    box-shadow: var(--shadow-sm);
}

.rtl .form-control {
    /* Shadows work the same in RTL */
    box-shadow: var(--shadow-sm);
}

/* ===== RTL PRINT STYLES ===== */
@media print {
    .rtl .booking-card {
        direction: rtl;
        text-align: right;
    }

    .rtl .summary-item {
        flex-direction: row-reverse;
    }
}

/* ===== RTL DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    .rtl {
        /* Hebrew fonts may need different weights in dark mode */
        font-weight: 400;
    }

    .rtl .app-title {
        font-weight: 700;
    }

    .rtl .section-title {
        font-weight: 700;
    }
}

/* ===== RTL HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    .rtl .form-control {
        border-width: 3px;
        /* Thicker borders for better visibility in Hebrew */
    }

    .rtl .btn {
        border-width: 3px;
        /* Thicker borders for better visibility */
    }
}

/* ===== RTL REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    .rtl .booking-section {
        animation: none;
    }

    .rtl .btn::before {
        display: none;
    }

    .rtl .time-slot::before {
        display: none;
    }
}

/* ===== RTL SPECIFIC UTILITIES ===== */
.rtl .text-left {
    text-align: right !important;
}

.rtl .text-right {
    text-align: left !important;
}

.rtl .float-left {
    float: right !important;
}

.rtl .float-right {
    float: left !important;
}

.rtl .ml-auto {
    margin-left: 0 !important;
    margin-right: auto !important;
}

.rtl .mr-auto {
    margin-right: 0 !important;
    margin-left: auto !important;
}

/* ===== RTL BOOTSTRAP OVERRIDES ===== */
.rtl .container {
    direction: rtl;
}

.rtl .row {
    direction: rtl;
}

.rtl [class*="col-"] {
    direction: rtl;
}

/* ===== RTL FLATPICKR OVERRIDES ===== */
.rtl .flatpickr-calendar {
    direction: rtl;
    /* Set calendar to RTL for proper Hebrew layout */
    right: 0;
    left: auto;
}

.rtl .flatpickr-calendar.arrowTop:before {
    right: 22px;
    left: auto;
}

.rtl .flatpickr-calendar.arrowTop:after {
    right: 23px;
    left: auto;
}

.rtl .flatpickr-calendar .flatpickr-months {
    direction: rtl;
    /* Month navigation should be RTL */
}

.rtl .flatpickr-calendar .flatpickr-prev-month {
    right: 12px;
    left: auto;
}

.rtl .flatpickr-calendar .flatpickr-next-month {
    left: 12px;
    right: auto;
}

.rtl .flatpickr-calendar .flatpickr-current-month {
    text-align: center;
}

.rtl .flatpickr-calendar .flatpickr-weekdays {
    direction: rtl;
    /* Set weekdays to RTL so Sunday appears on the right */
}

.rtl .flatpickr-calendar .flatpickr-days {
    direction: rtl;
    /* Set days grid to RTL so Sunday column is on the right */
}

.rtl .flatpickr-calendar .flatpickr-weekday {
    direction: rtl;
    /* Individual weekday headers should be RTL */
}

.rtl .flatpickr-calendar .flatpickr-day {
    direction: ltr;
    /* Individual day numbers should remain LTR for readability */
}

/* RTL Date input styling */
.rtl .date-input {
    text-align: center;
    direction: ltr;
    /* Keep date display in LTR format */
}

/* ===== RTL SPECIFIC SPACING ===== */
.rtl .me-2 {
    margin-right: 0 !important;
    margin-left: var(--spacing-sm) !important;
}

.rtl .ms-2 {
    margin-left: 0 !important;
    margin-right: var(--spacing-sm) !important;
}

.rtl .pe-3 {
    padding-right: 0 !important;
    padding-left: var(--spacing) !important;
}

.rtl .ps-3 {
    padding-left: 0 !important;
    padding-right: var(--spacing) !important;
}