/* ===== GOOGLE TRANSLATE WP - FRONTEND STYLES ===== */

/* Reset dla Google Translate */
.skiptranslate,
#goog-gt-*,
.goog-te-banner-frame,
.goog-te-menu-value,
.goog-te-gadget,
.goog-te-combo {
    display: none !important;
}

body {
    top: 0px !important;
}

body.goog-te-hl-dir { 
    margin: 0 !important;
}

/* Główny widget */
#gtwp-translate-widget {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Pozycjonowanie - domyślne (bottom-left) */
#gtwp-translate-widget {
    bottom: 20px;
    left: 20px;
}

/* Pozycje dla desktop */
@media (min-width: 1025px) {
    #gtwp-translate-widget.gtwp-position-top-left {
        top: 20px;
        left: 20px;
        bottom: auto;
        right: auto;
    }
    
    #gtwp-translate-widget.gtwp-position-top-right {
        top: 20px;
        right: 20px;
        bottom: auto;
        left: auto;
    }
    
    #gtwp-translate-widget.gtwp-position-bottom-left {
        bottom: 20px;
        left: 20px;
        top: auto;
        right: auto;
    }
    
    #gtwp-translate-widget.gtwp-position-bottom-right {
        bottom: 20px;
        right: 20px;
        top: auto;
        left: auto;
    }
}

/* Pozycje dla tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    #gtwp-translate-widget {
        bottom: 15px;
        left: 15px;
    }
    
    #gtwp-translate-widget.gtwp-tablet-position-top-left {
        top: 15px;
        left: 15px;
        bottom: auto;
        right: auto;
    }
    
    #gtwp-translate-widget.gtwp-tablet-position-top-right {
        top: 15px;
        right: 15px;
        bottom: auto;
        left: auto;
    }
    
    #gtwp-translate-widget.gtwp-tablet-position-bottom-left {
        bottom: 15px;
        left: 15px;
        top: auto;
        right: auto;
    }
    
    #gtwp-translate-widget.gtwp-tablet-position-bottom-right {
        bottom: 15px;
        right: 15px;
        top: auto;
        left: auto;
    }
}

/* Pozycje dla mobile */
@media (max-width: 768px) {
    #gtwp-translate-widget {
        bottom: 10px;
        left: 10px;
    }
    
    #gtwp-translate-widget.gtwp-mobile-position-top-left {
        top: 10px;
        left: 10px;
        bottom: auto;
        right: auto;
    }
    
    #gtwp-translate-widget.gtwp-mobile-position-top-right {
        top: 10px;
        right: 10px;
        bottom: auto;
        left: auto;
    }
    
    #gtwp-translate-widget.gtwp-mobile-position-bottom-left {
        bottom: 10px;
        left: 10px;
        top: auto;
        right: auto;
    }
    
    #gtwp-translate-widget.gtwp-mobile-position-bottom-right {
        bottom: 10px;
        right: 10px;
        top: auto;
        left: auto;
    }
}

/* Przycisk tłumacza */
.gtwp-translate-button {
    width: 50px;
    height: 50px;
    background: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 2px solid rgba(255, 255, 255, 0.9);
    position: relative;
    overflow: hidden;
}

.gtwp-translate-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.gtwp-translate-button:active {
    transform: scale(0.95);
}

/* Ikona tłumacza */
.gtwp-translate-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.gtwp-translate-icon .fi {
    width: 28px;
    height: 21px;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.gtwp-translate-text {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    letter-spacing: 0.5px;
}

/* Rozmiary przycisków */
.gtwp-size-small .gtwp-translate-button {
    width: 40px;
    height: 40px;
}

.gtwp-size-small .gtwp-translate-icon .fi {
    width: 22px;
    height: 16px;
}

.gtwp-size-small .gtwp-translate-text {
    font-size: 10px;
}

.gtwp-size-large .gtwp-translate-button {
    width: 60px;
    height: 60px;
}

.gtwp-size-large .gtwp-translate-icon .fi {
    width: 34px;
    height: 25px;
}

.gtwp-size-large .gtwp-translate-text {
    font-size: 14px;
}

/* Lista języków */
.gtwp-language-list-wrap {
    position: absolute;
    bottom: 70px;
    left: 0;
    background: #ffffff;
    border-radius: 15px;
    padding: 5px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    min-width: 200px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    transform: translateY(10px) scale(0.9);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gtwp-language-list-wrap.show {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

.gtwp-language-list-wrap::-webkit-scrollbar {
    width: 6px;
}

.gtwp-language-list-wrap::-webkit-scrollbar-track {
    background: transparent;
}

.gtwp-language-list-wrap::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}


/* Pozycjonowanie listy w zależności od pozycji przycisku */
#gtwp-translate-widget.gtwp-position-top-left .gtwp-language-list-wrap,
#gtwp-translate-widget.gtwp-position-top-right .gtwp-language-list-wrap {
    top: 70px;
    bottom: auto;
}

#gtwp-translate-widget.gtwp-position-top-right .gtwp-language-list-wrap,
#gtwp-translate-widget.gtwp-position-bottom-right .gtwp-language-list-wrap {
    left: auto;
    right: 0;
}

.gtwp-language-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gtwp-language-item {
    margin: 0;
}

.gtwp-lang-select {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    text-decoration: none;
    color: #333;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.gtwp-lang-select::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.gtwp-lang-select:hover::before {
    left: 100%;
}

.gtwp-lang-select:not(:hover){
    color: #333 !important;
}

.gtwp-lang-select:hover {
    background: #f8f9fa;
    color: #0073aa;
}

.gtwp-lang-select .fi {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

/* Overlay zamykający */
.gtwp-overlay-close {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: transparent;
    cursor: default;
    display: none;
}

.gtwp-overlay-close.show {
    display: block;
}


/* Animacje ładowania */
@keyframes gtwpFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes gtwpPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

#gtwp-translate-widget {
    animation: gtwpFadeIn 0.6s ease-out;
}

.gtwp-translate-button.loading {
    animation: gtwpPulse 1.5s infinite;
}

/* Stan aktywny języka */
.gtwp-lang-select.active {
    background: #0073aa;
    color: #ffffff;
}

.gtwp-lang-select.active:hover {
    background: #005a87;
    color: #ffffff;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .gtwp-language-list-wrap {
        min-width: 180px;
        padding: 5px;
    }
    
    .gtwp-lang-select {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .gtwp-lang-select .fi {
        width: 18px;
        height: 13px;
    }
}

@media (max-width: 480px) {
    .gtwp-language-list-wrap {
        min-width: 160px;
        max-height: 250px;
    }
    
    .gtwp-lang-select {
        padding: 7px 10px;
        font-size: 12px;
        gap: 10px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .gtwp-translate-button {
        border: 3px solid #000;
        background: #fff;
    }
    
    .gtwp-language-list-wrap {
        border: 2px solid #000;
        background: #fff;
    }
    
    .gtwp-lang-select {
        border: 1px solid #ccc;
    }
    
    .gtwp-lang-select:hover {
        border-color: #000;
        background: #f0f0f0;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    #gtwp-translate-widget,
    .gtwp-translate-button,
    .gtwp-language-list-wrap,
    .gtwp-lang-select {
        transition: none;
        animation: none;
    }
}

/* Focus states for accessibility */
.gtwp-translate-button:focus,
.gtwp-lang-select:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .gtwp-translate-button {
        background: #2c3e50;
        border-color: #34495e;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
    
    .gtwp-language-list-wrap {
        background: #2c3e50;
        border-color: #34495e;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    }
    
    .gtwp-lang-select {
        color: #ecf0f1;
    }
    
    .gtwp-lang-select:hover {
        background: #34495e;
        color: #3498db;
    }
    
    .gtwp-translate-text {
        color: #ecf0f1;
    }
}