/* RTL Support for SP-CV Builder */
/* עיצוב עבור כתיבה מימין לשמאל - עברית */

[dir="rtl"] .sp-cv-builder-container,
body.rtl .sp-cv-builder-container,
html[lang="he"] .sp-cv-builder-container,
html[lang="he-IL"] .sp-cv-builder-container {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .sp-cv-form,
body.rtl .sp-cv-form,
html[lang="he"] .sp-cv-form,
html[lang="he-IL"] .sp-cv-form {
    direction: rtl;
}

/* Progress bar */
[dir="rtl"] .sp-cv-steps,
body.rtl .sp-cv-steps,
html[lang="he"] .sp-cv-steps,
html[lang="he-IL"] .sp-cv-steps {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .sp-cv-step,
body.rtl .sp-cv-step,
html[lang="he"] .sp-cv-step,
html[lang="he-IL"] .sp-cv-step {
    float: right;
    margin-left: 0;
    margin-right: 10px;
}

[dir="rtl"] .sp-cv-step:first-child,
body.rtl .sp-cv-step:first-child,
html[lang="he"] .sp-cv-step:first-child,
html[lang="he-IL"] .sp-cv-step:first-child {
    margin-right: 0;
}

/* Form inputs */
[dir="rtl"] .sp-cv-form input,
[dir="rtl"] .sp-cv-form textarea,
[dir="rtl"] .sp-cv-form select,
body.rtl .sp-cv-form input,
body.rtl .sp-cv-form textarea,
body.rtl .sp-cv-form select,
html[lang="he"] .sp-cv-form input,
html[lang="he"] .sp-cv-form textarea,
html[lang="he"] .sp-cv-form select,
html[lang="he-IL"] .sp-cv-form input,
html[lang="he-IL"] .sp-cv-form textarea,
html[lang="he-IL"] .sp-cv-form select {
    direction: rtl;
    text-align: right;
}

/* Labels */
[dir="rtl"] .sp-cv-form label,
body.rtl .sp-cv-form label,
html[lang="he"] .sp-cv-form label,
html[lang="he-IL"] .sp-cv-form label {
    text-align: right;
    float: right;
}

/* Buttons */
[dir="rtl"] .sp-cv-navigation,
body.rtl .sp-cv-navigation,
html[lang="he"] .sp-cv-navigation,
html[lang="he-IL"] .sp-cv-navigation {
    direction: rtl;
    display: flex !important;
    justify-content: space-between !important;
}

/* Button positioning in RTL - swap left and right containers */
[dir="rtl"] .sp-cv-navigation-left,
body.rtl .sp-cv-navigation-left,
html[lang="he"] .sp-cv-navigation-left,
html[lang="he-IL"] .sp-cv-navigation-left {
    order: 2; /* Move to right side */
}

[dir="rtl"] .sp-cv-navigation-right,
body.rtl .sp-cv-navigation-right,
html[lang="he"] .sp-cv-navigation-right,
html[lang="he-IL"] .sp-cv-navigation-right {
    order: 1; /* Move to left side */
}

/* Dynamic sections */
[dir="rtl"] .sp-cv-add-btn,
[dir="rtl"] .sp-cv-remove-btn,
body.rtl .sp-cv-add-btn,
body.rtl .sp-cv-remove-btn,
html[lang="he"] .sp-cv-add-btn,
html[lang="he"] .sp-cv-remove-btn,
html[lang="he-IL"] .sp-cv-add-btn,
html[lang="he-IL"] .sp-cv-remove-btn {
    direction: rtl;
}

/* Grid system RTL */
[dir="rtl"] .sp-cv-row,
body.rtl .sp-cv-row,
html[lang="he"] .sp-cv-row,
html[lang="he-IL"] .sp-cv-row {
    direction: rtl;
}

[dir="rtl"] .sp-cv-col-6,
[dir="rtl"] .sp-cv-col-12,
body.rtl .sp-cv-col-6,
body.rtl .sp-cv-col-12,
html[lang="he"] .sp-cv-col-6,
html[lang="he"] .sp-cv-col-12,
html[lang="he-IL"] .sp-cv-col-6,
html[lang="he-IL"] .sp-cv-col-12 {
    float: right;
    margin-left: 0;
    margin-right: 15px;
}

[dir="rtl"] .sp-cv-col-6:first-child,
[dir="rtl"] .sp-cv-col-12:first-child,
body.rtl .sp-cv-col-6:first-child,
body.rtl .sp-cv-col-12:first-child,
html[lang="he"] .sp-cv-col-6:first-child,
html[lang="he"] .sp-cv-col-12:first-child,
html[lang="he-IL"] .sp-cv-col-6:first-child,
html[lang="he-IL"] .sp-cv-col-12:first-child {
    margin-right: 0;
}

/* Messages and alerts */
[dir="rtl"] .sp-cv-message,
[dir="rtl"] .sp-cv-error,
[dir="rtl"] .sp-cv-success,
body.rtl .sp-cv-message,
body.rtl .sp-cv-error,
body.rtl .sp-cv-success,
html[lang="he"] .sp-cv-message,
html[lang="he"] .sp-cv-error,
html[lang="he"] .sp-cv-success,
html[lang="he-IL"] .sp-cv-message,
html[lang="he-IL"] .sp-cv-error,
html[lang="he-IL"] .sp-cv-success {
    direction: rtl;
    text-align: right;
}

/* CV Display RTL */
[dir="rtl"] .cv-container,
body.rtl .cv-container,
html[lang="he"] .cv-container,
html[lang="he-IL"] .cv-container {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .cv-header,
body.rtl .cv-header,
html[lang="he"] .cv-header,
html[lang="he-IL"] .cv-header {
    direction: rtl;
    text-align: center;
}

[dir="rtl"] .cv-section,
body.rtl .cv-section,
html[lang="he"] .cv-section,
html[lang="he-IL"] .cv-section {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .cv-section h2,
body.rtl .cv-section h2,
html[lang="he"] .cv-section h2,
html[lang="he-IL"] .cv-section h2 {
    text-align: right;
    border-bottom: 2px solid #0073aa;
    border-right: none;
    border-left: none;
}

/* Skills list RTL */
[dir="rtl"] .skills-list,
body.rtl .skills-list,
html[lang="he"] .skills-list,
html[lang="he-IL"] .skills-list {
    direction: rtl;
    justify-content: flex-start;
}

[dir="rtl"] .skill-item,
body.rtl .skill-item,
html[lang="he"] .skill-item,
html[lang="he-IL"] .skill-item {
    direction: rtl;
    text-align: right;
}

/* Hebrew font support */
html[lang="he"] .sp-cv-builder-container,
html[lang="he-IL"] .sp-cv-builder-container,
html[lang="he"] .cv-container,
html[lang="he-IL"] .cv-container {
    font-family: 'David', 'Times New Roman', 'Narkisim', 'Rod', Arial, sans-serif;
}

/* Admin RTL */
[dir="rtl"] .sp-cv-admin-table,
body.rtl .sp-cv-admin-table,
html[lang="he"] .sp-cv-admin-table,
html[lang="he-IL"] .sp-cv-admin-table {
    direction: rtl;
}

[dir="rtl"] .sp-cv-admin-table th,
[dir="rtl"] .sp-cv-admin-table td,
body.rtl .sp-cv-admin-table th,
body.rtl .sp-cv-admin-table td,
html[lang="he"] .sp-cv-admin-table th,
html[lang="he"] .sp-cv-admin-table td,
html[lang="he-IL"] .sp-cv-admin-table th,
html[lang="he-IL"] .sp-cv-admin-table td {
    text-align: right;
}

/* Responsive RTL adjustments */
@media (max-width: 768px) {
    [dir="rtl"] .sp-cv-col-6,
    body.rtl .sp-cv-col-6,
    html[lang="he"] .sp-cv-col-6,
    html[lang="he-IL"] .sp-cv-col-6 {
        width: 100%;
        margin-right: 0;
        margin-bottom: 15px;
    }
}

/* RTL Support for SP CV Builder Modern Design */

/* Hebrew Typography and RTL Support */
html[lang="he"] .sp-cv-builder-container,
html[lang="he-IL"] .sp-cv-builder-container,
.sp-cv-builder-container[dir="rtl"] {
    direction: rtl;
    text-align: right;
    font-family: 'Assistant', 'Heebo', 'Rubik', 'Noto Sans Hebrew', 'David', 'Narkisim', Arial, sans-serif;
}

/* RTL Layout Adjustments */
html[lang="he"] .sp-cv-builder-container *,
html[lang="he-IL"] .sp-cv-builder-container *,
.sp-cv-builder-container[dir="rtl"] * {
    direction: rtl;
    text-align: right;
}

/* Language Switcher RTL */
.sp-cv-builder-container[dir="rtl"] .sp-cv-language-switcher {
    right: auto;
    left: 1rem;
}

/* Step Progress RTL */
.sp-cv-builder-container[dir="rtl"] .sp-cv-steps {
    direction: rtl;
}

.sp-cv-builder-container[dir="rtl"] .sp-cv-step {
    direction: rtl;
}

/* Progress Bar RTL */
.sp-cv-builder-container[dir="rtl"] .sp-cv-progress-fill::after {
    right: auto;
    left: 0;
    background: linear-gradient(-90deg, transparent, rgba(255, 255, 255, 0.3));
}

/* Section Headers RTL */
.sp-cv-builder-container[dir="rtl"] .sp-cv-step-content h2::after {
    left: auto;
    right: 0;
}

/* Form Fields RTL */
.sp-cv-builder-container[dir="rtl"] .sp-cv-form label {
    text-align: right;
}

.sp-cv-builder-container[dir="rtl"] .sp-cv-form input,
.sp-cv-builder-container[dir="rtl"] .sp-cv-form select,
.sp-cv-builder-container[dir="rtl"] .sp-cv-form textarea {
    text-align: right;
    direction: rtl;
}

.sp-cv-builder-container[dir="rtl"] .sp-cv-form input::placeholder,
.sp-cv-builder-container[dir="rtl"] .sp-cv-form textarea::placeholder {
    text-align: right;
    direction: rtl;
}

/* Buttons RTL */
.sp-cv-builder-container[dir="rtl"] .sp-cv-btn {
    direction: rtl;
}

/* Navigation RTL - swap left and right sides */
.sp-cv-builder-container[dir="rtl"] .sp-cv-navigation {
    direction: rtl;
    flex-direction: row-reverse;
}

.sp-cv-builder-container[dir="rtl"] .sp-cv-navigation-left {
    order: 2; /* Move to right side in RTL */
    justify-content: flex-end;
}

.sp-cv-builder-container[dir="rtl"] .sp-cv-navigation-right {
    order: 1; /* Move to left side in RTL */
    justify-content: flex-start;
}

/* RTL Button content and arrows */
.sp-cv-builder-container[dir="rtl"] .sp-cv-btn {
    flex-direction: row-reverse;
    text-align: center;
}

/* Flip arrow directions for RTL */
html[lang="he"] .sp-cv-builder-container .sp-cv-btn span,
html[lang="he-IL"] .sp-cv-builder-container .sp-cv-btn span {
    transform: scaleX(-1);
    display: inline-block;
}

/* Special handling for checkmark - don't flip it */
html[lang="he"] .sp-cv-builder-container #sp-cv-finish span,
html[lang="he-IL"] .sp-cv-builder-container #sp-cv-finish span {
    transform: none;
}

/* Dynamic Sections RTL */
.sp-cv-builder-container[dir="rtl"] .sp-cv-dynamic-header {
    direction: rtl;
    text-align: right;
}

.sp-cv-builder-container[dir="rtl"] .sp-cv-dynamic-title {
    text-align: right;
}

.sp-cv-builder-container[dir="rtl"] .sp-cv-remove-btn {
    margin-left: 0;
    margin-right: auto;
}

/* Skills and Languages RTL */
.sp-cv-builder-container[dir="rtl"] .sp-cv-skill-item,
.sp-cv-builder-container[dir="rtl"] .sp-cv-language-item {
    direction: rtl;
    text-align: right;
}

.sp-cv-builder-container[dir="rtl"] .sp-cv-skill-group h4 {
    text-align: right;
}

/* Results Section RTL */
.sp-cv-builder-container[dir="rtl"] .sp-cv-result {
    direction: rtl;
    text-align: center;
}

.sp-cv-builder-container[dir="rtl"] .sp-cv-share {
    direction: rtl;
    text-align: right;
}

.sp-cv-builder-container[dir="rtl"] .sp-cv-share label {
    text-align: right;
    direction: rtl;
}

/* CV Display RTL */
.sp-cv-builder-container[dir="rtl"] .sp-cv-display {
    direction: rtl;
    text-align: right;
}

.sp-cv-builder-container[dir="rtl"] .sp-cv-header {
    text-align: center;
    direction: rtl;
}

.sp-cv-builder-container[dir="rtl"] .sp-cv-name,
.sp-cv-builder-container[dir="rtl"] .sp-cv-title {
    text-align: center;
    direction: rtl;
}

.sp-cv-builder-container[dir="rtl"] .sp-cv-contact {
    direction: rtl;
    text-align: center;
}

.sp-cv-builder-container[dir="rtl"] .sp-cv-section {
    direction: rtl;
    text-align: right;
}

.sp-cv-builder-container[dir="rtl"] .sp-cv-section h3 {
    text-align: right;
    direction: rtl;
}

/* Arrow Icons RTL */
.sp-cv-builder-container[dir="rtl"] .sp-cv-btn span {
    transform: scaleX(-1);
}

/* Specific Hebrew Typography Improvements */
html[lang="he"] .sp-cv-builder-container,
html[lang="he-IL"] .sp-cv-builder-container {
    font-weight: 400;
    line-height: 1.7;
}

html[lang="he"] .sp-cv-builder-container h1,
html[lang="he-IL"] .sp-cv-builder-container h1,
html[lang="he"] .sp-cv-builder-container h2,
html[lang="he-IL"] .sp-cv-builder-container h2,
html[lang="he"] .sp-cv-builder-container h3,
html[lang="he-IL"] .sp-cv-builder-container h3,
html[lang="he"] .sp-cv-builder-container h4,
html[lang="he-IL"] .sp-cv-builder-container h4 {
    font-family: 'Assistant', 'Heebo', 'Rubik', 'Noto Sans Hebrew', sans-serif;
    font-weight: 600;
    letter-spacing: 0;
}

html[lang="he"] .sp-cv-builder-container .sp-cv-step-title,
html[lang="he-IL"] .sp-cv-builder-container .sp-cv-step-title {
    font-family: 'Assistant', 'Heebo', sans-serif;
    font-weight: 500;
    font-size: 0.8rem;
    line-height: 1.2;
}

html[lang="he"] .sp-cv-builder-container label,
html[lang="he-IL"] .sp-cv-builder-container label {
    font-family: 'Assistant', 'Heebo', sans-serif;
    font-weight: 500;
}

html[lang="he"] .sp-cv-builder-container input,
html[lang="he-IL"] .sp-cv-builder-container input,
html[lang="he"] .sp-cv-builder-container textarea,
html[lang="he-IL"] .sp-cv-builder-container textarea,
html[lang="he"] .sp-cv-builder-container select,
html[lang="he-IL"] .sp-cv-builder-container select {
    font-family: 'Assistant', 'Heebo', 'Rubik', sans-serif;
    font-weight: 400;
    line-height: 1.5;
}

html[lang="he"] .sp-cv-builder-container .sp-cv-btn,
html[lang="he-IL"] .sp-cv-builder-container .sp-cv-btn {
    font-family: 'Assistant', 'Heebo', sans-serif;
    font-weight: 600;
    letter-spacing: 0.025em;
}

/* Hebrew Placeholder Styling */
html[lang="he"] .sp-cv-builder-container input::placeholder,
html[lang="he-IL"] .sp-cv-builder-container input::placeholder,
html[lang="he"] .sp-cv-builder-container textarea::placeholder,
html[lang="he-IL"] .sp-cv-builder-container textarea::placeholder {
    font-family: 'Assistant', 'Heebo', sans-serif;
    font-style: normal;
    opacity: 0.7;
    color: var(--text-muted);
}

/* Mobile RTL Adjustments */
@media (max-width: 768px) {
    .sp-cv-builder-container[dir="rtl"] .sp-cv-language-switcher {
        left: 0.75rem;
        right: auto;
    }
    
    .sp-cv-builder-container[dir="rtl"] .sp-cv-navigation {
        flex-direction: column-reverse;
    }
    
    .sp-cv-builder-container[dir="rtl"] .sp-cv-navigation-left,
    .sp-cv-builder-container[dir="rtl"] .sp-cv-navigation-right {
        width: 100%;
        justify-content: center;
        order: unset;
    }
    
    html[lang="he"] .sp-cv-builder-container .sp-cv-step,
    html[lang="he-IL"] .sp-cv-builder-container .sp-cv-step {
        min-width: 55px;
        max-width: 75px;
        padding: 0.5rem 0.2rem;
    }
    
    html[lang="he"] .sp-cv-builder-container .sp-cv-step .step-title,
    html[lang="he-IL"] .sp-cv-builder-container .sp-cv-step .step-title {
        font-size: 0.6rem;
        line-height: 1;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .sp-cv-builder-container[dir="rtl"] .sp-cv-language-switcher {
        left: 0.5rem;
        right: auto;
    }
    
    html[lang="he"] .sp-cv-builder-container .sp-cv-step,
    html[lang="he-IL"] .sp-cv-builder-container .sp-cv-step {
        min-width: 50px;
        max-width: 65px;
        padding: 0.375rem 0.15rem;
    }
    
    html[lang="he"] .sp-cv-builder-container .sp-cv-step .step-title,
    html[lang="he-IL"] .sp-cv-builder-container .sp-cv-step .step-title {
        font-size: 0.55rem;
        line-height: 0.9;
    }
    
    html[lang="he"] .sp-cv-builder-container .sp-cv-steps,
    html[lang="he-IL"] .sp-cv-builder-container .sp-cv-steps {
        gap: 0.15rem;
        justify-content: center;
    }
    
    /* Mobile RTL navigation fixes */
    .sp-cv-builder-container[dir="rtl"] .sp-cv-navigation {
        flex-direction: column-reverse;
    }
    
    .sp-cv-builder-container[dir="rtl"] .sp-cv-navigation-left,
    .sp-cv-builder-container[dir="rtl"] .sp-cv-navigation-right {
        width: 100%;
        justify-content: center;
        order: unset;
    }
}

/* Additional Hebrew Font Fallbacks */
@media screen and (max-width: 480px) {
    html[lang="he"] .sp-cv-builder-container,
    html[lang="he-IL"] .sp-cv-builder-container {
        font-family: 'Assistant', 'Heebo', 'Arial Hebrew', 'David', system-ui, sans-serif;
    }
}

/* Fix for Hebrew Number Display */
html[lang="he"] .sp-cv-step .step-number,
html[lang="he-IL"] .sp-cv-step .step-number {
    direction: ltr;
    text-align: center;
}

/* Hebrew-specific spacing adjustments */
html[lang="he"] .sp-cv-builder-container .sp-cv-form-group,
html[lang="he-IL"] .sp-cv-builder-container .sp-cv-form-group {
    margin-bottom: 1.8rem;
}

html[lang="he"] .sp-cv-builder-container .sp-cv-row,
html[lang="he-IL"] .sp-cv-builder-container .sp-cv-row {
    margin-bottom: 1.8rem;
}

/* Hebrew Step Progress Fixes */
html[lang="he"] .sp-cv-builder-container .sp-cv-steps,
html[lang="he-IL"] .sp-cv-builder-container .sp-cv-steps {
    direction: rtl;
    gap: 0.2rem;
}

html[lang="he"] .sp-cv-builder-container .sp-cv-step,
html[lang="he-IL"] .sp-cv-builder-container .sp-cv-step {
    direction: rtl;
    min-width: 75px;
    max-width: 100px;
    padding: 0.75rem 0.25rem;
}

html[lang="he"] .sp-cv-builder-container .sp-cv-step .step-title,
html[lang="he-IL"] .sp-cv-builder-container .sp-cv-step .step-title {
    font-size: 0.7rem;
    line-height: 1.1;
    text-align: center;
    direction: rtl;
    unicode-bidi: embed;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Language Switcher Hebrew Position */
html[lang="he"] .sp-cv-builder-container .sp-cv-language-switcher,
html[lang="he-IL"] .sp-cv-builder-container .sp-cv-language-switcher {
    left: 1rem;
    right: auto;
}

/* Fix checkbox alignment for RTL */
.sp-cv-builder-container[dir="rtl"] input[type="checkbox"] {
    margin-left: 0.5rem;
    margin-right: 0;
}

.sp-cv-builder-container[dir="rtl"] label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    flex-direction: row-reverse;
    text-align: right;
}

/* Ensure proper RTL text flow */
.sp-cv-builder-container[dir="rtl"] * {
    unicode-bidi: embed;
}

html[lang="he"] .sp-cv-builder-container *,
html[lang="he-IL"] .sp-cv-builder-container * {
    unicode-bidi: embed;
} 