/* ── Card ─────────────────────────────────────── */
.master-translator-wrapper {
    width: 100%;
}

.mt-card {
    width: 100%;
    background-color: white;
    border: 1px solid #d0d0d0;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    overflow: hidden;
}

/* ── Label bar (top) ──────────────────────────── */
.mt-label-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid #e0e0e0;
    background-color: #fafafa;
}

.mt-label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    flex: 1;
    text-align: center;
    line-height: 1.5;
}

.mt-swap-btn,
.mt-swap-btn:focus {
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    padding: 5px 7px;
    color: #333;
    cursor: pointer;
    flex-shrink: 0;
}

.mt-swap-btn:hover {
    background: #f5f5f5;
    border-color: #aaa;
    color: #111;
}

/* ── Panels layout ────────────────────────────── */
.mt-panels {
    display: flex;
    align-items: stretch;
}

.mt-left-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e0e0e0;
    min-width: 0;
}

.mt-right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ── Message area ─────────────────────────────── */
.mt-message-area {
    position: relative;
    flex: 1;
}

.mt-message-textarea,
.mt-message-textarea:focus {
    resize: none;
    border: none;
    outline: none !important;
    box-shadow: none !important;
    width: 100%;
    font-size: 17px;
    line-height: 1.75;
    color: black;
    background: white;
    padding: 15px;
    padding-bottom: 30px;
    min-height: 200px;
    overflow: hidden;
}

/* ── Image upload (inside message area) ──────── */
.mt-image-upload-btn-container {
    position: absolute;
    bottom: 10px;
    right: 10px;
}

.mt-image-upload-btn-container input[type="file"] {
    display: none;
}

.mt-image-upload-btn,
.mt-image-upload-btn:focus {
    display: flex;
    align-items: center;
    gap: 5px;
    background: white;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 12px;
    color: black;
    cursor: pointer;
    font-weight: normal;
}

.mt-image-upload-btn:hover {
    background: #f5f5f5;
    border-color: #aaa;
    color: #222;
}

.mt-form.show-image .mt-image-upload-btn-container {
    display: none;
}

/* ── Image preview ────────────────────────────── */
.mt-image-preview-container {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 15px;
    margin-bottom: 10px;
}

.mt-form.show-image .mt-message-textarea {
    display: none;
}

.mt-form.show-image .mt-image-preview-container {
    display: flex;
}

.mt-image-preview {
    width: 100%;
    object-fit: contain;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.mt-image-preview-actions {
    display: flex;
    gap: 8px;
}

.mt-image-another-btn,
.mt-image-another-btn:focus {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 6px;
    background: white;
    border: 1px solid #ccc;
    color: #333;
    font-size: 13px;
    cursor: pointer;
    font-weight: normal;
}

.mt-image-another-btn:hover {
    background: #f5f5f5;
    border-color: #111;
    color: #111;
}

.mt-image-remove-btn,
.mt-image-remove-btn:focus {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 6px;
    background: white;
    border: 1px solid #f0a0a0;
    color: #c00;
    font-size: 13px;
    cursor: pointer;
    font-weight: normal;
}

.mt-image-remove-btn:hover {
    background: #fff5f5;
    border-color: #c00;
    color: #c00;
}

/* ── Translation style field ──────────────────── */
.mt-field {
    display: flex;
    flex-direction: column;
    padding: 10px 15px;
}

.mt-style-field {
    border-top: 1px solid #e0e0e0;
}

.mt-field-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #777;
    line-height: 1.5;
    margin-bottom: 6px;
}

.mt-field-textarea,
.mt-field-textarea:focus {
    width: 100%;
    resize: none;
    border: none;
    outline: none !important;
    box-shadow: none !important;
    font-size: 14px;
    line-height: 1.6;
    color: black;
    background: transparent;
    padding: 0;
    overflow: hidden;
}

/* ── Actions bar ──────────────────────────────── */
.mt-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    height: 52px;
    border-top: 1px solid #e0e0e0;
    background: #fafafa;
    flex-shrink: 0;
    margin-top: auto;
}

.mt-translate-btn,
.mt-translate-btn:focus {
    background: #0c1550;
    color: white;
    border: none;
    border-radius: 7px;
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}

.mt-translate-btn:hover {
    background: #162792;
    color: white;
}

.mt-translate-btn:disabled {
    background: #999;
    cursor: not-allowed;
}

.mt-model-select,
.mt-model-select:focus {
    background: white;
    color: black;
    font-size: 12px;
    padding: 5px 2px;
    border-radius: 6px;
    border: 1px solid #d0d0d0;
    outline: none;
    height: unset;
    margin-left: auto;
    width: fit-content;
}

.mt-speech-btn,
.mt-speech-btn:focus {
    display: flex;
    align-items: center;
    padding: 6px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    color: black;
    background: white;
    font-size: 13px;
    font-weight: normal;
    cursor: pointer;
    /* margin-left: auto; */
    outline: none;
}

.mt-speech-btn:hover {
    background: #f5f5f5;
    border-color: #aaa;
    color: #222;
}

/* ── Output textarea ──────────────────────────── */
.mt-output-textarea,
.mt-output-textarea:focus {
    resize: none;
    border: none;
    outline: none !important;
    box-shadow: none !important;
    width: 100%;
    font-size: 17px;
    line-height: 1.75;
    color: black;
    background: white;
    padding: 15px;
    min-height: 200px;
    overflow: hidden;
}

/* ── Output actions ───────────────────────────── */
.mt-output-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    height: 52px;
    border-top: 1px solid #e0e0e0;
    background: #fafafa;
    flex-shrink: 0;
    margin-top: auto;
}

.mt-tts-btn,
.mt-tts-btn:focus {
    display: flex;
    align-items: center;
    padding: 6px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    color: black;
    background: white;
    font-size: 13px;
    font-weight: normal;
    outline: none;
    margin-left: auto;
}

.mt-tts-btn:hover {
    background: #f5f5f5;
    border-color: #aaa;
    color: #111;
}

.mt-copy-btn,
.mt-copy-btn:focus {
    display: flex;
    align-items: center;
    padding: 6px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    color: black;
    background: white;
    font-size: 13px;
    font-weight: normal;
    cursor: pointer;
}

.mt-copy-btn:hover {
    background: #f5f5f5;
    border-color: #aaa;
    color: #111;
}

/* ── Tooltips ─────────────────────────────────── */
.mt-speech-btn,
.mt-tts-btn,
.mt-copy-btn {
    position: relative;
}

.mt-speech-btn::after,
.mt-tts-btn::after,
.mt-copy-btn::after {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 1000;
    pointer-events: none;
    line-height: 1;
}

.mt-speech-btn::before,
.mt-tts-btn::before,
.mt-copy-btn::before {
    content: "";
    position: absolute;
    bottom: calc(100% - 1px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 1000;
    pointer-events: none;
}

.mt-speech-btn:hover::after,
.mt-speech-btn:hover::before,
.mt-tts-btn:hover::after,
.mt-tts-btn:hover::before,
.mt-copy-btn:hover::after,
.mt-copy-btn:hover::before {
    opacity: 1;
    visibility: visible;
}

.mt-speech-btn::after { content: "Audio to text"; }
.mt-tts-btn::after    { content: "Text to speech"; }
.mt-copy-btn::after   { content: "Copy"; }

/* ── Textarea focus override ──────────────────── */
.master-translator-wrapper textarea {
    color: black !important;
}

.master-translator-wrapper textarea:focus {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
    color: black !important;
}

/* ── Disclaimer ───────────────────────────────── */
.mt-disclaimer {
    margin-top: 12px;
    text-align: center;
    font-size: 11px;
    font-style: italic;
    color: #999;
    line-height: 1.5;
}

/* ── Responsive ───────────────────────────────── */
@media (max-width: 768px) {
    .mt-panels {
        flex-direction: column;
    }

    .mt-left-panel {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }
}
