/* WooCommerce Auto Translate - Frontend Styles */

/* Language Switcher */
.wat-language-switcher {
    display: inline-block;
    margin: 10px 0;
}

.wat-language-switcher.wat-dropdown .wat-language-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
    min-width: 120px;
}

.wat-language-switcher.wat-dropdown .wat-language-select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.wat-language-switcher.wat-buttons {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.wat-language-button {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.wat-language-button:hover {
    background: #f5f5f5;
    border-color: #0073aa;
    text-decoration: none;
}

.wat-language-button.active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.wat-language-button.active:hover {
    background: #005a87;
}

/* Language switching states */
.wat-language-switching {
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.wat-switching {
    opacity: 0.7;
    position: relative;
    pointer-events: none;
}

.wat-switching::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #0073aa;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: wat-spin 1s linear infinite;
    z-index: 1;
}

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

/* Notification styles */
.wat-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 16px;
    border-radius: 4px;
    color: #fff;
    font-weight: bold;
    z-index: 10000;
    animation: wat-slide-in 0.3s ease-out;
}

.wat-notification.wat-error {
    background: #dc3545;
}

.wat-notification.wat-success {
    background: #28a745;
}

@keyframes wat-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Widget styles */
.widget_wat_language_switcher {
    margin-bottom: 20px;
}

.widget_wat_language_switcher .widget-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
}

/* Header language switcher */
.header-language-switcher {
    position: relative;
    z-index: 999;
}

.header-language-switcher .wat-language-switcher {
    margin: 0;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .wat-language-switcher.wat-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .wat-language-button {
        width: 100%;
        justify-content: center;
        margin-bottom: 5px;
    }
    
    .wat-language-switcher.wat-dropdown .wat-language-select {
        width: 100%;
    }
}

/* Accessibility improvements */
.wat-language-switcher [role="button"] {
    cursor: pointer;
}

.wat-language-switcher [aria-current="page"] {
    font-weight: bold;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .wat-language-button {
        border-width: 2px;
        font-weight: bold;
    }
    
    .wat-language-button.active {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .wat-language-button {
        transition: none;
    }
    
    .wat-translation-loading {
        opacity: 1;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .wat-language-switcher.wat-dropdown .wat-language-select {
        background: #2c2c2c;
        border-color: #555;
        color: #fff;
    }
    
    .wat-language-button {
        background: #2c2c2c;
        border-color: #555;
        color: #fff;
    }
    
    .wat-language-button:hover {
        background: #3c3c3c;
        border-color: #0073aa;
    }
    
    .wat-language-button.active {
        background: #0073aa;
        color: #fff;
    }
}

/* Print styles */
@media print {
    .wat-language-switcher {
        display: none;
    }
}

/* Loading animation */
@keyframes wat-fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wat-language-switcher {
    animation: wat-fade-in 0.3s ease-out;
}

/* Tooltip styles */
.wat-tooltip {
    position: absolute;
    z-index: 1000;
    padding: 8px 12px;
    background: #333;
    color: #fff;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
}

.wat-tooltip::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border: 5px solid transparent;
    border-top-color: #333;
}

/* Custom styling for different themes */
.theme-twentytwentythree .wat-language-switcher {
    font-family: inherit;
}

.theme-storefront .wat-language-switcher {
    margin: 0.5em 0;
}

/* WooCommerce specific styling */
.woocommerce .wat-language-switcher {
    margin-bottom: 1em;
}

.woocommerce-page .wat-language-switcher {
    float: right;
    margin: 0 0 1em 1em;
}

/* Shop page styling */
.woocommerce-shop .wat-language-switcher {
    margin-bottom: 2em;
    text-align: right;
}

/* Product page styling */
.single-product .wat-language-switcher {
    margin-bottom: 1em;
}

/* Cart and checkout styling */
.woocommerce-cart .wat-language-switcher,
.woocommerce-checkout .wat-language-switcher {
    margin-bottom: 1.5em;
    padding: 1em;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    background: #f9f9f9;
}

/* My Account styling */
.woocommerce-account .wat-language-switcher {
    margin-bottom: 2em;
}

/* Category page styling */
.tax-product_cat .wat-language-switcher {
    margin-bottom: 1.5em;
    text-align: center;
} 