/* Compact translation button */
#rt-translate-button {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    left: auto !important;
    top: auto !important;
    width: 56px;
    height: 56px;
    padding: 0;
    background-color: #0073aa;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 9999 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

#rt-translate-button:hover {
    background-color: #005177;
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

#rt-translate-button:active {
    transform: scale(0.95);
}

/* Icons */
.rt-icon {
    width: 24px;
    height: 24px;
    position: absolute;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: scale(0.5) rotate(-90deg);
}

.rt-globe-icon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* Hide globe when loading */
#rt-translate-button.loading .rt-globe-icon {
    opacity: 0;
    transform: scale(0.5) rotate(90deg);
}

/* Show spinner when loading */
#rt-translate-button.loading .rt-spinner-icon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    animation: rt-spin 1s linear infinite;
}

/* Show checkmark when success */
#rt-translate-button.success .rt-check-icon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

#rt-translate-button.success .rt-globe-icon {
    opacity: 0;
    transform: scale(0.5) rotate(-90deg);
}

/* Language code badge */
.rt-lang-code {
    position: absolute;
    bottom: -8px;
    right: -8px;
    background-color: #fff;
    color: #0073aa;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.5px;
    min-width: 26px;
    text-align: center;
}

#rt-translate-button:hover .rt-lang-code {
    background-color: #f0f0f0;
    transform: scale(1.1);
}

/* Spin animation for loading */
@keyframes rt-spin {
    from {
        transform: scale(1) rotate(0deg);
    }
    to {
        transform: scale(1) rotate(360deg);
    }
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    #rt-translate-button {
        width: 48px;
        height: 48px;
        bottom: 16px !important;
        right: 16px !important;
        left: auto !important;
    }
    
    .rt-icon {
        width: 20px;
        height: 20px;
    }
    
    .rt-lang-code {
        font-size: 9px;
        padding: 2px 5px;
        min-width: 22px;
        bottom: -6px;
        right: -6px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    #rt-translate-button {
        width: 44px;
        height: 44px;
        bottom: 12px !important;
        right: 12px !important;
        left: auto !important;
    }
    
    .rt-icon {
        width: 18px;
        height: 18px;
    }
}