:root {
    --c-apple-bg: rgba(255, 255, 255, 0.95);
    --c-apple-bg-hover: #ffffff;
    --c-apple-border: rgba(0, 0, 0, 0.12);
    --c-apple-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    --c-apple-radius: 14px;
    --c-apple-text: #1d1d1f;
}

.c-translate-container {
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: inline-block;
    min-width: 100%;
    z-index: 999 !important;
}

.c-translate-container.open {
    z-index: 9999 !important;
}

.c-translate-widget-open,
.widget:has(.c-translate-container.open),
.widget_c_translate_widget:has(.c-translate-container.open) {
    z-index: 9999 !important;
    overflow: visible !important;
    position: relative !important;
}

.c-translate-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #ffffff;
    border: 1px solid var(--c-apple-border);
    border-radius: var(--c-apple-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.c-translate-trigger:hover {
    background: var(--c-apple-bg-hover);
    transform: translateY(-1px);
}

.c-translate-current {
    display: flex;
    align-items: center;
    gap: 10px;
}

.c-flag {
    width: 22px;
    height: 16px;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.c-lang-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--c-apple-text);
}

.c-translate-chevron {
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.c-translate-container.open .c-translate-chevron {
    transform: rotate(180deg);
}

.c-translate-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
    border-radius: var(--c-apple-radius);
    box-shadow: var(--c-apple-shadow) !important;
    display: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    max-height: 280px;
    overflow-y: auto !important;
    z-index: 99999 !important;
}

.c-translate-container.open .c-translate-dropdown {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
}

.c-translate-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
    color: #1d1d1f !important;
}

.c-translate-option:hover {
    background: rgba(0, 0, 0, 0.05) !important;
}

.c-translate-option.active {
    background: rgba(0, 113, 227, 0.1) !important;
    color: #0071e3 !important;
}

/* Hide Google Translate default UI */
.goog-te-banner-frame,
.goog-te-balloon-frame,
#goog-gt-tt,
.goog-te-balloon-frame-main,
iframe.skiptranslate {
    display: none !important;
}

.goog-te-menu-value {
    display: none !important;
}

body {
    top: 0 !important;
}