/**
 * Terpa - Google Translate gizleme & özel dil seçici
 * NOT: Çeviri iframe'i gizlenmez — sadece üst banner ve gadget UI saklanır.
 */

/* Gizli widget — display:none ve opacity:0 çeviri motorunu bozar; ekran dışına al */
#google_translate_element,
.terpa-gt-gizli {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
    z-index: 0 !important;
}

#google_translate_element select.goog-te-combo,
.goog-te-combo {
    visibility: visible !important;
    opacity: 1 !important;
}

/* Google üst banner — gizle */
.goog-te-banner-frame,
iframe.goog-te-banner-frame,
.goog-te-gadget-icon,
div#goog-gt-tt,
.goog-te-balloon-frame,
.goog-logo-link,
.goog-te-spinner-pos,
.VIpgJd-ZVi9od-ORHb-OEVmcd {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Sayfa yukarı kaymasını engelle */
body {
    top: 0 !important;
    position: static !important;
}

.goog-text-highlight {
    background: none !important;
    box-shadow: none !important;
}

/* Özel Dil Seçici */
.terpa-dil-secici {
    position: relative;
    z-index: 1050;
}

.terpa-dil-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: var(--terpa-amber, #F59E0B);
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.terpa-dil-toggle:hover {
    background: rgba(245, 158, 11, 0.2);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.25);
}

.terpa-dil-ok {
    font-size: 0.6rem;
    transition: transform 0.3s;
}

.terpa-dil-secici.acik .terpa-dil-ok {
    transform: rotate(180deg);
}

.terpa-dil-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 14px;
    padding: 0.5rem;
    margin: 0;
    list-style: none;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.3s ease;
}

.terpa-dil-secici.acik .terpa-dil-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.terpa-dil-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: var(--terpa-text, #F8FAFC);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.terpa-dil-item:hover {
    background: rgba(245, 158, 11, 0.12);
}

.terpa-dil-item.aktif {
    background: rgba(245, 158, 11, 0.18);
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.terpa-dil-bayrak {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.terpa-dil-bayrak-img,
.terpa-dil-bayrak-aktif {
    width: 22px;
    height: 16px;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.terpa-dil-bayrak-aktif {
    flex-shrink: 0;
}

.terpa-dil-metin {
    flex: 1;
    font-size: 0.9rem;
}

.terpa-dil-kod {
    font-size: 0.7rem;
    color: var(--terpa-muted, #94A3B8);
    font-weight: 600;
}

.terpa-dil-topbar .terpa-dil-toggle {
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
}

.terpa-dil-navbar {
    margin-right: 0.5rem;
}

/* RTL (Arapça / Suriye) düzen desteği */
html[dir="rtl"] body.terpa-rtl .navbar-nav {
    margin-right: auto !important;
    margin-left: auto !important;
}

html[dir="rtl"] body.terpa-rtl .text-start {
    text-align: right !important;
}

html[dir="rtl"] body.terpa-rtl .me-1, html[dir="rtl"] body.terpa-rtl .me-2 {
    margin-right: 0 !important;
}

html[dir="rtl"] body.terpa-rtl .ms-4 {
    margin-left: 0 !important;
    margin-right: 1.5rem !important;
}

html[dir="rtl"] .terpa-dil-menu {
    right: auto;
    left: 0;
}

@media (max-width: 991px) {
    .terpa-dil-navbar {
        padding: 0.75rem 0;
        margin-right: 0;
    }
    .terpa-dil-navbar .terpa-dil-menu {
        right: auto;
        left: 0;
    }
}
