
/**
 * Language Switcher Styles
 * File: assets/css/language-switcher.css
 */

/* Language Switcher Container */
.language-switcher {
    position: relative;
    display: inline-block;
    margin-right: 20px;
}

.lang-dropdown {
    position: relative;
}

/* Current Language Button */
.lang-current {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.3s ease;
}

.lang-current:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.lang-flag {
    font-size: 18px;
    line-height: 1;
}

.lang-name {
    font-weight: 500;
}

.lang-current i {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.lang-dropdown.active .lang-current i {
    transform: rotate(180deg);
}

/* Language Menu Dropdown */
.lang-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
}

.lang-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Language Options */
.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: #333;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    text-align: left;
    transition: all 0.2s ease;
}

.lang-option:hover {
    background: #f5f5f5;
}

.lang-option.active {
    background: #4CAF50;
    color: #fff;
}

.lang-option.active .lang-name {
    font-weight: 600;
}

/* RTL Support */
body.rtl {
    direction: rtl;
}

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

body.rtl .lang-menu {
    right: auto;
    left: 0;
}

body.rtl .lang-option {
    text-align: right;
}

body.rtl .header-top-wrapper {
    flex-direction: row-reverse;
}

body.rtl .nav-menu {
    direction: rtl;
}

body.rtl .footer-widget .row {
    direction: rtl;
}

/* Responsive */
@media (max-width: 768px) {
    .language-switcher {
        margin-right: 10px;
        margin-bottom: 10px;
    }
    
    .lang-current {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .lang-name {
        display: none;
    }
    
    .lang-flag {
        font-size: 20px;
    }
    
    .lang-menu {
        min-width: 150px;
    }
    
    body.rtl .language-switcher {
        margin-left: 10px;
    }
}

/* Additional RTL Adjustments */
body.rtl .header-link a {
    margin-left: 0;
    margin-right: 20px;
}

body.rtl .blog-content .more {
    direction: rtl;
}

body.rtl .footer-link ul {
    padding-right: 0;
}

/* Animation for language change */
[data-i18n] {
    transition: opacity 0.2s ease;
}

html.changing-language [data-i18n] {
    opacity: 0.5;
}


/* When Kurdish is active, flip text alignments if needed */
[dir="rtl"] .nav-menu {
    text-align: right;
}

[dir="rtl"] .header-top-left {
    order: 2; /* Flips the position of top-bar items */
}

.language-switcher a.active {
    color: #07294d; /* Highlight active language */
    font-weight: bold;
}

/* Standard LTR Styles */

.language-switcher {
    display: flex;
    align-items: center;
    gap: 15px; /* Space between flags */
    padding: 5px 0;
}

.flag-icon {
    width: 25px; /* Size of the flag */
    height: auto;
    border-radius: 2px;
    transition: transform 0.3s ease, filter 0.3s ease;
    border: 1px solid rgba(255,255,255,0.2);
}

.language-switcher a:hover .flag-icon {
    transform: scale(1.2); /* Slight zoom on hover */
    filter: brightness(1.1);
}

.language-switcher a.active .flag-icon {
    border: 2px solid #07294d; /* Highlight the active language flag */
    box-shadow: 0 0 5px rgba(255, 198, 0, 0.5);
}

/* Ensure RTL doesn't break the layout */
[dir="rtl"] .language-switcher {
    flex-direction: row-reverse;
}

.language-switcher a { color: #8d8d8d; text-decoration: none; font-size: 13px; }
.language-switcher a.active { color: #07294d; font-weight: bold; }

/* RTL Adjustments */
[dir="rtl"] body {
    text-align: right;
}
[dir="rtl"] .nav-menu li {
    float: right;
}
[dir="rtl"] .nav-dropdown {
    right: 0;
    left: auto;
    text-align: right;
}