/* Custom table styles for Gradio Dataframe */
.preview-table {
    width: 100% !important;
    overflow-x: auto !important;
    display: block !important;
    min-width: 0 !important;
    max-width: 100vw !important;
}
.preview-table .gr-block {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    overflow-x: auto !important;
    display: block !important;
}
.preview-table table {
    min-width: 600px !important;
    width: auto !important;
    table-layout: auto !important;
    background-color: white !important;
    font-size: 0.9em !important;
    border-collapse: collapse !important;
    margin-top: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    font-size: 14px !important;
}
.preview-table th, .preview-table td {
    min-width: 120px !important;
    max-width: 400px !important;
    white-space: nowrap !important;
    padding: 8px 12px !important;
    border: 1px solid #ddd !important;
    vertical-align: middle !important;
}
.preview-table th {
    background-color: #e0e0e0 !important;
    font-weight: bold !important;
    font-size: 0.95em !important;
    text-align: left !important;
}
.preview-table tr:hover {
    background-color: #f0f0f0 !important;
}


.preview-table table, .dataset-stats table {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    font-size: 14px !important;
}

.import-config-btn {
    width: 100% !important;
    overflow-x: auto !important;
    display: block !important;
    min-width: 0 !important;
    max-width: 100vw !important;
}
.import-config-btn .gr-block {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    overflow-x: auto !important;
    display: block !important;
}
.import-config-btn table {
    min-width: 600px !important;
    width: auto !important;
    table-layout: auto !important;
    background-color: white !important;
    font-size: 0.9em !important;
    border-collapse: collapse !important;
    margin-top: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    font-size: 14px !important;
}
.import-config-btn th, .import-config-btn td {
    min-width: 120px !important;
    max-width: 400px !important;
    white-space: nowrap !important;
    padding: 8px 12px !important;
    border: 1px solid #ddd !important;
    vertical-align: middle !important;
}
.import-config-btn th {
    background-color: #e0e0e0 !important;
    font-weight: bold !important;
    font-size: 0.95em !important;
    text-align: left !important;
}
.import-config-btn tr:hover {
    background-color: #f0f0f0 !important;
}

.dataset-stats {
    width: 100% !important;
    overflow-x: auto !important;
    display: block !important;
    min-width: 0 !important;
    max-width: 100vw !important;
}
.dataset-stats .gr-block {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    overflow-x: auto !important;
    display: block !important;
}
.dataset-stats table {
    background-color: white !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-radius: 8px !important;
    overflow: hidden !important;
    font-size: 0.9em !important;
}
.dataset-stats th, .dataset-stats td {
    min-width: 120px !important;
    max-width: 400px !important;
    white-space: nowrap !important;
    padding: 8px 12px !important;
    border: 1px solid #ddd !important;
    vertical-align: middle !important;
}
.dataset-stats th, .dataset-stats th * {
    background-color: #e0e0e0 !important;
    font-weight: bold !important;
    font-size: 0.95em !important;
    text-align: left !important;
}
.dataset-stats td, .dataset-stats td * {
    text-align: left !important;
}
.dataset-stats tr:hover {
    background-color: #f0f0f0 !important;
}
@media (prefers-color-scheme: dark) {
    .dataset-stats table, .preview-table table {
        background-color: #2b2b2b !important; 
        color: #f0f0f0 !important; 
        box-shadow: 0 4px 8px rgba(0,0,0,0.3) !important;
        border-radius: 8px !important;
        overflow: hidden !important;
    }

    .dataset-stats th, .preview-table th {
        background-color: #2c3e50 !important;
        color: #e0e0e0 !important;
        font-weight: bold !important;
        border: 1px solid #444 !important;
    }

    .dataset-stats td, .preview-table td {
        color: #ccc !important;
        border: 1px solid #444 !important;
    }

    .dataset-stats tr:hover, .preview-table tr:hover {
        background-color: #3c3c3c !important;
    }

    .dataset-stats tr, .preview-table tr {
        background-color: #1e1e1e !important;
    }

    .dataset-stats tr:nth-child(even), .preview-table tr:nth-child(even) {
        background-color: #2a2a2a !important;
    }
}
.preview-table table,
.preview-table th,
.preview-table td {
    border-collapse: collapse !important;
    border-spacing: 0 !important;
}
/* Center Model Statistics Table */
.center-table-content td, .center-table-content th {
    text-align: center !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    padding: 10px !important;
    border: 1px solid #ddd !important;
    vertical-align: middle !important;
}
.center-table-content table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-bottom: 20px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    table-layout: auto !important;
}
.center-table-content th {
    background-color: #f0f4f8 !important;
    color: #2c3e50 !important;
    font-weight: 600 !important;
    border-bottom: 2px solid #ddd !important;
    white-space: nowrap !important;
    min-width: 120px !important;
    text-align: left !important;
}
.center-table-content td {
    text-align: left !important;
    color: #333 !important; 
}
.center-table-content tr:nth-child(even) {
    background-color: #f9f9f9 !important;
}
.center-table-content tr:hover {
    background-color: #f0f7ff !important;
}
.center-table-content {
    width: 100% !important;
    overflow-x: auto !important;
}
.center-table-content .gr-block {
    width: 100% !important;
    max-width: none !important;
}


@media (prefers-color-scheme: dark) {
    .center-table-content td, .center-table-content th {
        border-color: #444 !important;
    }

    .center-table-content table {
        box-shadow: 0 2px 8px rgba(0,0,0,0.5) !important;
    }
    
    /* Header styles for dark mode */
    .center-table-content th {
        background-color: #2c3e50 !important;
        color: #e0e0e0 !important;
        border-bottom-color: #555 !important;
    }

    /* Cell text color for dark mode */
    .center-table-content td {
        color: #ccc !important;
    }

    /* Row background colors for dark mode */
    .center-table-content tr {
        background-color: #1e1e1e !important;
    }

    .center-table-content tr:nth-child(even) {
        background-color: #2a2a2a !important;
    }

    .center-table-content tr:hover {
        background-color: #3c3c3c !important;
    }
}
/* Preview button container and button styles */
.preview-button-container {
    display: flex !important;
    align-items: stretch !important;
    height: 100% !important;
    min-height: 86px !important;
}

.preview-button {
    height: 100% !important;
    min-height: 86px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.preview-button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4) !important;
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%) !important;
}

.preview-button:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3) !important;
}

/* Training control buttons styles */
.preview-command-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    color: white !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    padding: 10px 24px !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    /* margin-bottom: 10px !important; */
    width: 100% !important;
}

.preview-command-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4) !important;
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%) !important;
}

.preview-command-btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3) !important;
}

.abort-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%) !important;
    border: none !important;
    color: white !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    padding: 10px 24px !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    /* margin-bottom: 10px !important; */
    width: 100% !important;
}

.abort-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4) !important;
    background: linear-gradient(135deg, #ff5252 0%, #d32f2f 100%) !important;
}

.abort-btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.3) !important;
}

.train-btn {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%) !important;
    border: none !important;
    color: white !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    padding: 10px 24px !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    width: 100% !important;
    /* position: relative !important;
    overflow: hidden !important; */
}

.train-btn::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent) !important;
    transition: left 0.5s !important;
}

.train-btn:hover {
    transform: translateY(0px) !important;
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.5) !important;
    background: linear-gradient(135deg, #43a047 0%, #388e3c 100%) !important;
}

.train-btn:hover::before {
    left: 100% !important;
}

.train-btn:active {
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 10px rgba(76, 175, 80, 0.4) !important;
}

.download-btn {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%) !important;
    border: none !important;
    color: white !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    width: 100% !important;
}

.download-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4) !important;
    background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%) !important;
}

.download-btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 10px rgba(33, 150, 243, 0.3) !important;
}

/* Tab Font Size Enhancement */
/* Main tabs (top level) */
.gradio-tabs > .tabs > .tab-nav > .tab-nav-item {
    font-size: 18px !important;
    font-weight: 600 !important;
    padding: 12px 20px !important;
    min-height: 50px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Nested tabs (secondary level) */
.gradio-tabs .gradio-tabs > .tabs > .tab-nav > .tab-nav-item {
    font-size: 16px !important;
    font-weight: 500 !important;
    padding: 10px 16px !important;
    min-height: 45px !important;
}

/* Tab hover effects */
.gradio-tabs > .tabs > .tab-nav > .tab-nav-item:hover,
.gradio-tabs .gradio-tabs > .tabs > .tab-nav > .tab-nav-item:hover {
    background-color: rgba(102, 126, 234, 0.1) !important;
    transform: translateY(-1px) !important;
    transition: all 0.2s ease !important;
}

/* Active tab styling */
.gradio-tabs > .tabs > .tab-nav > .tab-nav-item.selected,
.gradio-tabs .gradio-tabs > .tabs > .tab-nav > .tab-nav-item.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3) !important;
}

/* Responsive design for tabs */
@media (max-width: 768px) {
    .gradio-tabs > .tabs > .tab-nav > .tab-nav-item {
        font-size: 16px !important;
        padding: 10px 15px !important;
        min-height: 45px !important;
    }
    
    .gradio-tabs .gradio-tabs > .tabs > .tab-nav > .tab-nav-item {
        font-size: 14px !important;
        padding: 8px 12px !important;
        min-height: 40px !important;
    }
}

/* GitHub button hover effects */
.github-button {
    transition: all 0.3s ease !important;
}

.github-button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
    background: #e8e8e8 !important;
    border-color: #d0d0d0 !important;
}

/* Hugging Face button hover effects */
.huggingface-button {
    transition: all 0.3s ease !important;
}

.huggingface-button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
    background: #e8e8e8 !important;
    border-color: #d0d0d0 !important;
}

/* Header responsive design */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column !important;
        gap: 15px !important;
        text-align: center !important;
    }
    
    .header-container > div:first-child {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .header-container h1 {
        font-size: 2em !important;
    }
    
    .header-container span {
        font-size: 1em !important;
    }
    
    .github-button, .huggingface-button {
        align-self: center !important;
    }
    
    .header-container > div:last-child {
        flex-direction: column !important;
        gap: 8px !important;
    }
}