/* Language Switcher Styles */

.language-switcher {
    position: relative;
    display: inline-block;
    z-index: 1000;
}

.language-switcher-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    font-size: 14px;
    white-space: nowrap;
    flex-shrink: 0;
}

.language-switcher-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.language-switcher-btn .flag-icon {
    width: 24px;
    height: 16px;
    border-radius: 2px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f0f0;
}

.language-switcher-btn .flag-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.language-switcher-btn .lang-name {
    font-weight: 500;
}

.language-switcher-btn .arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.language-switcher.active .language-switcher-btn .arrow {
    transform: rotate(180deg);
}

/* Floating Navigation Style - Light Background */
header.nav-light .language-switcher-btn {
    background-color: rgba(0, 71, 107, 0.08);
    border-color: rgba(0, 71, 107, 0.15);
    color: #00476b;
}

header.nav-light .language-switcher-btn:hover {
    background-color: rgba(0, 71, 107, 0.15);
    border-color: rgba(0, 71, 107, 0.25);
}

header.nav-light .language-switcher-popup-trigger .language-switcher-btn {
    background-color: rgba(0, 71, 107, 0.08);
    border-color: rgba(0, 71, 107, 0.15);
    color: #00476b;
}

header.nav-light .language-switcher-popup-trigger .language-switcher-btn:hover {
    background-color: rgba(0, 71, 107, 0.15);
    border-color: rgba(0, 71, 107, 0.25);
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    min-width: 180px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    overflow: hidden;
}

.language-switcher.active .language-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-dropdown-header {
    padding: 12px 16px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.language-dropdown-list {
    list-style: none;
    margin: 0;
    padding: 8px 0;
    max-height: 300px;
    overflow-y: auto;
}

.language-dropdown-list li {
    margin: 0;
    padding: 0;
}

.language-dropdown-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
}

.language-dropdown-list a:hover {
    background-color: #f0f7ff;
    color: #00476b;
}

.language-dropdown-list a.active {
    background-color: #e8f4fc;
    color: #00476b;
}

.language-dropdown-list a.active::after {
    content: '\f00c';
    font-family: 'FontAwesome';
    margin-left: auto;
    font-size: 12px;
    color: #28a745;
}

.language-dropdown-list .flag-icon {
    width: 24px;
    height: 16px;
    border-radius: 2px;
    overflow: hidden;
    flex-shrink: 0;
    background-color: #f0f0f0;
}

.language-dropdown-list .flag-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.language-dropdown-list .lang-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.language-dropdown-list .lang-name {
    font-weight: 500;
    font-size: 14px;
}

.language-dropdown-list .lang-native {
    font-size: 12px;
    color: #6c757d;
}

/* Inline Style */
.language-switcher-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 1000;
}

.language-switcher-inline .lang-inline-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.language-switcher-inline .lang-inline-item:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

header.nav-light .language-switcher-inline .lang-inline-item {
    background-color: rgba(0, 71, 107, 0.08);
    color: #00476b;
}

header.nav-light .language-switcher-inline .lang-inline-item:hover {
    background-color: rgba(0, 71, 107, 0.15);
    border-color: rgba(0, 71, 107, 0.25);
}

.language-switcher-inline .lang-inline-item.active {
    background-color: var(--primary-color, #00476b);
    border-color: var(--primary-color, #00476b);
}

.language-switcher-inline .flag-icon {
    width: 20px;
    height: 14px;
    border-radius: 2px;
    overflow: hidden;
    flex-shrink: 0;
    background-color: #f0f0f0;
}

.language-switcher-inline .flag-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.language-switcher.inline {
    display: flex;
    align-items: center;
    gap: 4px;
}

.language-switcher.inline .language-switcher-btn {
    display: none;
}

.language-switcher.inline .language-dropdown {
    position: static;
    display: flex;
    flex-direction: row;
    gap: 4px;
    margin-top: 0;
    background-color: transparent;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    border-radius: 0;
    overflow: visible;
}

.language-switcher.inline .language-dropdown-header {
    display: none;
}

.language-switcher.inline .language-dropdown-list {
    display: flex;
    flex-direction: row;
    gap: 4px;
    padding: 0;
    max-height: none;
    overflow: visible;
}

.language-switcher.inline .language-dropdown-list li {
    display: flex;
}

.language-switcher.inline .language-dropdown-list a {
    padding: 6px 10px;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.language-switcher.inline .language-dropdown-list a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.language-switcher.inline .language-dropdown-list a.active {
    background-color: var(--primary-color);
}

.language-switcher.inline .language-dropdown-list a.active::after {
    display: none;
}

.language-switcher.inline .language-dropdown-list .lang-info {
    display: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .language-switcher-btn {
        padding: 6px 10px;
    }

    .language-switcher-btn .lang-name {
        display: none;
    }

    .language-dropdown {
        min-width: 160px;
        right: -10px;
    }

    .language-switcher.inline .language-dropdown-list a {
        padding: 4px 8px;
    }

    .language-switcher.inline .language-dropdown-list .flag-icon {
        width: 20px;
        height: 14px;
    }
}

/* Responsive for medium screens */
@media (max-width: 1280px) {
    .language-switcher-btn {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .language-switcher-btn .lang-name {
        font-size: 13px;
    }
}

@media (max-width: 1024px) {
    .language-switcher-btn {
        padding: 5px 8px;
        font-size: 12px;
    }
    
    .language-switcher-btn .lang-name {
        font-size: 12px;
    }
    
    .language-switcher-btn .flag-icon {
        width: 20px;
        height: 14px;
    }
}

@media (max-width: 900px) {
    .language-switcher-btn {
        padding: 4px 6px;
        font-size: 11px;
    }
    
    .language-switcher-btn .lang-name {
        font-size: 11px;
    }
    
    .language-switcher-btn .flag-icon {
        width: 18px;
        height: 12px;
    }
}

/* RTL Support */
[dir="rtl"] .language-dropdown {
    right: auto;
    left: 0;
}

[dir="rtl"] .language-dropdown-list a {
    flex-direction: row-reverse;
}

[dir="rtl"] .language-dropdown-list a.active::after {
    margin-left: 0;
    margin-right: auto;
}

/* Popup Modal Style */
.language-switcher-popup-trigger {
    display: inline-block;
    z-index: 1000;
}

.language-popup-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.language-popup-modal.active {
    opacity: 1;
    visibility: visible;
}

.language-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 71, 107, 0.3);
    backdrop-filter: blur(4px);
}

.language-popup-content {
    position: relative;
    background-color: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 520px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.language-popup-modal.active .language-popup-content {
    transform: scale(1) translateY(0);
}

.language-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #00476b 0%, #006699 100%);
}

.language-popup-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.language-popup-close {
    width: 36px;
    height: 36px;
    border: none;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #fff;
    font-size: 16px;
}

.language-popup-close:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.language-popup-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.language-popup-body::-webkit-scrollbar {
    width: 6px;
}

.language-popup-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.language-popup-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.language-popup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.language-popup-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background-color: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
}

.language-popup-item:hover {
    background-color: #e8f4fc;
    border-color: #00476b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 71, 107, 0.15);
}

.language-popup-item.active {
    background-color: #e8f4fc;
    border-color: #00476b;
}

.language-popup-item .flag-icon {
    width: 28px;
    height: 20px;
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
    background-color: #e0e0e0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.language-popup-item .flag-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

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

.language-popup-item .lang-native {
    font-size: 12px;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.language-popup-item .lang-check {
    color: #28a745;
    font-size: 14px;
    flex-shrink: 0;
}

/* Popup Responsive */
@media (max-width: 480px) {
    .language-popup-content {
        width: 95%;
        max-height: 85vh;
    }

    .language-popup-header {
        padding: 16px 20px;
    }

    .language-popup-header h3 {
        font-size: 16px;
    }

    .language-popup-body {
        padding: 16px;
    }

    .language-popup-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .language-popup-item {
        padding: 12px;
    }

    .language-popup-item .lang-name {
        font-size: 13px;
    }

    .language-popup-item .lang-native {
        font-size: 11px;
    }
}
