.translate-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 8px;
    color: var(--text-sub);
    vertical-align: middle;
    transition: color 0.2s, transform 0.2s;
    opacity: 0.7;
}

.translate-btn:hover {
    color: var(--primary-color);
    opacity: 1;
}

.translate-btn.active {
    color: var(--primary-color);
    opacity: 1;
}

.word-title .translate-btn svg {
    width: 1em;
    height: 1em;
    min-width: 27px;
    min-height: 27px;
    max-width: 57px;
    max-height: 57px;
}

.translate-btn svg {
    width: 1.5em;
    height: 1.5em;
    fill: rgb(67 113 1 / 70%);
    margin: -24px 0;
}

.translated-text {
    font-size: 0.95em;
    color: var(--primary-color);
    margin: 4px 0px 0 0;
    padding: 3px 4px 6px 10px;
    background: #006eff12;
    border-radius: 0 4px 4px 0;
    display: none;
    animation: fadeInSlide 0.3s ease-out;
}

.translated-text.show {
    display: block;
}

.translation-loading {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin-left: 5px;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Settings UI for Translation */
.settings-section-translation {
    margin-top: 5px;
    padding-top: 5px;
}

.translation-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Simple switch style */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--primary-color);
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--primary-color);
}

input:checked+.slider:before {
    -webkit-transform: translateX(20px);
    -ms-transform: translateX(20px);
    transform: translateX(20px);
}

.floating-hint {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideUpFade 0.5s ease-out;
    cursor: pointer;
    white-space: nowrap;
}

body.dark-mode .floating-hint {
    background: #3c4043;
    color: #e8eaed;
    border: 1px solid #5f6368;
}

#translation-hint {
    font-size: 11px;
    color: var(--primary-color);
    background: rgba(0, 110, 255, 0.07);
    padding: 6px 10px;
    border-radius: 4px;
    margin-bottom: 8px;
    border-left: 3px solid var(--primary-color);
}

body.dark-mode #translation-hint {
    background: rgba(138, 180, 248, 0.1);
    color: #8ab4f8;
    border-left-color: #8ab4f8;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}