/* G2Trans - Direct Tailwind CSS Classes */

/* Base Switcher - Tailwind CSS */
/* This rule targets the container div */
.g2trans-language-switcher,
.g2trans-currency-switcher {
    display: inline-block;
    position: relative;
}

/* Combined and updated style for language and currency dropdowns */
.g2trans-language-select,
.g2trans-currency-select {
    background-color: white;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    padding-right: 2rem; /* For the arrow */
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: #000000;
    cursor: pointer;
    transition-property: color, background-color, border-color;
    transition-duration: 200ms;
    width: 11rem; /* Explicit width for consistency */
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path fill="%23666" d="M6 8L0 2h12z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.g2trans-language-select:hover,
.g2trans-currency-select:hover {
    border-color: #9ca3af;
}

.g2trans-language-select:focus,
.g2trans-currency-select:focus {
    outline: none;
    border-color: #10b981; /* Green focus */
    box-shadow: 0 0 0 1px #10b981;
}

/* Flag styling within options */
.g2trans-flag {
    display: inline-block;
    margin-right: 0.5rem;
}

/* Widget Area - Tailwind CSS */
/* This rule targets the container div in a widget */
.widget .g2trans-language-switcher,
.widget .g2trans-currency-switcher {
    width: 100%;
}

.widget .g2trans-language-select,
.widget .g2trans-currency-select {
    width: 100%;
}

/* Responsive - Tailwind CSS */
@media (max-width: 768px) {
    .g2trans-language-select,
    .g2trans-currency-select {
        font-size: 0.75rem;
        line-height: 1rem;
        padding: 0.25rem 0.5rem;
        min-width: 8rem;
    }
}

@media (max-width: 480px) {
    .g2trans-language-select,
    .g2trans-currency-select {
        font-size: 0.75rem;
        line-height: 1rem;
        padding: 0.25rem 0.5rem;
        min-width: 7rem;
    }
}

/* Dark Theme - Tailwind CSS */
@media (prefers-color-scheme: dark) {
    .g2trans-language-select,
    .g2trans-currency-select {
        background-color: #1f2937;
        border-color: #4b5563;
        color: #000000 !important;
        background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path fill="%23e5e7eb" d="M6 8L0 2h12z"/></svg>');
    }
    
    .g2trans-language-select option,
    .g2trans-currency-select option {
        color: #000000 !important;
        background-color: white !important;
    }
    
    .g2trans-language-select:hover,
    .g2trans-currency-select:hover {
        border-color: #6b7280;
    }
}

/* Hide ALL Google Translate Elements */
#google_translate_element,
.goog-te-banner-frame,
.goog-tooltip,
.goog-te-menu-frame,
.skiptranslate,
[id*=":1.container"],
[id*="google_translate"],
[class*="goog-te"],
.VIpgJd-ZVi9od-l4eHX-hSRGPd,
.VIpgJd-ZVi9od-ORHb-OEVmcd,
.VIpgJd-yAWNEb-VIpgJd-fmcmS-sn54Q,
[class*="VIpgJd-yAWNEb"],
[class*="VIpgJd-fmcmS"],
font[class*="VIpgJd"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    z-index: -1 !important;
}

/* Specific Google Translate container hiding */
div[id*=":1.container"],
div[id*=":0.container"],
*[id^=":1.container"],
*[id$=":1.container"],
*[id*=":1.container"],
[role="button"][id*="google_translate"],
.goog-te-combo,
.goog-te-gadget,
.goog-te-gadget-simple,
.goog-te-gadget-icon {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: fixed !important;
    left: -10000px !important;
    top: -10000px !important;
    width: 0 !important;
    height: 0 !important;
    z-index: -9999 !important;
    pointer-events: none !important;
}

/* Ultra-specific targeting for Google Translate bar */
[id=":1.container"],
[id=":0.container"],
[id*=":1.container"],
[id*=":0.container"],
div[id=":1.container"],
div[id=":0.container"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -99999px !important;
    top: -99999px !important;
    width: 0 !important;
    height: 0 !important;
    max-width: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    z-index: -99999 !important;
    pointer-events: none !important;
    user-select: none !important;
}

/* Force hide Google Translate menu */
.goog-te-menu-frame {
    z-index: -1 !important;
    display: none !important;
}

/* Override Google Translate body modifications */
body {
    top: 0 !important;
}

.goog-text-highlight {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Protection Class */
.notranslate {
    font-family: inherit !important;
}

/* Hide Google Translate Loading Spinner - Using Element Pattern (SVG + Circle) */
/* ULTRA-AGGRESSIVE APPROACH - Multiple layers of hiding */

/* Hide by SVG attributes */
svg[width="96px"][height="96px"],
svg[viewBox="0 0 66 66"],
svg[xmlns="http://www.w3.org/2000/svg"][width="96px"],
div > div > svg[xmlns="http://www.w3.org/2000/svg"][width="96px"][height="96px"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -99999px !important;
    top: -99999px !important;
    width: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
}

/* Hide by circle attributes */
circle[cx="33"][cy="33"][r="30"],
circle[fill="none"][stroke-width="6"],
svg circle[cx="33"],
div > div > svg circle[fill="none"][stroke-width][stroke-linecap="round"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Hide parent containers - multiple levels */
div:has(> svg[width="96px"]),
div:has(> div > svg[width="96px"]),
div:has(svg[viewBox="0 0 66 66"]),
div:has(circle[cx="33"][cy="33"]),
div:has(> div > svg[xmlns="http://www.w3.org/2000/svg"] > circle[cx="33"][cy="33"]) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -99999px !important;
    top: -99999px !important;
    width: 0 !important;
    height: 0 !important;
    max-width: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
    z-index: -99999 !important;
}

/* Hide ONLY the Google Translate loading spinner (96px SVG) */
/* DO NOT hide all VIpgJd elements as they are needed for translation */

/* Target the 96px loading spinner SVG specifically */
svg.VIpgJd-ZVi9od-aZ2wEe[width="96px"][height="96px"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Target the spinner circle */
circle.VIpgJd-ZVi9od-aZ2wEe-Jt5cK[cx="33"][cy="33"][r="30"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Target spinner container divs ONLY if they contain 96px SVG */
div.VIpgJd-ZVi9od-aZ2wEe-wOHMyf:has(svg[width="96px"]),
div.VIpgJd-ZVi9od-aZ2wEe-OiiCO:has(svg[width="96px"]) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -99999px !important;
    top: -99999px !important;
}

/* Print Styles */
@media print {
    /* This rule targets the container div for print */
    .g2trans-language-switcher,
    .g2trans-currency-switcher {
        display: none;
    }
}

/* Fallback styles for non-Tailwind environments */
@supports not (display: grid) {
    .g2trans-language-select,
    .g2trans-currency-select {
        background: #fff;
        border: 1px solid #d1d5db;
        border-radius: 6px;
        padding: 8px 12px;
        font-size: 14px;
        color: #374151;
        cursor: pointer;
        transition: border-color 0.2s;
        width: 11rem; /* Ensure consistency with above explicit width */
        appearance: none;
    }
    
    .g2trans-language-select:hover,
    .g2trans-currency-select:hover {
        border-color: #9ca3af;
    }
    
    .g2trans-language-select:focus,
    .g2trans-currency-select:focus {
        outline: none;
        border-color: #10b981; /* Matched green focus */
        box-shadow: 0 0 0 1px #10b981;
    }
}

/* G2Trans Switcher Styles */
/* These rules target the <select> elements directly, not the containers */
.g2trans-language-switcher select,
.g2trans-currency-switcher select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.g2trans-language-switcher select:hover,
.g2trans-currency-switcher select:hover {
    border-color: #999;
}

.g2trans-language-switcher select:focus,
.g2trans-currency-switcher select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

/* Disabled state during loading */
.g2trans-language-switcher select:disabled,
.g2trans-currency-switcher select:disabled {
    opacity: 0.6;
    cursor: wait;
    background-color: #f5f5f5;
}

/* Loading animation */
.g2trans-language-switcher select:disabled::after,
.g2trans-currency-switcher select:disabled::after {
    content: '...';
    animation: loading 1s infinite;
}

@keyframes loading {
    0% { content: '.'; }
    33% { content: '..'; }
    66% { content: '...'; }
}

/* Ensure dropdowns are visible */
.g2trans-language-switcher,
.g2trans-currency-switcher {
    display: inline-block;
    margin: 0 5px;
}

/* Price update animation */
.g2trans-price,
.woocommerce-Price-amount,
.price {
    transition: color 0.3s ease;
}

.g2trans-price.updating,
.woocommerce-Price-amount.updating,
.price.updating {
    color: #999;
}

/* Responsive styles */
/* These target the select elements directly */
@media (max-width: 768px) {
    .g2trans-language-switcher select,
    .g2trans-currency-switcher select {
        font-size: 12px;
        padding: 6px 10px;
    }
}

/* Loading state for dropdowns */
.g2trans-language-select.g2trans-loading,
.g2trans-currency-select.g2trans-loading {
    background-color: #f3f4f6;
    position: relative;
    pointer-events: none;
    background-image: none;
}

.g2trans-language-select.g2trans-loading::after,
.g2trans-currency-select.g2trans-loading::after {
    content: "";
    position: absolute;
    right: 10px;
    top: 50%;
    width: 14px;
    height: 14px;
    margin-top: -7px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    border-top-color: #3b82f6;
    animation: g2trans-spin 0.8s linear infinite;
}

@keyframes g2trans-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Ensure dropdown options are also black */
.g2trans-language-select option,
.g2trans-currency-select option {
    color: #000000;
    background-color: white;
} 