/**
 * Onimaru AI Translate — Styles
 *
 * Estilos para o seletor de idiomas (dropdown, flags, buttons),
 * widget flutuante, e animação de tradução (shimmer).
 *
 * @version 1.0.0
 */

/* ==========================================================================
   CSS Variables
   ========================================================================== */

:root {
    --oat-bg: #1a1a2e;
    --oat-bg-hover: #16213e;
    --oat-text: #ffffff;
    --oat-text-muted: #a0a0b0;
    --oat-accent: #e94560;
    --oat-accent-soft: rgba(233, 69, 96, 0.15);
    --oat-border: rgba(255, 255, 255, 0.08);
    --oat-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --oat-radius: 12px;
    --oat-radius-sm: 8px;
    --oat-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --oat-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ==========================================================================
   Switcher — Base
   ========================================================================== */

.oat-switcher {
    font-family: var(--oat-font);
    position: relative;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    background: var(--oat-bg);
    border-radius: var(--oat-radius);
    padding: 6px;
    border: 1px solid var(--oat-border);
    box-shadow: var(--oat-shadow);
    color: var(--oat-text);
    line-height: 1.4;
    user-select: none;
    -webkit-user-select: none;
}

/* ==========================================================================
   Switcher — Dropdown Style
   ========================================================================== */

.oat-switcher--dropdown {
    flex-direction: column;
    gap: 0;
    padding: 0;
}

.oat-switcher__trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: none;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    white-space: nowrap;
    transition: background var(--oat-transition);
    border-radius: var(--oat-radius);
    width: 100%;
}

.oat-switcher__trigger:hover {
    background: var(--oat-bg-hover);
}

.oat-switcher__flag {
    font-size: 20px;
    line-height: 1;
}

.oat-switcher__name {
    flex: 1;
    text-align: left;
    font-weight: 500;
}

.oat-switcher__chevron {
    transition: transform var(--oat-transition);
    opacity: 0.6;
}

.oat-switcher__trigger[aria-expanded="true"] .oat-switcher__chevron {
    transform: rotate(180deg);
}

/* Dropdown Menu */

.oat-switcher__menu {
    display: none;
    flex-direction: column;
    width: 100%;
    border-top: 1px solid var(--oat-border);
    padding: 4px;
    gap: 2px;
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--oat-accent) transparent;
}

.oat-switcher__menu--open {
    display: flex;
    animation: oatSlideDown 0.2s ease-out;
}

@keyframes oatSlideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.oat-switcher__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    border-radius: var(--oat-radius-sm);
    transition: background var(--oat-transition);
    white-space: nowrap;
}

.oat-switcher__item:hover {
    background: var(--oat-bg-hover);
}

.oat-switcher__item--active {
    background: var(--oat-accent-soft) !important;
    color: var(--oat-accent);
    font-weight: 600;
}

.oat-switcher__item--active::after {
    content: '✓';
    margin-left: auto;
    font-size: 12px;
    opacity: 0.8;
}

/* ==========================================================================
   Switcher — Flags Style
   ========================================================================== */

.oat-switcher--flags {
    gap: 4px;
    padding: 6px 8px;
}

.oat-switcher__flag-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 36px;
    border: 2px solid transparent;
    background: transparent;
    border-radius: var(--oat-radius-sm);
    cursor: pointer;
    font-size: 22px;
    transition: all var(--oat-transition);
}

.oat-switcher__flag-btn:hover {
    background: var(--oat-bg-hover);
    transform: scale(1.1);
}

.oat-switcher__flag-btn--active {
    border-color: var(--oat-accent);
    background: var(--oat-accent-soft);
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.2);
    transform: scale(1.05);
}

/* ==========================================================================
   Switcher — Buttons Style
   ========================================================================== */

.oat-switcher--buttons {
    gap: 4px;
    padding: 6px;
}

.oat-switcher__btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: 1px solid var(--oat-border);
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    border-radius: 20px;
    transition: all var(--oat-transition);
    white-space: nowrap;
}

.oat-switcher__btn:hover {
    background: var(--oat-bg-hover);
    border-color: var(--oat-accent);
}

.oat-switcher__btn--active {
    background: var(--oat-accent) !important;
    border-color: var(--oat-accent) !important;
    color: #fff !important;
    font-weight: 600;
}

/* ==========================================================================
   Widget Label (Elementor)
   ========================================================================== */

.oat-widget-label {
    font-family: var(--oat-font);
    font-size: 14px;
    font-weight: 600;
    color: var(--oat-text-muted);
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

/* ==========================================================================
   Floating Widget
   ========================================================================== */

.oat-floating {
    position: fixed;
    z-index: 999999;
    transition: transform var(--oat-transition);
}

.oat-floating--bottom-right {
    bottom: 80px;
    right: 20px;
}

.oat-floating--bottom-left {
    bottom: 80px;
    left: 20px;
}

.oat-floating--top-right {
    top: 20px;
    right: 20px;
}

.oat-floating--top-left {
    top: 20px;
    left: 20px;
}

/* Floating status badge */

.oat-floating__status {
    display: none;
    margin-top: 6px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 11px;
    font-family: var(--oat-font);
    border-radius: 20px;
    text-align: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: oatFadeIn 0.3s ease-out;
}

@keyframes oatFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Translation Loading Shimmer
   ========================================================================== */

.oat-translating {
    position: relative;
    overflow: hidden;
}

.oat-translating::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(233, 69, 96, 0.08) 30%,
            rgba(233, 69, 96, 0.15) 50%,
            rgba(233, 69, 96, 0.08) 70%,
            transparent 100%);
    background-size: 200% 100%;
    animation: oatShimmer 1.5s infinite ease-in-out;
    border-radius: 4px;
    pointer-events: none;
}

@keyframes oatShimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {

    .oat-floating--bottom-right,
    .oat-floating--bottom-left {
        bottom: 70px;
    }

    .oat-floating--bottom-right {
        right: 12px;
    }

    .oat-floating--bottom-left {
        left: 12px;
    }

    .oat-floating--top-right,
    .oat-floating--top-left {
        top: 12px;
    }

    .oat-switcher__trigger {
        padding: 8px 10px;
        font-size: 13px;
    }

    .oat-switcher__flag {
        font-size: 18px;
    }

    .oat-switcher__flag-btn {
        width: 34px;
        height: 32px;
        font-size: 18px;
    }

    .oat-switcher__btn {
        padding: 5px 10px;
        font-size: 12px;
    }
}

/* ==========================================================================
   Dark Mode Override for Light Sites
   ========================================================================== */

@media (prefers-color-scheme: light) {
    .oat-floating .oat-switcher {
        /* Floating widget stays dark for contrast */
        --oat-bg: #1a1a2e;
        --oat-bg-hover: #16213e;
        --oat-text: #ffffff;
    }
}

/* ==========================================================================
   Scrollbar for dropdown
   ========================================================================== */

.oat-switcher__menu::-webkit-scrollbar {
    width: 4px;
}

.oat-switcher__menu::-webkit-scrollbar-track {
    background: transparent;
}

.oat-switcher__menu::-webkit-scrollbar-thumb {
    background: var(--oat-accent);
    border-radius: 10px;
}