/**
 * Language Switcher & RTL Support Styles
 */

/* Tajawal Arabic Font - Local */
@font-face {
    font-family: 'Tajawal';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/Tajawal-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'Tajawal';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/Tajawal-Medium.ttf') format('truetype');
}

@font-face {
    font-family: 'Tajawal';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/Tajawal-Bold.ttf') format('truetype');
}

/* Language Switcher */
.language-switcher {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 20px;
    background: rgba(41, 38, 51, 0.6);
    border-radius: 25px;
    padding: 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Language Switcher in Page Corner (Fixed Position) */
.language-switcher-corner {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    margin: 0;
    background: rgba(41, 38, 51, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.language-switcher-corner:hover {
    background: rgba(41, 38, 51, 0.95);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

/* Language Switcher in Profile Sidebar (Keep for backward compatibility) */
.psHeader .psContent .language-switcher {
    margin-left: 0;
    margin-right: 0;
    margin-top: 15px;
    width: 100%;
    justify-content: center;
    display: flex;
    position: relative;
}

.language-switcher .lang-btn {
    background: transparent;
    border: none;
    color: #b0b0b0;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.language-switcher .lang-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.language-switcher .lang-btn.active {
    background: #7635f5;
    color: #fff;
    box-shadow: 0 2px 8px rgba(118, 53, 245, 0.3);
}

/* RTL Support */
body.rtl {
    direction: rtl;
    text-align: right;
}

body.ltr {
    direction: ltr;
    text-align: left;
}

/* RTL Layout Adjustments */
body.rtl .header {
    direction: rtl;
}

body.rtl .mainMenu ul {
    direction: rtl;
}

body.rtl .mainMenu ul li {
    margin-left: 0;
    margin-right: 30px;
}

body.rtl .mainMenu ul li:last-child {
    margin-right: 0;
}

/* Force RTL for mainMenu (always RTL) */
.mainMenu {
    direction: rtl !important;
    float: right !important;
}

.mainMenu ul {
    direction: rtl !important;
}

.mainMenu ul li {
    float: right !important;
}

.mainMenu ul li:after {
    left: 0 !important;
    right: auto !important;
}

.mainMenu ul li:first-child {
    margin-right: 0 !important;
}

body.rtl .sidebar {
    right: auto;
    left: -400px;
}

body.rtl .sidebar.active {
    left: 0;
    right: auto;
}

body.rtl .sidebarOverlay.active {
    right: 0;
    left: 0;
}

body.rtl .language-switcher {
    margin-left: 0;
    margin-right: 20px;
}

/* RTL Language Switcher Corner */
body.rtl .language-switcher-corner {
    right: auto;
    left: 20px;
    margin: 0;
}

body.rtl .psHeader .psContent .language-switcher {
    margin-left: 0;
    margin-right: 0;
}

/* RTL Form Elements */
body.rtl .contact_form input,
body.rtl .contact_form textarea {
    text-align: right;
    direction: rtl;
}

body.rtl .search_form input {
    text-align: right;
    direction: rtl;
}

/* RTL Icon Boxes */
body.rtl .icon_box_01,
body.rtl .icon_box_02,
body.rtl .icon_box_03 {
    text-align: right;
    direction: rtl;
}

body.rtl .icon_box_01 i {
    margin-right: 0;
    margin-left: 15px;
}

body.rtl .icon_box_01 h3 {
    flex-direction: row-reverse;
    direction: rtl;
}

body.rtl .icon_box_01 p {
    text-align: right;
    direction: rtl;
}

body.rtl .icon_box_01 p a {
    direction: ltr; /* Keep links LTR for email/phone */
    display: inline-block;
}

/* Apply Tajawal Font to Arabic Content */
body.rtl,
body.rtl *,
body[lang="ar"],
body[lang="ar"] * {
    font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
}

/* RTL Profile Sidebar */
body.rtl .profileSidebar {
    direction: rtl;
    font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body.rtl .psPhoto {
    direction: rtl;
}

body.rtl .psPhoto h3 {
    text-align: center;
    direction: rtl;
}

body.rtl .psPhoto span {
    text-align: center;
    direction: rtl;
}

body.rtl .psSocial {
    direction: rtl;
}

body.rtl .psSocial a {
    margin-left: 0;
    margin-right: 10px;
}

body.rtl .psSocial a:last-child {
    margin-right: 0;
}

/* RTL Skills Bars */
body.rtl .pssbBars {
    direction: ltr; /* Keep progress bars LTR */
}

/* RTL Widgets */
body.rtl .widget {
    text-align: right;
}

body.rtl .widget ul li {
    padding-left: 0;
    padding-right: 20px;
}

body.rtl .widget ul li:before {
    left: auto;
    right: 0;
}

/* RTL Accordion - Icons before text */
body.rtl .kr-accordion .card-header a {
    flex-direction: row; /* Keep icons before text even in RTL */
}

body.rtl .kr-accordion .card-header a i {
    margin-left: 0;
    margin-right: 15px;
}

/* RTL Portfolio Grid */
body.rtl .folio_item {
    text-align: right;
}

/* RTL Footer */
body.rtl .footer {
    direction: rtl;
}

/* Responsive Language Switcher */
@media (max-width: 768px) {
    .language-switcher {
        margin-left: 10px;
        margin-right: 10px;
    }
    
    .language-switcher-corner {
        top: 15px;
        right: 15px;
    }
    
    body.rtl .language-switcher-corner {
        left: 15px;
        right: auto;
    }
    
    .language-switcher .lang-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    body.rtl .language-switcher {
        margin-right: 10px;
        margin-left: 10px;
    }
}

/* RTL WhatsApp Float Button */
body.rtl .whatsapp-float {
    right: auto;
    left: 30px;
}

@media (max-width: 768px) {
    body.rtl .whatsapp-float {
        left: 20px;
    }
}

/* RTL Back to Top Button */
body.rtl #backtotop {
    right: auto;
    left: 30px;
}

/* RTL Preloader */
body.rtl .preloader-box {
    direction: ltr; /* Keep preloader LTR */
}

/* RTL Menu Button */
body.rtl .menu_btn {
    direction: rtl;
}

body.rtl .menu_btn i {
    margin-left: 8px;
    margin-right: 0;
}

/* RTL Section Titles */
body.rtl .sectionTitle {
    text-align: right;
}

body.rtl .sectionTitle:after {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    background-position: center;
}

body.rtl .widget_title:after {
    left: auto;
    right: 0;
    background-position: right center;
}

body.rtl .subSectionTitle {
    text-align: right;
}

/* RTL Lists */
body.rtl ul,
body.rtl ol {
    padding-right: 20px;
    padding-left: 0;
}

body.rtl .skillList li {
    padding-right: 20px;
    padding-left: 0;
}

body.rtl .achievementList li {
    padding-right: 25px;
    padding-left: 0;
}

body.rtl .achievementList li:before {
    left: auto;
    right: 0;
}

/* RTL Buttons */
body.rtl .btt_btn {
    direction: rtl;
}

body.rtl .btt_btn i {
    margin-left: 8px;
    margin-right: 0;
}

/* RTL Hero Section (Portfolio) */
body.rtl .hero {
    text-align: right;
}

body.rtl .heroButtons {
    justify-content: flex-start;
}

body.rtl .problems {
    text-align: right;
}

body.rtl .problems ul li {
    padding-left: 0;
    padding-right: 35px;
}

body.rtl .problems ul li:before {
    left: auto;
    right: 0;
}

body.rtl .services {
    text-align: right;
}

body.rtl .authority {
    text-align: right;
}

body.rtl .authority ul li {
    padding-left: 0;
    padding-right: 35px;
}

body.rtl .authority ul li:before {
    left: auto;
    right: 0;
}

body.rtl .cta {
    text-align: right;
}

/* RTL Contact Form Success Message */
body.rtl .success-message {
    text-align: center; /* Keep centered */
}

/* Smooth transition when switching languages */
* {
    transition: text-align 0.3s ease, direction 0.3s ease;
}

