/* Bulk Image Translate — page-specific styles.
   Shares bulk-image-to-text.css for the batch UI; this file adds the
   destination-language selector and the side-by-side preview modal. */

/* Destination language selector */
.translate-to-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: fit-content;
    margin-bottom: 12px;
}

.translate-to-label {
    font-size: 14px;
    color: #4b5563;
    white-space: nowrap;
}

.js-toggle-dest-lang {
    padding: 4px 12px;
    cursor: pointer;
    border-radius: 8px;
    min-width: 120px;
    max-width: 170px;
    justify-content: center;
    border: 1px solid #eaeaea;
    transition: 0.2s all ease-in-out;
    background-color: #ffffff;
}

.js-toggle-dest-lang:hover {
    background-color: #f5f7fb;
}

.js-toggle-dest-lang.active_lang {
    background-color: #f1f3f7;
}

/* Language is fixed once the batch has images */
.js-toggle-dest-lang.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.d-lang {
    display: flex;
    gap: 2px;
    align-items: center;
    justify-content: center;
}

.d-lang .text-content {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.d-lang img {
    transition: transform 0.2s ease-in-out;
}

.js-toggle-dest-lang.active_lang .d-lang img {
    transform: rotate(180deg);
}

/* Dropdown modal (component: destination-lang-modal) */
.translate-to-row .modal-destination-language {
    top: calc(100% + 4px);
    left: 0;
    right: auto;
    width: max-content;
    min-width: 230px;
    max-width: 230px;
    z-index: 100;
}

.lang-modal {
    padding: 0.5rem;
    border-radius: 10px;
}

.grid-div {
    background-color: white;
    box-shadow: 2px 4px 8px 0 rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    padding: 10px;
    position: relative;
    z-index: 99;
    border: 1px solid #ccc;
}

.lang-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-height: 300px;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

.destination-lang-item {
    font-size: 16px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
    min-width: 100px;
    width: 100%;
}

.destination-lang-item:hover {
    background-color: #f5f7fb;
}

.destination-lang-item.active {
    background-color: #f1f3f7;
}

.search-lang {
    border: unset;
    border-radius: 5px;
    background-color: #f1f3f7;
    width: 100%;
    padding: 5px 20px;
    font-size: 16px;
    margin-bottom: 10px;
}

/* Preview modal: original vs translated side by side */
.image-compare {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    justify-content: center;
}

.image-pane {
    flex: 1 1 50%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.image-pane-label {
    font-size: 14px;
    font-weight: 600;
    color: #4b5563;
}

.image-pane img {
    width: 100%;
    height: auto;
    max-height: 60vh;
    object-fit: contain;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    background-color: #f9fafb;
}

/* This tool has no Simple/Formatted modes — hide the chip in the export modal */
.export-extractMode {
    display: none;
}

@media (max-width: 600px) {
    .image-compare {
        flex-direction: column;
    }

    .image-pane {
        flex-basis: 100%;
        width: 100%;
    }

    .lang-grid {
        max-height: 185px;
    }
}
