/**
 * Language Selector Styles
 */

/* Language Selector Container */
#language-selector {
    position: relative;
    z-index: 1000;
}

.lang-dropdown {
    position: relative;
    display: inline-block;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lang-flag {
    font-size: 18px;
}

.lang-name {
    font-weight: 500;
}

.lang-arrow {
    font-size: 10px;
    margin-left: 4px;
    transition: transform 0.2s;
}

.lang-menu.show + .lang-btn .lang-arrow,
.lang-btn:focus + .lang-menu .lang-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.lang-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    overflow: hidden;
}

.lang-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: #333;
    cursor: pointer;
    font-size: 14px;
    text-align: left;
    transition: background 0.15s;
}

.lang-option:hover {
    background: #f5f5f5;
}

.lang-option.active {
    background: #e3f2fd;
    color: #1a73e8;
    font-weight: 600;
}

.lang-option .lang-flag {
    font-size: 20px;
}

/* RTL Support */
html[dir="rtl"] body {
    text-align: right;
}

html[dir="rtl"] .lang-menu {
    right: auto;
    left: 0;
}

html[dir="rtl"] .sidebar {
    right: 0;
    left: auto;
}

html[dir="rtl"] .main-content {
    margin-right: 260px;
    margin-left: 0;
}

html[dir="rtl"] .nav-item {
    border-left: none;
    border-right: 3px solid transparent;
}

html[dir="rtl"] .nav-item.active {
    border-right-color: white;
}

html[dir="rtl"] .user-badge {
    flex-direction: row-reverse;
}

html[dir="rtl"] .stat-card {
    flex-direction: row-reverse;
}

html[dir="rtl"] .job-actions {
    flex-direction: row-reverse;
}

html[dir="rtl"] .btn-group {
    flex-direction: row-reverse;
}

html[dir="rtl"] .search-grid {
    direction: rtl;
}

html[dir="rtl"] .form-group label {
    text-align: right;
}

html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select {
    text-align: right;
}

/* Light theme variant for non-sidebar areas */
.lang-dropdown-light .lang-btn {
    background: #f0f2f5;
    border-color: #e0e0e0;
    color: #333;
}

.lang-dropdown-light .lang-btn:hover {
    background: #e3e5e8;
}

/* Mobile responsive */
@media (max-width: 900px) {
    html[dir="rtl"] .sidebar {
        position: fixed;
        right: -300px;
        left: auto;
        transition: right 0.3s;
    }

    html[dir="rtl"] .sidebar.open {
        right: 0;
    }

    html[dir="rtl"] .main-content {
        margin-right: 0;
    }
    
    html[dir="rtl"] .mobile-menu-toggle {
        right: 16px;
        left: auto;
    }
}

@media (max-width: 768px) {
    .lang-menu {
        right: 0;
        left: auto;
        min-width: 150px;
    }

    html[dir="rtl"] .lang-menu {
        right: 0;
        left: auto;
    }
    
    .lang-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .lang-flag {
        font-size: 16px;
    }
    
    .lang-option {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .lang-option .lang-flag {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .lang-btn {
        padding: 6px 10px;
        font-size: 12px;
        gap: 6px;
    }
    
    .lang-flag {
        font-size: 14px;
    }
    
    .lang-name {
        display: none;
    }
    
    .lang-menu {
        min-width: 140px;
    }
    
    .lang-option {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    html[dir="rtl"] .mobile-menu-toggle {
        right: 12px;
    }
}
