/* ============================================
   MODE SWITCH - Design Minimalista
   ============================================ */

   .mode-switch-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

/* Ícone do modo */
.mode-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 16px;
    border-radius: 50%;
    background: rgba(132, 118, 255, 0.08);
    border: 1.5px solid rgba(132, 118, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.7;
}

/* Estado Hover */
.mode-switch-btn:hover .mode-icon {
    opacity: 1;
    background: rgba(132, 118, 255, 0.15);
    border-color: rgba(132, 118, 255, 0.4);
    box-shadow: 0 0 12px rgba(132, 118, 255, 0.25);
    transform: scale(1.05);
}

/* Tooltip (oculto por padrão) */
.mode-tooltip {
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 6px;
    border: 1px solid rgba(132, 118, 255, 0.3);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

/* Seta do tooltip */
.mode-tooltip::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: rgba(0, 0, 0, 0.9);
}

/* Tooltip visível no hover */
.mode-switch-btn:hover .mode-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(4px);
}

/* Título do tooltip */
.mode-tooltip-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
}

/* Subtítulo do tooltip */
.mode-tooltip-subtitle {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.2;
}

/* Input oculto (mantém funcionalidade) */
.mode-switch-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* ============================================
   ESTADOS DOS MODOS
   ============================================ */

/* Modo FAST (padrão) */
.mode-switch-btn[data-mode="fast"] .mode-icon {
    background: rgba(132, 118, 255, 0.08);
    border-color: rgba(132, 118, 255, 0.2);
}

.mode-switch-btn[data-mode="fast"]:hover .mode-icon {
    background: rgba(132, 118, 255, 0.15);
    border-color: rgba(132, 118, 255, 0.4);
    box-shadow: 0 0 12px rgba(132, 118, 255, 0.3);
}

/* Modo PERSONALITY */
.mode-switch-btn[data-mode="personality"] .mode-icon {
    background: rgba(255, 68, 204, 0.08);
    border-color: rgba(255, 68, 204, 0.2);
}

.mode-switch-btn[data-mode="personality"]:hover .mode-icon {
    background: rgba(255, 68, 204, 0.15);
    border-color: rgba(255, 68, 204, 0.4);
    box-shadow: 0 0 12px rgba(255, 68, 204, 0.3);
}

/* Estado de foco (acessibilidade) */
.mode-switch-btn:focus-visible .mode-icon {
    outline: 2px solid var(--primary-glow);
    outline-offset: 2px;
}

/* Animação de transição entre modos */
@keyframes mode-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.mode-switch-btn.mode-changing .mode-icon {
    animation: mode-pulse 0.4s ease;
}

/* ============================================
   INTEGRAÇÃO COM CHAT INPUT
   ============================================ */

.chat-input-container .input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Posicionamento ao lado do input */
.mode-switch-btn {
    flex-shrink: 0;
    margin-right: 4px;
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */

@media (max-width: 768px) {
    .mode-icon {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .mode-tooltip {
        left: auto;
        right: calc(100% + 12px);
        transform: translateY(-50%);
    }
    
    .mode-tooltip::before {
        right: auto;
        left: 100%;
        border-right-color: transparent;
        border-left-color: rgba(0, 0, 0, 0.9);
    }
    
    .mode-switch-btn:hover .mode-tooltip {
        transform: translateY(-50%) translateX(-4px);
    }
}

@media (max-width: 480px) {
    /* Em telas muito pequenas, mostrar apenas ícone sem tooltip */
    .mode-tooltip {
        display: none;
    }
    
    /* Usar atributo title nativo como fallback */
    .mode-icon {
        width: 26px;
        height: 26px;
        font-size: 13px;
    }
}