/* =============================================================================
   Magic Discreet Translator v3.0.0 — translator.css
   ============================================================================= */

#magic-translate-root,
#magic-translate-root * {
    box-sizing: border-box;
}

#google_translate_element {
    position: absolute !important;
    left: -99999px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.goog-te-gadget,
.skiptranslate.goog-te-gadget {
    font-size: 0 !important;
    color: transparent !important;
}

.goog-logo-link,
.goog-te-gadget span,
.goog-te-banner-frame.skiptranslate,
#goog-gt-tt,
.goog-text-highlight,
.goog-tooltip,
.goog-tooltip:hover,
.goog-te-balloon-frame {
    display: none !important;
    visibility: hidden !important;
}

body {
    top: 0 !important;
}

.goog-te-combo {
    display: block !important;
    min-width: 1px !important;
    min-height: 1px !important;
}

/* ── Trigger (botão flutuante) ─────────────────────────────────────────────── */
#magic-trigger {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 999998;
    background: rgba(20, 20, 20, 0.72);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border-radius: 12px 0 0 12px;
    padding: 11px 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transition: background 0.25s, padding 0.25s;
    box-shadow: -3px 0 14px rgba(0,0,0,0.28);
    border: none;
    outline: none;
    user-select: none;
    -webkit-user-select: none;
}

#magic-trigger:hover,
#magic-trigger:focus {
    background: rgba(10, 10, 10, 0.88);
    padding: 12px 9px;
    outline: none;
}

#magic-trigger .mt-flag {
    font-size: 24px;
    line-height: 1;
    display: block;
}

#magic-trigger .mt-arrow {
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-right: 5px solid rgba(255,255,255,0.55);
    display: block;
}

/* ── Overlay ───────────────────────────────────────────────────────────────── */
#magic-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.22);
    z-index: 999999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

#magic-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
}

/* ── Sidebar ───────────────────────────────────────────────────────────────── */
#magic-sidebar {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100%;
    background: #ffffff;
    z-index: 1000000;
    box-shadow: -5px 0 32px rgba(0,0,0,0.18);
    transition: right 0.38s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
}

#magic-sidebar.is-open {
    right: 0;
}

/* ── Barra de progresso ────────────────────────────────────────────────────── */
#magic-progress-bar {
    height: 3px;
    background: #e8e8e8;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

#magic-progress-bar.is-loading::after {
    content: '';
    position: absolute;
    left: -45%;
    top: 0;
    width: 45%;
    height: 100%;
    background: #1a73e8;
    animation: magic-slide 1s ease infinite;
}

@keyframes magic-slide {
    0% { left: -45%; }
    100% { left: 105%; }
}

/* ── Header ────────────────────────────────────────────────────────────────── */
.ms-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 16px 12px;
    border-bottom: 1px solid #efefef;
    flex-shrink: 0;
}

.ms-title {
    font-size: 12px;
    font-weight: 700;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.ms-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 22px;
    color: #bbb;
    line-height: 1;
    padding: 2px 5px;
    border-radius: 5px;
    transition: color 0.2s, background 0.2s;
}

.ms-close:hover {
    color: #333;
    background: #f2f2f2;
}

/* ── Grid de idiomas ───────────────────────────────────────────────────────── */
.ms-grid {
    flex: 1;
    overflow-y: auto;
    padding: 12px 10px 16px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    align-content: start;
}

.ms-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-height: 88px;
    padding: 12px 8px 10px;
    background: #f7f7f7;
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    font-family: inherit;
    outline: none;
}

.ms-btn:hover,
.ms-btn:focus {
    background: #eef2ff;
    border-color: #c3d2ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.09);
    outline: none;
}

.ms-btn.is-active {
    background: #1a73e8;
    border-color: #1558b0;
}

.ms-btn .ms-flag {
    font-size: 29px;
    line-height: 1;
    display: block;
}

.ms-btn .ms-code {
    font-size: 12px;
    font-weight: 700;
    color: #666;
    text-align: center;
    line-height: 1.2;
    display: block;
}

.ms-btn.is-active .ms-code {
    color: rgba(255,255,255,0.92);
}

/* ── Barra de status ───────────────────────────────────────────────────────── */
#magic-status {
    padding: 10px 14px;
    font-size: 11px;
    color: #999;
    border-top: 1px solid #f2f2f2;
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
}

#magic-status.is-loading {
    color: #1a73e8;
}

#magic-status.is-error {
    color: #d93025;
}

.magic-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid #c8dcff;
    border-top-color: #1a73e8;
    border-radius: 50%;
    animation: magic-spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes magic-spin {
    to { transform: rotate(360deg); }
}
