/* Styles specific to the main table view */

/* Main App Layout */
.main-content {
    display: flex;
    height: calc(100vh - var(--header-height));
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--card-background);
    border-right: 1px solid var(--border-color);
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.user-info, .filter-section, .action-buttons, .dictionary-section {
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.user-info h3, .filter-section h3, .dictionary-section h3 {
    margin-bottom: 16px;
    color: var(--primary-color);
}

.user-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
}

.filter-buttons {
    display: flex;
    gap: 8px;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dictionary-list {
    margin-top: 16px;
    max-height: 200px;
    overflow-y: auto;
}

.dictionary-item {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
}

.dictionary-item:hover {
    background-color: var(--hover-color);
}

.content-area {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* Table Styles */
.table-container {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px var(--shadow-color);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

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

th, td {
    padding: 16px 20px;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

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

tr {
    transition: background-color 0.2s ease;
}

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

tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02);
}

.col-id {
    width: 15%;
    font-weight: 600;
    color: var(--secondary-color);
}

.col-en {
    width: 35%;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
}

.col-ar {
    width: 35%;
    font-size: 14px;
    line-height: 1.8;
}

.col-actions {
    width: 15%;
    text-align: center;
}

/* Enhanced translation input */
.translation-input {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--input-background);
    color: var(--text-color);
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.3s ease;
    font-family: inherit;
}

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

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

/* Status indicators for rows */
tr.untranslated {
    border-right: 4px solid var(--warning-color, var(--status-untranslated));
    background-color: rgba(245, 158, 11, 0.05);
}

tr.translated {
    border-right: 4px solid var(--success-color, var(--status-done));
    background-color: rgba(16, 185, 129, 0.05);
}

tr.in-progress {
    border-right: 4px solid var(--secondary-color);
    background-color: rgba(52, 152, 219, 0.05);
}

/* Action Buttons */
.row-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.save-btn {
    background: linear-gradient(135deg, var(--success-color, #2ecc71), #27ae60);
    color: white;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

/* Make table rows clickable */
#translations-body tr {
    cursor: pointer;
    transition: all 0.2s ease;
}

#translations-body tr:hover {
    background-color: var(--table-row-hover, var(--hover-color));
    transform: translateX(-2px);
}

/* Loading state for table */
.table-loading {
    opacity: 0.6;
    pointer-events: none;
}

.table-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Translation Editor Screen */
#translation-editor-screen {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background-color: var(--background-color);
    width: 100%;
}

#translation-editor-screen header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    width: 100%;
}

.translation-navigation {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.navigation-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.keyboard-shortcuts {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shortcut-key {
    background-color: var(--card-background);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    border: 1px solid var(--border-color);
}

.shortcut-desc {
    font-size: 12px;
    color: var(--text-color);
}

.navigation-info {
    font-size: 16px;
    font-weight: bold;
}

.translation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: var(--card-background);
    border-bottom: 1px solid var(--border-color);
}

.line-number {
    font-size: 12px;
    font-weight: bold;
    color: var(--secondary-color);
    background-color: var(--hover-color);
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 8px;
}

.translation-info {
    margin-bottom: 20px;
}

.translation-id, .translation-source {
    margin-bottom: 10px;
}

.translation-id .label, .translation-source .label {
    font-weight: bold;
    margin-left: 8px;
    color: var(--text-color);
}

.source-text {
    background-color: var(--hover-color);
    padding: 15px;
    border-radius: 6px;
    margin-top: 8px;
    white-space: pre-wrap;
    line-height: 1.5;
}

.translation-edit {
    margin-bottom: 20px;
}

.translation-edit label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--text-color);
}

.translation-edit textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--input-background);
    color: var(--text-color);
    font-size: 1rem;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.2s;
}

.translation-edit textarea:focus {
    border-color: var(--secondary-color);
    outline: none;
}

.translation-actions {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 10px;
}

.translation-actions .next-btn {
    background-color: var(--secondary-color);
    color: white;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-right: 10px;
}

.translation-actions .next-btn:hover {
    background-color: #2574a9;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .navigation-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .navigation-buttons .btn {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 768px) {
    .col-id {
        width: 30%;
    }
    
    .col-en, .col-ar {
        width: 30%;
    }
    
    .col-actions {
        width: 10%;
    }
}

