/* ============================================
   TEXT TRANSLATION MODE - SPECIFIC STYLES
   Document Translator - Text Mode Only
   ============================================ */

/* Text input area */
#textSourceArea {
    width: 100%;
    min-height: 150px;
    max-height: 400px;
    border: 1px solid #ccc;
    padding: 15px;
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    resize: vertical;
    border-radius: 4px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#textSourceArea:focus {
    outline: none;
    border-color: #009548;
    box-shadow: 0 0 5px rgba(0, 149, 72, 0.3);
}

#textSourceArea::placeholder {
    color: rgba(0, 0, 0, 0.4);
    font-style: italic;
}

/* Disabled state for text source area during translation */
#textSourceArea:disabled {
    background-color: #f7f3f3;
    color: rgba(0, 0, 0, 0.5);
    cursor: not-allowed;
    border-color: #ccc;
}

/* (Removed earlier conflicting TextContainer_Area rule.)
   The detailed .TextContainer_Area rule below defines collapsed height and
   animation; keep height control centralized there. */

/* Character counter */
.character-counter {
    text-align: right;
    font-size: 12px;
    color: #666;
    white-space: nowrap;
}

.character-counter.warning {
    color: #f52213;
    font-weight: bold;
}

/* Text mode specific layout adjustments */
.text-mode .container {
    max-width: 1200px;
}

.text-mode #SourceContainer {
    margin-bottom: 20px;
}

/* Hide file-specific UI elements in text mode */
.text-mode #fileSearchLink,
.text-mode .drop-zone,
.text-mode #dropZone {
    display: none !important;
}

/* ============================================
   TEXT CONTAINER STYLES
   ============================================ */

.TextContainer_Header {
    font-weight: 600;
    font-size: 0.95em;
    padding: 6px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

/* Override RemoveTargetContainerButton styling for TextContainer header */
.TextContainer_Header .RemoveTargetContainerButton {
    position: static;
    height: auto;
    width: auto;
    opacity: 0.6;
    border: none;
    padding: 2px 6px;
    background-color: transparent;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

.TextContainer_Header .RemoveTargetContainerButton::before {
    content: '✕';
    position: static;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    border-radius: 0;
    background-color: transparent;
    pointer-events: all;
    font-weight: bold;
}

.TextContainer_Header .RemoveTargetContainerButton:hover {
    opacity: 1;
}

.TextContainer_Body {
    padding: 0 8px 8px 8px;
    position: relative;
    height: fit-content;
}

.TextContainer_Area {
    transition: max-height 220ms cubic-bezier(.2,.9,.2,1);
    width: 100%;
    box-sizing: border-box;
    white-space: pre-wrap;
    overflow: hidden;
    max-height: 3em;
    margin-top: 6px;
    line-height: 1.5em;
    padding-top: 4px;
    padding-bottom: 4px;
    padding-left: 6px;
    padding-right: 6px;
    text-align: left;
    border-radius: 4px;
    will-change: max-height;
}

.TextContainer_ToggleArrow {
    display: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    margin: 6px 0 0;
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%;
}

/* Text container base container styles */
.TextContainerEnabled,
.TextContainerDisabled {
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 4px;
    margin: 8px 0;
    background: #fff;
    position: relative;
    height: fit-content;
}


.TextContainerDisabled {
    opacity: 0.8;
}

/* Expandable state - shows toggle button with pointer cursor */
.TextContainerEnabled.expandable .TextContainer_ToggleArrow {
    display: block;
    
}

/* Expanded state - shows full content */
.TextContainerEnabled.expanded .TextContainer_Area {
    overflow: visible;
    max-height: none;
}

/* Error styling for empty/failed translations */
.TextContainer_Area.translation-error {
    color: #c23030;
    font-weight: 600;
}

/* Shared format container styles for both document and text modes */
.characterCounterContainer {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    margin-bottom: 5px;
    margin-left: 4px;
}





