/**
 * Hybrid Translator Pro — Stili Frontend
 *
 * Stile per:
 * - Shortcode [htl_switcher] inline
 * - Floating language switcher (widget fisso in basso a destra)
 *
 * @package Hybrid_Translator_Pro
 */

/* === Language Switcher (Shortcode) === */

.htl-switcher {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    font-size: 1.3em;
    line-height: 1;
}

.htl-switcher a.htl-lang {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    font-size: 1.2em;
}

.htl-switcher a.htl-lang:hover {
    background-color: #e9ecef;
    transform: scale(1.15);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.htl-switcher a.htl-lang.active {
    background-color: #d4edda;
    box-shadow: 0 0 0 2px #28a745;
    cursor: default;
    pointer-events: none;
}

/* === Floating Language Switcher (Google Translate style) === */

.htl-floating {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Bottone toggle (globo/bandierina) */
.htl-floating-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: #1a73e8;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    font-size: 24px;
    line-height: 1;
}

.htl-floating-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), 0 3px 6px rgba(0, 0, 0, 0.12);
    background: #1557b0;
}

.htl-floating-toggle:active {
    transform: scale(0.96);
}

.htl-floating-icon {
    font-size: 24px;
}

/* Pannello lingue (nascosto di default) */
.htl-floating-panel {
    position: absolute;
    bottom: 68px;
    right: 0;
    min-width: 170px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    padding: 8px 0;
}

/* Pannello aperto */
.htl-floating.htl-open .htl-floating-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Rotazione bottone quando aperto */
.htl-floating.htl-open .htl-floating-toggle {
    background: #333;
}

/* Link lingua nel pannello */
.htl-floating-lang {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    text-decoration: none !important;
    color: #333 !important;
    font-size: 15px;
    font-weight: 500;
    transition: background-color 0.15s ease;
    white-space: nowrap;
}

.htl-floating-lang:hover {
    background-color: #f0f4ff;
    color: #1a73e8 !important;
}

/* Lingua attiva */
.htl-floating-lang.htl-active {
    background-color: #e8f0fe;
    color: #1a73e8 !important;
    font-weight: 600;
    pointer-events: none;
}

.htl-floating-flag {
    font-size: 20px;
    line-height: 1;
}

.htl-floating-name {
    font-size: 14px;
}

/* === Responsive === */

@media (max-width: 480px) {
    .htl-switcher {
        gap: 6px;
        padding: 4px 8px;
        font-size: 1.1em;
    }

    .htl-switcher a.htl-lang {
        width: 30px;
        height: 30px;
        font-size: 1em;
    }

    /* Floating switcher: leggermente più piccolo su mobile */
    .htl-floating {
        bottom: 16px;
        right: 16px;
    }

    .htl-floating-toggle {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .htl-floating-panel {
        bottom: 58px;
        min-width: 150px;
    }

    .htl-floating-lang {
        padding: 8px 14px;
        font-size: 14px;
    }
}