.translator-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffcc00, #ffaa00);
    color: #6a11cb;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 999;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.translator-fab:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.translator-container {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 380px;
    max-height: 80vh;
    overflow-y: auto;
    background: linear-gradient(135deg, rgba(106, 17, 203, 0.95), rgba(37, 117, 252, 0.95));
    backdrop-filter: blur(15px);
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 20px;
    color: white;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.translator-container.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
}

.translator-container.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.translator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.translator-header h4 {
    margin: 0;
    font-size: 1.2rem;
    color: #ffcc00;
}

.close-translator-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.8rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-translator-btn:hover {
    color: white;
}

.translator-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.lang-select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23ffffff%22%20d%3D%22M287%2069.9a14.6%2014.6%200%2000-20.6%200L146.2%20190.5%2026.1%2069.9a14.6%2014.6%200%2000-20.6%200%2014.6%2014.6%200%20000%2020.6l130.6%20130.6a14.6%2014.6%200%200020.6%200l130.6-130.6a14.6%2014.6%200%20000-20.6z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
    cursor: pointer;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.lang-select:focus {
    outline: none;
    border-color: #ffcc00;
    background-color: rgba(255, 255, 255, 0.2);
}

.lang-select option {
    background-color: #2575fc;
    color: white;
}

.text-input,
.text-output {
    width: calc(100% - 30px);
    height: 120px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    resize: vertical;
    line-height: 1.5;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.text-input::placeholder,
.text-output::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.text-input:focus,
.text-output:focus {
    outline: none;
    border-color: #ffcc00;
    background-color: rgba(255, 255, 255, 0.2);
}

.translate-button {
    background: linear-gradient(45deg, #ffcc00, #ffaa00);
    color: #6a11cb;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    width: 100%;
}

.translate-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, #ffaa00, #ffcc00);
}

.translate-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.error-message {
    color: #ffaa00;
    background-color: rgba(255, 0, 0, 0.1);
    border: 1px solid #d9534f;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    margin-top: 10px;
    font-weight: 500;
}

@media (max-width: 768px) {
    .translator-container {
        width: 90vw;
        right: 5vw;
        bottom: 80px;
        padding: 15px;
    }

    .translator-fab {
        bottom: 15px;
        right: 15px;
    }

    .translator-header h4 {
        font-size: 1.1rem;
    }

    .close-translator-btn {
        font-size: 1.5rem;
    }

    .text-input,
    .text-output {
        height: 100px;
    }
}

.scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 90px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6a11cb, #2575fc);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.2s ease;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

@media (max-width: 768px) {
    .scroll-to-top {
        bottom: 15px;
        right: 85px;
    }
}