/* ============================
   Validation page – page-specific styles
   Shared modal/annotation styles are in validationModal.css
   ============================ */

.container:has(.validation-tabs) {
    justify-content: flex-start;
    align-items: stretch;
}

/* Language selects flush to edges */
.container:has(.validation-tabs) .dropdowns {
    gap: 20px;
}

.container:has(.validation-tabs) .languagetextSource,
.container:has(.validation-tabs) .languagetextTarget {
    margin-right: 0;
}

.container:has(.validation-tabs) .dropdowns select {
    width: 100%;
}

/* ============================
   Tab navigation
   ============================ */

.validation-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 24px;
    border-bottom: 2px solid #e8e8e8;
    padding-bottom: 0;
}

.tab-button {
    padding: 12px 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #888;
    border-bottom: 3px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: -2px;
}

.tab-button i {
    font-size: 13px;
}

.tab-button:hover {
    color: #555;
}

.tab-button.active {
    color: #009548;
    border-bottom-color: #009548;
    font-weight: 600;
}

/* ============================
   Tab content
   ============================ */

.tab-content.tab-hidden {
    display: none;
}

/* Tab content */
.tab-content {
    margin-top: 8px;
}

.tab-content > .submode-content.submode-hidden {
    display: none !important;
}

/* Fixed height so action bar and results don't shift between modes */
.submode-content {
    height: 400px;
    display: flex;
    flex-direction: column;
}

/* ============================
   Submode segmented control
   ============================ */

.submode-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.submode-selector {
    display: inline-flex;
    gap: 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #ddd;
    background-color: #f5f5f5;
    padding: 3px;
    width: fit-content;
    margin-bottom: 24px;
}

/* When inside a submode-row, the row handles spacing */
.submode-row > .submode-selector {
    margin-bottom: 0;
}

.submode-option {
    padding: 8px 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #777;
    background-color: transparent;
    border-radius: 7px;
    transition: all 0.25s ease;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 6px;
    border: none;
}

.submode-option i {
    font-size: 12px;
    opacity: 0.7;
    transition: opacity 0.25s ease;
}

.submode-option:hover {
    background-color: #eaeaea;
    color: #444;
}

.submode-option.active {
    background-color: #fff;
    color: #009548;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.submode-option.active i {
    opacity: 1;
}

.submode-option input[type="radio"] {
    display: none;
}

/* ============================
   Text areas
   ============================ */

.validation-textarea {
    width: 100%;
    flex: 1;
    padding: 12px 14px;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    resize: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.validation-textarea:focus {
    outline: none;
    border-color: #009548;
    box-shadow: 0 0 0 3px rgba(0, 149, 72, 0.1);
}

.validation-textarea::placeholder {
    color: #bbb;
}

/* Inside source-reference, textarea has a fixed height */
.source-reference .validation-textarea {
    height: 120px;
    flex: none;
}

/* Document and spreadsheet tabs: containers shrink to content instead of stretching */
#tab-document .compare-container,
#tab-spreadsheet .compare-container {
    flex: none;
}

#tab-document .compare-side,
#tab-spreadsheet .compare-side {
    flex: 1;
}

/* All document/spreadsheet file zones share the same fixed height */
#tab-document .file-upload-zone,
#tab-spreadsheet .file-upload-zone {
    height: 80px;
    flex: none;
}

/* ============================
   Compare layout
   ============================ */

.source-reference {
    margin-bottom: 16px;
    flex-shrink: 0;
}

.source-reference label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
    font-size: 13px;
}

.compare-container {
    display: flex;
    gap: 20px;
    flex: 1;
    min-height: 0;
}

.compare-side {
    flex: 1;
    min-width: 0;
    border-radius: 8px;
    margin-top: 14px;
    box-sizing: border-box;
    position: relative;
    display: flex;
    flex-direction: column;
}

.compare-side label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
    font-size: 13px;
}

/* ============================
   Spreadsheet area
   ============================ */

/* ============================
   Spreadsheet switch (inline with submode selector)
   ============================ */

.submode-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
}

.submode-switch-label {
    font-size: 13px;
    font-weight: 600;
    color: #777;
    user-select: none;
}

/* ============================
   Supported formats dialog
   ============================ */

.formatContainer {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin-left: 4px;
}

.validation-format-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.validation-format-trigger:hover {
    color: #009548;
    border-color: #009548;
    background-color: #f0faf4;
}

.validation-format-trigger i {
    font-size: 14px;
}

#validationOverlay,
.spreadsheet-format-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.25s ease;
}

#validationFormatListContainer,
.spreadsheet-format-dialog {
    display: none;
    border: none;
    background-color: white;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    border-radius: 10px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.25s ease;
    text-align: left;
    padding: 24px;
    padding-top: 40px;
}

#validationFormatListContainer {
    width: 300px;
}

.spreadsheet-format-dialog {
    width: 650px;
    max-width: 95vw;
    height: 65vh;
    overflow: hidden;
    display: none;
    flex-direction: column;
}

.spreadsheet-format-dialog .spreadsheet-format-hint-body {
    flex: 1;
    overflow: hidden;
    padding: 0;
}

/* Close button – base style (not on this page via AppCore) */
.closeButton {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #f0f0f0;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: #555;
    transition: background-color 0.15s;
}

.closeButton:hover {
    background-color: #e0e0e0;
    color: #222;
}

#validationFormatList {
    text-align: left;
    font-size: 16px;
    margin: 10px;
}

/* ============================
   File upload zones
   ============================ */

/* --- Empty state: dashed drop zone --- */
.file-upload-zone {
    border: 2px dashed #d0d0d0;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    background-color: #fafafa;
    position: relative;
    overflow: hidden;
}

.file-upload-zone:hover,
.file-upload-zone.dragover {
    border-color: #009548;
    background-color: #f0faf4;
    box-shadow: 0 0 0 3px rgba(0, 149, 72, 0.08);
}

.file-upload-zone .drop-prompt {
    color: #999;
    margin: 0;
    font-size: 13px;
}

/* --- File selected state: FileContainer style --- */
.file-upload-zone.has-file {
    border: 1px solid #ccc;
    border-style: solid;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-direction: row;
    justify-content: flex-start;
    padding: 12px 16px;
    gap: 12px;
}

.file-upload-zone.has-file:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    background-color: #fff;
    border-color: #bbb;
}

.file-upload-zone.has-file .drop-prompt {
    display: none;
}

.file-icon-container {
    display: none;
    justify-content: center;
    align-items: center;
    height: 27px;
    width: 29px;
    min-width: 29px;
    background-color: #12C2E9;
    border-radius: 4px;
}

.file-icon-container i {
    color: #fff;
    font-size: 14px;
}

.has-file .file-icon-container {
    display: flex;
}

.file-name-display {
    display: none;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.6);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    flex: 1;
    min-width: 0;
    text-align: left;
}

.has-file .file-name-display {
    display: block;
}

.file-upload-zone .DownloadButton {
    display: none;
    position: absolute;
    right: 2%;
    height: 28px;
    width: 28px;
    border-radius: 15px;
    border: none;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    pointer-events: all;
}

.file-upload-zone .DownloadButton:disabled {
    opacity: 0.5;
    pointer-events: none;
}

.has-file .DownloadButton {
    display: flex;
}

/* ============================
   Compact Results Bar
   ============================ */

#validationResults {
    margin-top: 20px;
    padding: 14px 20px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    background-color: #fafafa;
}

.results-summary-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.count-badge {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

.count-badge.error {
    background-color: #f8d7da;
    color: #721c24;
}

.count-badge.warning {
    background-color: #fff3cd;
    color: #856404;
}

.count-badge.valid {
    background-color: #d4edda;
    color: #155724;
}

.detailed-analysis-button {
    padding: 8px 18px;
    background-color: #007a3d;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.detailed-analysis-button:hover {
    background-color: #009548;
    box-shadow: 0 2px 8px rgba(0, 149, 72, 0.2);
}

.detailed-analysis-button:disabled {
    background-color: #ccc;
    color: #888;
    cursor: not-allowed;
    box-shadow: none;
}

/* ============================
   Best translation highlight
   ============================ */

.compare-side.best-translation {
    border-left: 4px solid #009548;
    background-color: #f0faf4;
    padding-left: 12px;
}

.best-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: #009548;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 10px;
    margin-left: 10px;
    vertical-align: middle;
    animation: badgeFadeIn 0.3s ease;
}

@keyframes badgeFadeIn {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}

/* ============================
   Validate button on translation pages
   ============================ */
#ValidateContainer {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.validate-trigger-button {
    background-color: #007a3d !important;
}

.validate-trigger-button:hover:not(:disabled) {
    background-color: #009548 !important;
}

/* ============================
   Spreadsheet format hint – dialog popup
   ============================ */

.spreadsheet-format-hint-body p {
    margin: 0 0 10px;
    line-height: 1.5;
}

.spreadsheet-example-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-bottom: 10px;
}

.spreadsheet-example-table th,
.spreadsheet-example-table td {
    border: 1px solid #d0d7de;
    padding: 6px 10px;
    text-align: left;
}

.spreadsheet-example-table th {
    background: #e8eef4;
    font-weight: 700;
    color: #24292f;
}

.spreadsheet-example-table td:first-child {
    font-family: monospace;
    color: #666;
}

.spreadsheet-format-hint-note {
    font-size: 12px;
    color: #666;
    line-height: 1.5;
}

.spreadsheet-format-hint-note code {
    background: #e8eef4;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 11px;
    color: #24292f;
}

.spreadsheet-supported-languages {
    margin-top: 12px;
}

.spreadsheet-languages-details {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
}

.spreadsheet-languages-details summary {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    pointer-events: none;
    font-weight: 600;
    font-size: 12px;
    color: #333;
    user-select: none;
    list-style: none;
}

.spreadsheet-languages-details summary::-webkit-details-marker {
    display: none;
}

.spreadsheet-languages-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0;
    border-top: 1px solid #e0e0e0;
    padding: 4px 0;
    max-height: calc(55vh - 320px);
    overflow-y: auto;
}

.spreadsheet-language-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 12px;
    font-size: 12px;
    color: #444;
}

.spreadsheet-language-row code {
    background: #e8eef4;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
    color: #24292f;
    min-width: 36px;
    text-align: center;
}

.spreadsheet-language-row span {
    color: #555;
}

/* ============================
   Spreadsheet validation warnings
   ============================ */

.spreadsheet-warnings {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.spreadsheet-warning-item {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 6px 10px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 6px;
    font-size: 12px;
    color: #6d4c00;
    line-height: 1.4;
}

.spreadsheet-warning-item i {
    margin-top: 2px;
    color: #f9a825;
    flex-shrink: 0;
}
