/* Training Data Upload Styles */

.card {
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

/* Upload Section */
.upload-section {
    overflow: hidden;
}

.upload-area {
    padding: 20px;
}

.dropzone {
    border: 3px dashed var(--border-color);
    border-radius: 10px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--bg-color);
}

.dropzone:hover {
    border-color: var(--primary-color);
    background: rgba(255, 153, 51, 0.05);
}

.dropzone.dragover {
    border-color: var(--secondary-color);
    background: rgba(19, 136, 8, 0.05);
    transform: scale(1.02);
}

.dropzone-content {
    pointer-events: none;
}

.dropzone-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.dropzone h3 {
    margin: 10px 0;
    color: var(--text-color);
}

.dropzone p {
    color: #666;
    margin: 5px 0;
}

.dropzone-hint {
    font-size: 0.85rem;
    color: #999;
}

/* Upload Options */
.upload-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.option-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
}

.option-group select {
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
}

.option-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Upload Queue */
.upload-queue {
    max-height: 400px;
    overflow-y: auto;
    padding: 0 20px 20px;
}

.upload-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.3s;
}

.upload-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.upload-item.uploading {
    border-color: var(--primary-color);
    background: rgba(255, 153, 51, 0.05);
}

.upload-item.success {
    border-color: var(--success-color);
    background: rgba(76, 175, 80, 0.05);
}

.upload-item.error {
    border-color: var(--error-color);
    background: rgba(244, 67, 54, 0.05);
}

.upload-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.upload-info {
    flex: 1;
    min-width: 0;
}

.upload-filename {
    font-weight: 600;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-details {
    font-size: 0.85rem;
    color: #666;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.upload-progress {
    flex: 1;
    min-width: 200px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s;
}

.progress-text {
    font-size: 0.8rem;
    color: #666;
}

.upload-actions {
    display: flex;
    gap: 10px;
}

.upload-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.upload-actions .btn-remove {
    background: var(--error-color);
    color: white;
}

.upload-actions .btn-remove:hover {
    background: #d32f2f;
}

/* Filters */
.filters {
    display: flex;
    gap: 10px;
    padding: 20px;
    background: #f9f9f9;
    flex-wrap: wrap;
}

.filters input,
.filters select {
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
}

.filters input {
    flex: 1;
    min-width: 250px;
}

.filters select {
    min-width: 150px;
}

/* Data List */
.data-list {
    min-height: 400px;
    padding: 20px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    color: #666;
    margin-bottom: 10px;
}

.data-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.data-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.data-item-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.data-item-content {
    flex: 1;
    min-width: 0;
}

.data-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 8px;
}

.data-item-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 5px;
}

.data-item-badges {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-language {
    background: rgba(25, 118, 210, 0.1);
    color: #1976d2;
}

.badge-speaker {
    background: rgba(156, 39, 176, 0.1);
    color: #9c27b0;
}

.badge-status {
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
}

.badge-status.pending {
    background: rgba(255, 152, 0, 0.1);
    color: #ff9800;
}

.badge-status.rejected {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
}

.badge-quality {
    background: rgba(0, 0, 0, 0.05);
    color: #666;
}

.data-item-transcription {
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.data-item-meta {
    display: flex;
    gap: 15px;
    font-size: 0.8rem;
    color: #999;
}

.data-item-tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.tag {
    padding: 2px 8px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.75rem;
    color: #666;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

#page-info {
    font-size: 0.9rem;
    color: #666;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

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

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-color);
}

.modal-body {
    padding: 20px;
}

.audio-player-section {
    margin-bottom: 20px;
}

.audio-player-section audio {
    width: 100%;
    margin-bottom: 10px;
}

.audio-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #666;
}

.metadata-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
}

.form-group select,
.form-group input,
.form-group textarea {
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
}

.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.transcription-section,
.notes-section,
.tags-section {
    margin-bottom: 20px;
}

.transcription-section label,
.notes-section label,
.tags-section label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
}

.transcription-section textarea,
.notes-section textarea,
.tags-section input {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
}

.transcription-tools {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.tag-suggestions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.tag-chip {
    padding: 5px 12px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.tag-chip:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.modal-footer {
    display: flex;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

/* Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    padding: 20px;
}

.stat-card {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    border-radius: 8px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.chart-container {
    background: white;
    padding: 15px;
    border-radius: 8px;
}

.chart-container h4 {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 0.95rem;
}

.chart-container canvas {
    max-height: 200px;
}

/* Management Controls */
.management-controls {
    display: flex;
    gap: 10px;
}

.upload-stats {
    font-size: 0.9rem;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .upload-options {
        grid-template-columns: 1fr;
    }

    .filters {
        flex-direction: column;
    }

    .filters input,
    .filters select {
        width: 100%;
        min-width: auto;
    }

    .metadata-section {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-section {
        grid-template-columns: 1fr;
    }

    .modal-content {
        max-height: 95vh;
    }

    .data-item {
        flex-direction: column;
    }

    .data-item-badges {
        flex-wrap: wrap;
    }
}

/* Loading Animation */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loading {
    display: inline-block;
    animation: spin 1s linear infinite;
}
