/* Styles specific to the editor view - Enhanced for dark mode */

/* Editor Container */
.editor-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height));
    width: 100%;
    background-color: var(--background-color);
}

/* Translator Info in Header */
.translator-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
}

.translator-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
}

.translator-value {
    color: var(--success-color, #2ecc71);
    margin-right: 5px;
    font-weight: 600;
}

.translator-stats {
    display: flex;
    gap: 15px;
}

/* Enhanced Editor Toolbar */
.editor-toolbar {
    background-color: var(--card-background);
    border-bottom: 2px solid var(--border-color);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.editor-toolbar-left {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
}

.editor-toolbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* Search Controls for Editor */
.search-controls-editor {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.search-controls-editor .search-input-group {
    max-width: 400px;
    display: flex;
    gap: 8px;
}

.search-controls-editor .range-input-group {
    max-width: 500px;
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Enhanced Filter Dropdown */
.filter-dropdown {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-select {
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--input-background);
    color: var(--text-color);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    min-width: 120px;
}

.filter-select:focus {
    border-color: var(--secondary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Enhanced Pagination Info */
.pagination-info {
    background-color: var(--input-background);
    padding: 8px 16px;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

/* Editor Content Layout */
.editor-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    flex-direction: row-reverse; /* Dictionary on the left */
}

.editor-sidebar {
    width: 300px;
    background-color: var(--card-background);
    border-right: 2px solid var(--border-color);
    border-left: none;
    padding: 20px;
    overflow-y: auto;
    box-shadow: 2px 0 8px var(--shadow-color);
}

.editor-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0 20px;
    background-color: var(--background-color);
}

/* Enhanced Translation List */
.translation-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.translation-item {
    background-color: var(--card-background);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 8px var(--shadow-color);
    width: 100%;
    max-width: 100%;
}

.translation-item:hover {
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--shadow-color);
}

.translation-item.untranslated {
    border-left: 6px solid var(--warning-color, #f59e0b);
    background: linear-gradient(135deg, var(--card-background), rgba(245, 158, 11, 0.05));
}

.translation-item.translated {
    border-left: 6px solid var(--success-color, #10b981);
    background: linear-gradient(135deg, var(--card-background), rgba(16, 185, 129, 0.05));
}

.translation-item.in-progress {
    border-left: 6px solid var(--secondary-color);
    background: linear-gradient(135deg, var(--card-background), rgba(52, 152, 219, 0.05));
}

/* Translation Header */
.translation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.translation-id {
    font-size: 16px;
    font-weight: 700;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.translation-id::before {
    content: '#';
    opacity: 0.6;
}

.translation-status {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 16px;
    background-color: var(--input-background);
    color: var(--text-color);
    font-weight: 600;
    border: 1px solid var(--border-color);
}

/* Enhanced Translation Source */
.translation-source {
    margin-bottom: 20px;
    padding: 16px;
    background-color: var(--input-background);
    border-radius: var(--border-radius);
    font-size: 14px;
    line-height: 1.6;
    width: 100%;
    border: 1px solid var(--border-color);
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Enhanced Translation Target */
.translation-target {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.translation-target textarea {
    min-height: 120px;
    margin-bottom: 16px;
    resize: vertical;
    font-size: 15px;
    padding: 16px;
    line-height: 1.8;
    width: 100%;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--input-background);
    color: var(--text-color);
    transition: all 0.3s ease;
    font-family: inherit;
    direction: rtl;
}

.translation-target textarea:focus {
    border-color: var(--secondary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
    background-color: var(--card-background);
}

.translation-target textarea:hover {
    border-color: var(--secondary-color);
}

.translation-target textarea::placeholder {
    color: var(--text-color);
    opacity: 0.6;
}

/* Enhanced Translation Actions */
.translation-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.save-status {
    font-size: 12px;
    color: var(--success-color);
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.save-status.show {
    opacity: 1;
}

.translation-actions .next-btn {
    background: linear-gradient(135deg, var(--secondary-color), #2574a9);
    color: white;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.translation-actions .next-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Enhanced Dictionary Styles */
.dictionary-form textarea {
    min-height: 60px;
    resize: vertical;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--input-background);
    color: var(--text-color);
    transition: all 0.3s ease;
}

.dictionary-form textarea:focus {
    border-color: var(--secondary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.dictionary-table-container {
    margin-top: 15px;
    max-height: 300px;
    overflow-y: auto;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--card-background);
}

.dictionary-table {
    width: 100%;
    border-collapse: collapse;
}

.dictionary-table th,
.dictionary-table td {
    padding: 12px;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

.dictionary-table th {
    background-color: var(--table-header-bg, var(--primary-color));
    color: white;
    position: sticky;
    top: 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dictionary-table tr:hover {
    background-color: var(--table-row-hover, var(--hover-color));
}

/* Load More Container */
.load-more-container {
    text-align: center;
    padding: 20px;
    border-bottom: 2px solid var(--border-color);
    background-color: var(--card-background);
}

/* Enhanced Dictionary Suggestions */
.dictionary-suggestions {
    margin-top: 15px;
    padding: 16px;
    background-color: var(--input-background);
    border-radius: var(--border-radius);
    border-right: 4px solid var(--secondary-color);
    box-shadow: 0 2px 8px var(--shadow-color);
}

.suggestion-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 8px;
    border-bottom: 1px dashed var(--border-color);
    transition: background-color 0.2s ease;
}

.suggestion-item:hover {
    background-color: var(--hover-color);
    border-radius: var(--border-radius);
}

.suggestion-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.suggestion-term {
    font-weight: bold;
    color: var(--text-color);
}

.suggestion-translation {
    color: var(--secondary-color);
    font-weight: 500;
}

/* Loading States */
.editor-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: var(--text-color);
    font-size: 16px;
}

.editor-loading::before {
    content: '';
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design for Editor */
@media (max-width: 1024px) {
    .editor-content {
        flex-direction: column;
    }
    
    .editor-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 2px solid var(--border-color);
        max-height: 300px;
    }
    
    .editor-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .editor-toolbar-left,
    .editor-toolbar-right {
        width: 100%;
        justify-content: center;
    }
    
    .search-controls-editor .search-input-group,
    .search-controls-editor .range-input-group {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .translation-item {
        padding: 16px;
    }
    
    .translation-target textarea {
        min-height: 100px;
        font-size: 14px;
    }
    
    .translator-stats {
        flex-direction: column;
        gap: 5px;
    }
    
    .search-controls-editor {
        align-items: center;
    }
    
    .range-input-group {
        flex-wrap: wrap;
        justify-content: center;
    }
}

