/**
 * AI Translate — Language Switcher Styles
 * AI Translate Pro language switcher styles
 */

/* ── Shared ── */
.atp-sw-item {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px; text-decoration: none !important;
    color: #333; font-size: 14px; line-height: 1.4;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap; border-radius: 20px;
}
.atp-sw-item:hover { color: #111; background: rgba(0,0,0,0.06); text-decoration: none !important; }
.atp-sw-active { font-weight: 600; background: rgba(0,0,0,0.08); }
.atp-sw-flag { display: inline-flex; align-items: center; flex-shrink: 0; line-height: 0; }
.atp-sw-flag svg { display: block; }
.atp-sw-label { font-size: 14px; }

/* ── Inline ── */
.atp-sw-inline {
    display: inline-flex; flex-wrap: wrap; gap: 2px;
    align-items: center;
    background: #fff; border-radius: 28px;
    padding: 4px 6px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}

/* ── Dropdown ── */
.atp-sw-dropdown {
    position: relative; display: inline-block;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.atp-sw-trigger {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 0; margin: 0;
    background: #fff; border: 1px solid #ddd; border-radius: 24px;
    cursor: pointer; font: inherit; color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.atp-sw-trigger:hover { border-color: #aaa; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.atp-sw-trigger .atp-sw-item { padding: 7px 8px 7px 12px; }
.atp-sw-arrow { font-size: 10px; color: #888; padding-right: 10px; transition: transform 0.2s; }
.atp-sw-dropdown.open .atp-sw-arrow { transform: rotate(180deg); }
.atp-sw-panel {
    display: none; position: absolute; top: 100%; left: 0;
    margin-top: 4px; min-width: 100%;
    background: #fff; border: 1px solid #ddd; border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    z-index: 99999; overflow: hidden; padding: 4px;
}
.atp-sw-dropdown.open .atp-sw-panel { display: block; }
.atp-sw-panel .atp-sw-item { display: flex; padding: 8px 14px; border-radius: 8px; }
.atp-sw-panel .atp-sw-item:hover { background: #f5f7fa; }
.atp-sw-panel .atp-sw-active { background: rgba(0,0,0,0.06); }

/* ── Popup / Modal (centered, large flags) ── */
.atp-sw-popup-wrap { display: inline-block; }
.atp-sw-popup-trigger {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 16px; margin: 0;
    background: #fff; border: 1px solid #ddd; border-radius: 24px;
    cursor: pointer; font: inherit; font-size: 14px; color: #333;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.atp-sw-popup-trigger:hover { border-color: #aaa; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

/* Overlay: centered */
.atp-sw-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 999999;
    justify-content: center; align-items: center;
}
.atp-sw-overlay.open { display: flex; animation: atpFadeIn 0.15s ease; }

/* Modal card: 4 per row grid */
.atp-sw-bar {
    display: grid; grid-template-columns: repeat(4, 1fr);
    background: #fff; border-radius: 20px;
    padding: 28px 28px 20px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.2);
    gap: 4px;
    max-width: 580px; width: 90vw;
    animation: atpScaleIn 0.2s ease;
    position: relative;
}
.atp-sw-bar .atp-sw-item {
    padding: 12px 16px; border-radius: 12px;
    font-size: 16px; gap: 10px;
    justify-content: flex-start;
}
.atp-sw-bar .atp-sw-item:hover { background: #f3f4f6; }
.atp-sw-bar .atp-sw-active {
    background: #FEF3C7; color: #92400E; font-weight: 700;
}
.atp-sw-bar .atp-sw-flag { font-size: 22px; }
.atp-sw-bar .atp-sw-flag svg { width: 26px; height: 26px; }
.atp-sw-bar .atp-sw-label { font-size: 15px; }
.atp-sw-bar-close {
    position: absolute; top: 8px; right: 8px;
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; margin: 0; padding: 0;
    background: none; border: none; cursor: pointer;
    font-size: 22px; color: #aaa; border-radius: 50%;
    transition: background 0.15s, color 0.15s;
}
.atp-sw-bar-close:hover { background: #f0f0f0; color: #333; }

/* ── Globe trigger (floating) ── */
.atp-sw-globe-trigger {
    display: flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; margin: 0; padding: 0;
    background: #fff; border: none; border-radius: 50%;
    cursor: pointer; font-size: 24px; line-height: 1;
    box-shadow: 0 3px 14px rgba(0,0,0,0.15);
    transition: transform 0.2s, box-shadow 0.2s;
}
.atp-sw-globe-trigger:hover { transform: scale(1.08); box-shadow: 0 5px 22px rgba(0,0,0,0.2); }

/* ── Floating ── */
.atp-sw-floating { position: fixed; z-index: 99998; }
.atp-sw-floating-bottom-right { bottom: 20px; right: 20px; }
.atp-sw-floating-bottom-left  { bottom: 20px; left: 20px; }
.atp-sw-floating-top-right    { top: 20px; right: 20px; }
.atp-sw-floating-top-left     { top: 20px; left: 20px; }
.atp-sw-floating .atp-sw-trigger { background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,0.12); border-color: #e0e0e0; }
.atp-sw-floating .atp-sw-trigger:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.16); }
.atp-sw-floating-bottom-right .atp-sw-panel,
.atp-sw-floating-bottom-left .atp-sw-panel { top: auto; bottom: 100%; margin-top: 0; margin-bottom: 4px; }
.atp-sw-floating-bottom-right .atp-sw-panel,
.atp-sw-floating-top-right .atp-sw-panel { left: auto; right: 0; }

/* ── Animations ── */
@keyframes atpFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes atpScaleIn { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }
@keyframes atpSlideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* ── Responsive ── */
@media (max-width: 600px) {
    .atp-sw-floating { bottom: 12px !important; right: 12px !important; left: auto !important; }
    .atp-sw-bar { grid-template-columns: repeat(2, 1fr); padding: 24px 16px 16px; border-radius: 16px; max-width: 95vw; }
    .atp-sw-bar .atp-sw-item { padding: 10px 12px; font-size: 15px; }
}

/* ── Menu Integration ── */
.atp-menu-switcher { display: flex; align-items: center; }
.atp-menu-switcher .atp-sw-dropdown { position: relative; }
.atp-menu-switcher .atp-sw-trigger { border: none; background: none; cursor: pointer; padding: 4px 8px; font-size: inherit; font-family: inherit; }
.atp-menu-switcher .atp-sw-panel { position: absolute; top: 100%; right: 0; min-width: 160px; z-index: 99999; }
/* Block theme (FSE) nav alignment */
.wp-block-navigation .atp-menu-switcher { margin-left: 8px; }
.wp-block-navigation .atp-menu-switcher .atp-sw-trigger { color: inherit; }
