/* static/css/translation.css */

/* 翻譯對照表管理樣式 */

.translation-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.control-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* 分類列表樣式 */
.categories-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-item:hover {
    background: #e9ecef;
    border-color: #007bff;
}

.category-item.selected {
    background: #007bff;
    color: white;
    border-color: #0056b3;
}

.category-info {
    flex: 1;
}

.category-name {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
}

.category-description {
    font-size: 14px;
    color: #6c757d;
}

.category-item.selected .category-description {
    color: #e9ecef;
}

.category-count {
    background: #007bff;
    color: white;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.category-item.selected .category-count {
    background: rgba(255, 255, 255, 0.2);
}

/* 映射列表樣式 */
.mappings-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mapping-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
    transition: all 0.2s ease;
}

.mapping-item:hover {
    background: #f8f9fa;
    border-color: #007bff;
}

.mapping-content {
    flex: 1;
}

.mapping-pair {
    display: flex;
    align-items: center;
    gap: 15px;
}

.original {
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    color: #495057;
    font-size: 14px;
}

.arrow {
    color: #007bff;
    font-weight: bold;
    font-size: 16px;
}

.translation {
    font-family: 'Courier New', monospace;
    background: #e7f3ff;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #b3d9ff;
    color: #0056b3;
    font-size: 14px;
}

.mapping-actions {
    display: flex;
    gap: 5px;
}

.button-small {
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid #6c757d;
    background: white;
    color: #6c757d;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.button-small:hover {
    background: #6c757d;
    color: white;
}

.button-small.danger {
    border-color: #dc3545;
    color: #dc3545;
}

.button-small.danger:hover {
    background: #dc3545;
    color: white;
}

/* 空狀態和載入狀態 */
.empty-message, .loading-message {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-style: italic;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
}

/* 模態框樣式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.large {
    max-width: 900px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
    margin: 0;
    color: #495057;
}

.close-button {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-button:hover {
    background: #f8f9fa;
    color: #495057;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #e9ecef;
}

/* 表單樣式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: bold;
    color: #495057;
    margin-bottom: 5px;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Prompt 預覽樣式 */
.preview-container {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    max-height: 500px;
    overflow-y: auto;
}

.prompt-preview {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    color: #495057;
    margin: 0;
    padding: 15px;
    white-space: pre-wrap;
    background: none;
    border: none;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .translation-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-group {
        justify-content: center;
    }
    
    .category-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .category-count {
        align-self: flex-end;
    }
    
    .mapping-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .mapping-pair {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        width: 100%;
    }
    
    .mapping-actions {
        align-self: flex-end;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
}