/* Translation Page Enhancements - NLP Panels and Term Highlighting */

/* Translation Layout Grid */
.translation-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.translation-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Text Areas Enhancement */
.translation-input,
.translation-output {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    min-height: 200px;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.2s;
}

.translation-input:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.translation-output {
    background: #f9fafb;
    position: relative;
}

/* Term Highlighting */
.highlighted-term {
    background: linear-gradient(180deg, transparent 60%, #fef3c7 60%);
    padding: 0 2px;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.highlighted-term.glcv-set-1 {
    background: linear-gradient(180deg, transparent 60%, #dbeafe 60%);
}

.highlighted-term.glcv-set-2 {
    background: linear-gradient(180deg, transparent 60%, #fce7f3 60%);
}

.highlighted-term.glcv-set-3 {
    background: linear-gradient(180deg, transparent 60%, #d1fae5 60%);
}

.highlighted-term.dnt {
    background: linear-gradient(180deg, transparent 60%, #fee2e2 60%);
    font-weight: 500;
}

.highlighted-term:hover {
    filter: brightness(0.95);
}

/* Term Tooltip */
.term-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1a202c;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    margin-bottom: 0.5rem;
}

.term-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1a202c;
}

.highlighted-term:hover .term-tooltip {
    opacity: 1;
    visibility: visible;
}

/* NLP Analysis Panels */
.nlp-analysis-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.nlp-panel {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
}

.nlp-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f3f4f6;
}

.nlp-panel-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1a202c;
}

.nlp-confidence {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.confidence-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.confidence-high {
    background: #d1fae5;
    color: #065f46;
}

.confidence-medium {
    background: #fed7aa;
    color: #92400e;
}

.confidence-low {
    background: #fee2e2;
    color: #991b1b;
}

/* NLP Metrics Grid */
.nlp-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.nlp-metric {
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 8px;
}

.nlp-metric-label {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: 0.25rem;
}

.nlp-metric-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a202c;
}

/* Entity Display */
.nlp-entities {
    margin-bottom: 1.5rem;
}

.nlp-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 0.75rem;
}

.entity-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.entity-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.875rem;
}

.entity-type {
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
    background: #e5e7eb;
    border-radius: 4px;
    color: #4b5563;
}

.entity-tag.person {
    border-color: #93c5fd;
    background: #eff6ff;
}

.entity-tag.location {
    border-color: #86efac;
    background: #f0fdf4;
}

.entity-tag.organization {
    border-color: #fca5a5;
    background: #fef2f2;
}

.entity-tag.date {
    border-color: #fde047;
    background: #fefce8;
}

/* POS Distribution */
.pos-distribution {
    display: flex;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.pos-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

.pos-segment:hover {
    filter: brightness(1.1);
}

.pos-noun { background: #3182ce; }
.pos-verb { background: #10b981; }
.pos-adj { background: #f59e0b; }
.pos-adv { background: #8b5cf6; }
.pos-other { background: #6b7280; }

/* Complexity Visualization */
.complexity-meter {
    position: relative;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.complexity-fill {
    height: 100%;
    transition: width 0.5s ease;
}

.complexity-low {
    background: linear-gradient(90deg, #10b981, #059669);
}

.complexity-medium {
    background: linear-gradient(90deg, #f59e0b, #f97316);
}

.complexity-high {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

/* Translation Controls */
.translation-controls {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
}

.control-value {
    padding: 0.5rem 0.75rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.875rem;
}

.control-select {
    padding: 0.5rem 0.75rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.control-select:hover {
    border-color: #9ca3af;
}

.control-select:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

/* GLCV Sidebar */
.glcv-sidebar {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.glcv-set-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f3f4f6;
}

.glcv-set-toggle {
    padding: 0.375rem 0.75rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.glcv-set-toggle.active {
    background: #3182ce;
    color: white;
    border-color: #3182ce;
}

.glcv-term-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.glcv-term-item {
    padding: 0.5rem;
    background: #f9fafb;
    border-radius: 6px;
    font-size: 0.875rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.glcv-term-name {
    font-weight: 500;
    color: #1a202c;
}

.glcv-term-priority {
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
    background: white;
    border-radius: 4px;
    color: #6b7280;
}

/* Dark Mode Support */
body.dark-mode .translation-input,
body.dark-mode .translation-output,
body.dark-mode .nlp-panel,
body.dark-mode .translation-controls,
body.dark-mode .glcv-sidebar {
    background: #1f2937;
    border-color: #374151;
}

body.dark-mode .translation-output {
    background: #111827;
}

body.dark-mode .nlp-panel-header {
    border-bottom-color: #374151;
}

body.dark-mode .nlp-metric {
    background: #374151;
}

body.dark-mode .nlp-metric-value,
body.dark-mode .nlp-panel-title {
    color: #f9fafb;
}

body.dark-mode .control-value {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}

body.dark-mode .control-select {
    background: #1f2937;
    border-color: #374151;
    color: #f9fafb;
}

body.dark-mode .entity-tag {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}

body.dark-mode .glcv-term-item {
    background: #374151;
}

body.dark-mode .glcv-term-name {
    color: #f9fafb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .translation-container,
    .nlp-analysis-container {
        grid-template-columns: 1fr;
    }
    
    .controls-grid {
        grid-template-columns: 1fr;
    }
    
    .nlp-metrics {
        grid-template-columns: 1fr;
    }
}