/* GO富集分析页面样式 */

/* 主容器样式 */
.content_container {
    padding: 140px 20px 20px 20px;
    min-height: calc(100vh - 160px);
}

/* 提交容器样式 */
.go_enrichment_submit_container {
    background-color: hsla(0, 0%, 100%, 0.9);
    border: 2px dashed #4fb479;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    position: relative;
    box-shadow: 0 4px 15px rgba(79, 180, 121, 0.1);
    transition: all 0.3s ease;
}

.go_enrichment_submit_container:hover {
    border-color: #488a63;
    box-shadow: 0 6px 20px rgba(79, 180, 121, 0.15);
}

/* 基因列表输入区域 */
.gene_list_input_container {
    margin-bottom: 25px;
}

.input_header {
    margin-bottom: 15px;
}

.input_header h3 {
    color: #488a63;
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.input_tips {
    color: #666;
    font-size: 14px;
    font-style: italic;
}

.input_wrapper {
    position: relative;
}

#gene_list_input {
    width: 100%;
    min-height: 200px;
    max-height: 400px;
    resize: vertical;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    font-family: 'Courier New', monospace;
    background-color: #fafff2;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

#gene_list_input:focus {
    border-color: #4fb479;
    outline: none;
    box-shadow: 0 0 10px rgba(79, 180, 121, 0.2);
}

#gene_list_input.drag_over {
    border-color: #4fb479;
    background-color: rgba(79, 180, 121, 0.05);
    box-shadow: 0 0 15px rgba(79, 180, 121, 0.3);
}

.clear_button {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: #e96a6a;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0;
    transform: scale(0.8);
}

#gene_list_input:not(:placeholder-shown) ~ .clear_button {
    opacity: 1;
    transform: scale(1);
}

.clear_button:hover {
    background-color: #d55555;
    transform: scale(1.1);
}

/* 示例按钮区域 */
.example_buttons_container,
.parameters_container,
.control_buttons_container {
    margin: 25px 0;
}

.section_header {
    color: #488a63;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0f4e8;
}

.example_button,
.upload_button {
    background: linear-gradient(135deg, #4fb479, #3a9b63);
    color: white;
    border: none;
    padding: 12px 20px;
    margin-right: 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(79, 180, 121, 0.3);
}

.example_button:hover,
.upload_button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 180, 121, 0.4);
}

/* 参数设置区域 */
.parameter_grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.parameter_item {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e0f4e8;
    transition: all 0.3s ease;
}

.parameter_item:hover {
    border-color: #4fb479;
    box-shadow: 0 2px 8px rgba(79, 180, 121, 0.1);
}

.parameter_item label {
    display: block;
    color: #488a63;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 14px;
}

.input_with_tooltip {
    position: relative;
    display: flex;
    align-items: center;
}

.parameter_item input,
.parameter_item select {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.parameter_item input:focus,
.parameter_item select:focus {
    border-color: #4fb479;
    outline: none;
    box-shadow: 0 0 5px rgba(79, 180, 121, 0.2);
}

.tooltip_icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #4fb479;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    margin-left: 10px;
    cursor: help;
    position: relative;
    transition: all 0.3s ease;
}

.tooltip_icon:hover {
    background-color: #3a9b63;
    transform: scale(1.1);
}

.tooltip_icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: normal;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    max-width: 250px;
    white-space: normal;
    text-align: center;
    line-height: 1.3;
}

.tooltip_icon::before {
    content: '';
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.tooltip_icon:hover::after,
.tooltip_icon:hover::before {
    opacity: 1;
    visibility: visible;
}

/* 控制按钮区域 */
.control_buttons_container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.submit_button,
.reset_button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.submit_button {
    background: linear-gradient(135deg, #4fb479, #3a9b63);
    color: white;
}

.submit_button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(79, 180, 121, 0.4);
}

.submit_button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.reset_button {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
}

.reset_button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(108, 117, 125, 0.4);
}

/* 加载遮罩层 */
.loading_overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    z-index: 1000;
}

.loading_overlay.active {
    display: flex;
}

.loading_content {
    text-align: center;
    color: #488a63;
}

.loading_spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e0f4e8;
    border-top: 4px solid #4fb479;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading_content p {
    margin: 10px 0;
    font-size: 18px;
    font-weight: 600;
}

.loading_subtitle {
    font-size: 14px !important;
    font-weight: 400 !important;
    color: #666 !important;
}

/* 结果展示容器 */
.go_enrichment_results_container {
    background-color: hsla(0, 0%, 100%, 0.95);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(79, 180, 121, 0.1);
    animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.results_header {
    margin-bottom: 25px;
    text-align: center;
}

.results_header h2 {
    color: #488a63;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 15px 0;
}

.results_summary {
    display: flex;
    justify-content: center;
    gap: 30px;
    color: #666;
    font-size: 14px;
}

.results_summary strong {
    color: #4fb479;
    font-weight: 600;
}

/* 结果标签页 */
.results_tabs {
    display: flex;
    border-bottom: 2px solid #e0f4e8;
    margin-bottom: 25px;
}

.tab_button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab_button.active {
    color: #4fb479;
    border-bottom-color: #4fb479;
    background-color: rgba(79, 180, 121, 0.05);
}

.tab_button:hover:not(.active) {
    color: #488a63;
    background-color: rgba(79, 180, 121, 0.03);
}

.tab_count {
    background-color: #4fb479;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.tab_button:not(.active) .tab_count {
    background-color: #ccc;
}

/* 结果内容区域 */
.results_content {
    position: relative;
}

.tab_content {
    visibility: hidden;
    height: 0;
    overflow: hidden;
}

.tab_content.active {
    visibility: visible;
    height: auto;
    overflow: visible;
}

/* 表格样式 */
.table_container {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    background-color: white;
}

/* 表格工具栏 */
.table_toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    gap: 15px;
    flex-wrap: wrap;
}

.table_toolbar_left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

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

.search_input {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    width: 250px;
    transition: border-color 0.3s ease;
}

.search_input:focus {
    border-color: #4fb479;
    outline: none;
    box-shadow: 0 0 5px rgba(79, 180, 121, 0.2);
}

.page_size_selector {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

.page_size_selector select {
    padding: 6px 8px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
}

.download_button {
    background: linear-gradient(135deg, #4fb479, #3a9b63);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.download_button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(79, 180, 121, 0.3);
}

/* 表格滚动容器 */
.table_scroll_container {
    overflow-x: auto;
    max-width: 100%;
}

.results_table {
    width: 100%;
    min-width: 1200px; /* 确保表格有最小宽度 */
    border-collapse: collapse;
    background-color: white;
    font-size: 14px;
}

.results_table thead {
    background: linear-gradient(135deg, #4fb479, #3a9b63);
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.results_table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    position: relative;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.results_table th:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.results_table th.sortable::after {
    content: '↕';
    margin-left: 8px;
    opacity: 0.5;
    font-size: 12px;
}

.results_table th.sort-asc::after {
    content: '↑';
    opacity: 1;
    color: #fff;
}

.results_table th.sort-desc::after {
    content: '↓';
    opacity: 1;
    color: #fff;
}

.results_table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.results_table tbody tr:hover {
    background-color: rgba(79, 180, 121, 0.05);
}

.results_table tbody tr:nth-child(even) {
    background-color: #fafff2;
}

.results_table tbody tr:nth-child(even):hover {
    background-color: rgba(79, 180, 121, 0.08);
}

/* GO ID链接样式 */
.results_table td:first-child a {
    color: #3498db;
    font-weight: 500;
    text-decoration: none;
}

.results_table td:first-child a:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* 数值格式化 */
.results_table td.numeric {
    font-family: 'Courier New', monospace;
    text-align: right;
}

/* 基因ID列样式 */
.gene_ids_cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    position: relative;
}

.gene_ids_cell:hover {
    background-color: rgba(79, 180, 121, 0.1);
    color: #4fb479;
}

.gene_ids_cell::after {
    content: 'Click to view all IDs';
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.gene_ids_cell:hover::after {
    opacity: 1;
    visibility: visible;
}

/* 基因ID弹窗 */
.gene_ids_modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.gene_ids_modal.show {
    display: flex;
}

.gene_ids_modal_content {
    background-color: white;
    border-radius: 12px;
    padding: 25px;
    max-width: 600px;
    max-height: 70vh;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideInUp 0.3s ease;
}

.gene_ids_modal_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0f4e8;
}

.gene_ids_modal_title {
    color: #488a63;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.gene_ids_modal_close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.gene_ids_modal_close:hover {
    background-color: #f0f0f0;
    color: #333;
}

.gene_ids_list_container {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background-color: #fafff2;
}

.gene_ids_list {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.8;
    color: #333;
    word-break: break-all;
}

.gene_id_item {
    display: inline-block;
    margin: 2px 8px 2px 0;
    padding: 4px 8px;
    background-color: #e0f4e8;
    border-radius: 4px;
    color: #488a63;
    transition: background-color 0.2s ease;
}

.gene_id_item:hover {
    background-color: #4fb479;
    color: white;
}

.gene_ids_modal_footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.copy_genes_button {
    background: linear-gradient(135deg, #4fb479, #3a9b63);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.copy_genes_button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(79, 180, 121, 0.3);
}

/* 分页器 */
.pagination_container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    flex-wrap: wrap;
    gap: 15px;
}

.pagination_info {
    color: #666;
    font-size: 14px;
}

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

.pagination_button {
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    background-color: white;
    color: #666;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s ease;
    min-width: 36px;
    text-align: center;
}

.pagination_button:hover:not(:disabled) {
    border-color: #4fb479;
    background-color: #4fb479;
    color: white;
}

.pagination_button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination_button.active {
    background-color: #4fb479;
    color: white;
    border-color: #4fb479;
}

.pagination_input {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}

.pagination_input:focus {
    border-color: #4fb479;
    outline: none;
}

.pagination_ellipsis {
    padding: 8px 4px;
    color: #999;
    font-size: 14px;
}

/* 空结果展示 */
.no_results {
    text-align: center;
    padding: 80px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    width: 100%;
    box-sizing: border-box;
}

.no_results img {
    width: 120px;
    height: 120px;
    margin: 0 auto 25px auto;
    display: block;
    object-fit: contain;
    /* 保持图片原有颜色，不添加opacity */
}

.no_results p {
    font-size: 18px;
    font-weight: 600;
    color: #488a63;
    margin: 0 auto;
    line-height: 1.5;
    text-align: center;
    max-width: 400px;
}

/* 加载状态 */
.table_loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.table_loading_spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #e0f4e8;
    border-top: 3px solid #4fb479;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .content_container {
        padding: 120px 10px 10px 10px;
    }
    
    .go_enrichment_submit_container {
        padding: 20px;
    }
    
    .parameter_grid {
        grid-template-columns: 1fr;
    }
    
    .control_buttons_container {
        flex-direction: column;
        align-items: center;
    }
    
    .results_summary {
        flex-direction: column;
        gap: 10px;
    }
    
    .results_tabs {
        flex-direction: column;
    }
    
    .tab_button {
        justify-content: center;
    }
    
    .table_toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .table_toolbar_left,
    .table_toolbar_right {
        justify-content: center;
    }
    
    .search_input {
        width: 100%;
    }
    
    .pagination_container {
        flex-direction: column;
        align-items: center;
    }
    
    .gene_ids_modal_content {
        width: 95%;
        margin: 10px;
    }
}

/* 文件拖拽效果 */
.drag_over {
    border-color: #4fb479 !important;
    background-color: rgba(79, 180, 121, 0.05) !important;
}

/* 输入验证样式 */
.parameter_item input.invalid {
    border-color: #e96a6a;
    box-shadow: 0 0 5px rgba(233, 106, 106, 0.3);
}

.parameter_item input.valid {
    border-color: #4fb479;
    box-shadow: 0 0 5px rgba(79, 180, 121, 0.3);
}

/* 图表区域样式 */
.charts_container {
    margin-top: 25px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    animation: slideInUp 0.5s ease-out;
}

.charts_header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0f4e8;
}

.charts_header h4 {
    color: #488a63;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.charts_wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    min-height: 500px;
    width: 100%;
}

.chart_item {
    background-color: #fafff2;
    border: 1px solid #e0f4e8;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.chart_item:hover {
    border-color: #4fb479;
    box-shadow: 0 4px 12px rgba(79, 180, 121, 0.15);
}

.chart_title {
    text-align: center;
    color: #488a63;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0f4e8;
}

.chart_container {
    width: 100%;
    height: 450px;
    min-height: 450px;
    min-width: 300px;
    background: linear-gradient(135deg, #ffffff 0%, #fafff2 100%);
    border-radius: 6px;
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.chart_container:hover {
    box-shadow: 0 2px 8px rgba(79, 180, 121, 0.1);
}

/* 图表加载状态 */
.chart_loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #488a63;
}

.chart_loading_spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e0f4e8;
    border-top: 3px solid #4fb479;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.chart_loading_text {
    font-size: 14px;
    color: #666;
}

/* 动画效果 */
.fade_in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide_up {
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 响应式图表设计 */
@media (max-width: 1200px) {
    .charts_wrapper {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .chart_container {
        height: 400px;
        min-height: 400px;
    }
}

@media (max-width: 768px) {
    .charts_container {
        padding: 15px;
        margin-top: 20px;
    }
    
    .chart_container {
        height: 350px;
        min-height: 350px;
    }
    
    .charts_header h4 {
        font-size: 18px;
    }
    
    .chart_title {
        font-size: 14px;
    }
}

