/* Language Selector Modal */
.language-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-height: 450px;
    overflow-y: auto;
}

.language-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.language-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    text-decoration: none;
}

.language-item.active {
    background: rgba(188, 49, 42, 0.15);
    border-color: rgba(188, 49, 42, 0.4);
}

.language-flag {
    width: 32px;
    height: 24px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.language-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.language-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.language-native {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.language-check {
    color: #bc312a;
    font-size: 14px;
    flex-shrink: 0;
}

/* Language Button in Navbar */
.language-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px !important;
    height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    transition: all 0.2s ease;
    cursor: pointer;
    padding: 0 !important;
    flex-shrink: 0;
    margin-left: 8px;
    overflow: hidden !important;
}

.language-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.language-btn .current-flag,
.language-btn img {
    width: 24px !important;
    height: 18px !important;
    max-width: 24px !important;
    max-height: 18px !important;
    object-fit: cover;
    border-radius: 3px;
}

/* Scrollbar styling for language grid */
.language-grid::-webkit-scrollbar {
    width: 6px;
}

.language-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.language-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.language-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* RTL Support for Arabic */
[dir="rtl"] .language-item {
    flex-direction: row-reverse;
}

[dir="rtl"] .language-info {
    text-align: right;
}

[dir="rtl"] .language-check {
    margin-right: auto;
    margin-left: 0;
}

/* Responsive */
@media (max-width: 576px) {
    .language-grid {
        grid-template-columns: 1fr;
    }

    .language-btn {
        width: 42px;
        height: 42px;
    }

    .language-btn .current-flag {
        width: 20px;
        height: 15px;
    }
}
