/* Language switcher */
.lang-switcher {
    position: relative;
    margin-right: 8px;
}

.lang-switcher > .lang-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: inherit;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.lang-switcher > .lang-toggle:hover,
.lang-switcher.open > .lang-toggle {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
    color: inherit;
    text-decoration: none;
}

.lang-switcher .fi {
    width: 1.25em;
    line-height: 1em;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.lang-switcher .lang-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    margin: 0;
    padding: 8px 0;
    list-style: none;
    background: #1a1a2e;
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    z-index: 10050;
}

.lang-switcher.open .lang-menu {
    display: block;
}

.lang-switcher .lang-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: #e2e8f0;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.lang-switcher .lang-menu li a:hover,
.lang-switcher .lang-menu li a.active {
    background: rgba(99, 102, 241, 0.2);
    color: #fff;
}

.lang-switcher .lang-menu li a.active {
    font-weight: 600;
}

.attr-nav > ul > li.lang-switcher {
    display: flex;
    align-items: center;
    margin-right: 4px;
}

@media (min-width: 992px) {
    .attr-nav > ul {
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
    }
}

/* Mobile: show in collapsed menu */
.navbar-collapse .lang-switcher-mobile {
    display: none;
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 12px;
}

.navbar-collapse .lang-switcher-mobile .lang-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.6;
    margin-bottom: 10px;
}

.lang-switcher-mobile .lang-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lang-switcher-mobile .lang-options a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.lang-switcher-mobile .lang-options a:hover,
.lang-switcher-mobile .lang-options a.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
    color: #fff;
}

@media (max-width: 991px) {
    .attr-nav .lang-switcher-desktop {
        display: none !important;
    }

    .navbar-collapse .lang-switcher-mobile {
        display: block;
    }

    .navbar-collapse .lang-switcher-mobile .lang-options {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 992px) {
    .navbar-collapse .lang-switcher-mobile {
        display: none !important;
    }
}

/* RTL (Arabic) */
html[dir="rtl"] body {
    text-align: right;
}

html[dir="rtl"] .navbar-nav {
    direction: rtl;
}

html[dir="rtl"] .lang-switcher .lang-menu {
    right: auto;
    left: 0;
}

html[dir="rtl"] .footer-bottom .text-end {
    text-align: left !important;
}

html[dir="rtl"] .footer-item-social.text-end {
    text-align: left !important;
}

html[dir="rtl"] .analytics-content {
    padding-right: 0 !important;
    padding-left: 50px;
}

@media (max-width: 991px) {
    html[dir="rtl"] .analytics-content {
        padding-left: 0 !important;
    }
}
