/**
 * Styles pour le système de traduction SV Vin
 * - Widget Google Translate (toute la plateforme)
 * - DeepL API (messagerie)
 */

/* ============================================
   WIDGET GOOGLE TRANSLATE - STYLES
   ============================================ */

/* Conteneur principal du widget */
.sv-translate-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: var(--font-primary, 'Inter', sans-serif);
}

/* Bouton toggle du widget */
.sv-translate-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--bordeaux, #7C0A29) 0%, var(--cuivre, #A0522D) 100%);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(124, 10, 41, 0.3);
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.sv-translate-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 10, 41, 0.4);
}

.sv-translate-container.active .sv-translate-toggle {
    background: linear-gradient(135deg, var(--cuivre, #A0522D) 0%, var(--bordeaux, #7C0A29) 100%);
}

.sv-translate-toggle svg {
    flex-shrink: 0;
}

.sv-translate-label {
    white-space: nowrap;
}

/* Dropdown du widget */
.sv-translate-dropdown {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 10px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 16px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.sv-translate-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Style du sélecteur Google */
#google_translate_element {
    width: 100%;
}

#google_translate_element select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

#google_translate_element select:hover {
    border-color: var(--bordeaux, #7C0A29);
}

#google_translate_element select:focus {
    outline: none;
    border-color: var(--bordeaux, #7C0A29);
    box-shadow: 0 0 0 3px rgba(124, 10, 41, 0.1);
}


/* ============================================
   DEEPL TRANSLATION - MESSAGERIE STYLES
   ============================================ */

/* Sélecteur de langue DeepL */
.deepl-language-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: var(--bg-card, #f8f9fa);
    border-radius: 8px;
    margin-left: auto;
}

.deepl-language-selector label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary, #666);
    white-space: nowrap;
}

.deepl-language-selector select {
    padding: 6px 10px;
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 6px;
    font-size: 13px;
    background: white;
    cursor: pointer;
    min-width: 120px;
}

.deepl-language-selector select:focus {
    outline: none;
    border-color: var(--bordeaux, #7C0A29);
}

/* Bouton de traduction sur les messages */
.translate-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: transparent;
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary, #666);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 8px;
}

.translate-btn:hover {
    background: var(--bg-hover, #f0f0f0);
    border-color: var(--bordeaux, #7C0A29);
    color: var(--bordeaux, #7C0A29);
}

.translate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.translate-btn.translated {
    background: linear-gradient(135deg, var(--bordeaux, #7C0A29) 0%, var(--cuivre, #A0522D) 100%);
    border-color: transparent;
    color: white;
}

.translate-btn.translated:hover {
    opacity: 0.9;
}

.translate-btn svg {
    flex-shrink: 0;
}

/* Animation de rotation pour le loading */
.translate-btn .spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Message traduit - indicateur visuel */
[data-translated="true"] {
    position: relative;
}

[data-translated="true"]::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: var(--success-color, #28a745);
    border-radius: 50%;
    border: 2px solid white;
}


/* ============================================
   NOTIFICATIONS DEEPL
   ============================================ */

.deepl-notification {
    position: fixed;
    bottom: 80px;
    right: 20px;
    padding: 12px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    z-index: 10000;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    max-width: 300px;
}

.deepl-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.deepl-notification-success {
    border-left: 4px solid var(--success-color, #28a745);
}

.deepl-notification-error {
    border-left: 4px solid var(--danger-color, #dc3545);
}

.deepl-notification-warning {
    border-left: 4px solid var(--warning-color, #ffc107);
}

.deepl-notification-info {
    border-left: 4px solid var(--info-color, #17a2b8);
}


/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .sv-translate-container {
        bottom: 15px;
        right: 15px;
    }

    .sv-translate-toggle {
        padding: 10px 14px;
        font-size: 13px;
    }

    .sv-translate-label {
        display: none;
    }

    .sv-translate-toggle {
        padding: 12px;
        border-radius: 50%;
    }

    .sv-translate-dropdown {
        right: 0;
        min-width: 180px;
        padding: 12px;
    }

    .deepl-language-selector {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 10px;
    }

    .deepl-language-selector select {
        width: 100%;
    }

    .translate-btn {
        font-size: 11px;
        padding: 3px 8px;
    }

    .deepl-notification {
        bottom: 70px;
        right: 15px;
        left: 15px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .sv-translate-container {
        bottom: 10px;
        right: 10px;
    }

    .sv-translate-toggle {
        padding: 10px;
    }

    .sv-translate-toggle svg {
        width: 18px;
        height: 18px;
    }
}


/* ============================================
   EXCLUSION DE LA MESSAGERIE POUR GOOGLE
   ============================================ */

/* Ces classes empêchent Google Translate de traduire certains éléments */
.notranslate,
.message-content.notranslate,
.msg-content.notranslate,
[data-message-content].notranslate {
    /* Google Translate respecte cette classe */
}

/* Zone de messagerie - exclure de Google Translate */
.messages-container,
.chat-messages,
.message-list,
[data-messages-container] {
    /* Ajouter notranslate via JS */
}
