.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #ddd;
    padding: 50px 0;
    text-align: center;
    height: auto;
    margin-bottom: 40px;
}

.content-container {
    display: flex;
    flex: 1;
    padding: 20px;
    gap: 20px;
    margin-bottom: 80px;
}
/* 🎯 Tooltip 스타일 - 클릭 가능하도록 수정 */
#tooltip {
    pointer-events: auto !important; /* 클릭 및 상호작용 허용 */
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* group_dropdown 내부 value pill 색상 */
.group-dropdown .Select__multi-value {
    background-color: rgba(52, 152, 219, 0.15); /* soft blue */
    border: 1px solid rgba(52, 152, 219, 0.25);
    border-radius: 3px;
    padding: 1px 3px;
  }
  
  /* value 텍스트 */
  .group-dropdown .Select__multi-value__label {
    color: #2c3e50;
    font-weight: 500;
  }
  
  /* value 삭제 버튼 색상 */
  .group-dropdown .Select__multi-value__remove {
    color: #007bff;
    transition: color 0.2s;
  }
  .group-dropdown .Select__multi-value__remove:hover {
    color: #e74c3c;
  }
  
#pedigree-cytoscape .cy-node:hover {
    cursor: pointer !important;
}
.sidebar {
    width: 35%;
    background-color: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    border: 1px solid #dee2e6;
    min-height: 700px;
    max-height: calc(100vh - 150px);
}

.filter-section-title {
    background-color: #f8f9fa;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.filter-section-title h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
}

.filter-block {
    background-color: white;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #dee2e6;
}

.filter-content {
    margin-bottom: 10px;
    font-size: 14px;
}

.filter-title {
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 16px;
    color: #2c3e50;
}

.filter-btn-container {
    display: flex;
    justify-content: flex-start;
    margin-top: 10px;
    padding-left: 15px;
}

.add-filter-btn {
    width: auto;
    min-width: 100px;
    margin-bottom: 10px;
}

.apply-btn-container {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

.apply-all-btn {
    width: auto;
    min-width: 100px;
}

.filter-container {
    overflow-y: auto;
}

/* Breadcrumb 스타일 */
.breadcrumb-separator {
    margin: 0 8px;
    color: #6c757d;
    font-weight: bold;
}

.breadcrumb-item-container {
    display: inline-flex;
    align-items: center;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 4px 8px;
    margin: 2px;
}

.breadcrumb-item {
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    margin-right: 8px;
}

.breadcrumb-remove-btn {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    margin: 0;
    line-height: 1;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.breadcrumb-remove-btn:hover {
    background-color: #f8d7da;
    color: #721c24;
}
    

.scrollable-filters {
    overflow-y: auto;
    min-height: 400px;
    max-height: calc(100vh - 400px);
    padding-right: 10px;
    margin-right: -10px;
}
/* Bar 영역만 클릭 커서 */
.js-plotly-plot .barlayer .point path {
    cursor: pointer !important;
  }
  
  .js-plotly-plot .scatterlayer path,
  .js-plotly-plot .scatterlayer .point {
    cursor: pointer !important;
  }



.main-content {
    width: 65%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-bottom: 60px;
    background-color: #ffffff;
}

.result-section-title {
    background-color: #f8f9fa;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.result-section-title h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
}

.result-section {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid #dee2e6;
}

.result-content {
    background-color: white;
    padding: 15px;
    border-radius: 6px;
    margin-top: 10px;
}

/* 테이블 컨테이너 스타일 */
.table-container {
    margin: auto;
    width: 95%;
    padding: 20px;
}

.table-title {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

/* 테이블 기본 스타일 */
.dash-table-container {
    margin: 20px 0;
}

/* 테이블 레이아웃 */
.dash-spreadsheet-container {
    width: 100% !important;
    overflow-x: auto !important;
}

/* 테이블 헤더 */
.dash-header {
    background-color: rgb(230, 230, 230) !important;
    font-weight: bold !important;
    text-align: center !important;
    padding: 12px !important;
}

/* 테이블 셀 공통 스타일 */
.dash-cell {
    text-align: center !important;
    padding: 10px !important;
    min-width: 100px !important;
    max-width: 300px !important;
    white-space: normal !important;
    height: auto !important;
}

/* 링크 스타일 */
.dash-cell-value a {
    color: #0066cc !important;
    text-decoration: none !important;
    display: block !important;
    text-align: center !important;
}

.dash-cell-value a:hover {
    text-decoration: underline !important;
}

/* 짝수/홀수 행 배경색 */
.dash-spreadsheet-inner tr:nth-child(even) {
    background-color: rgb(248, 248, 248) !important;
}

.dash-filter input {
    text-align: center !important;
    padding: 8px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
}

/* 페이지네이션 스타일 */
.dash-table-container .previous-next-container button {
    background-color: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    color: #495057 !important;
    padding: 6px 12px !important;
    margin: 0 4px !important;
    border-radius: 4px !important;
}

.dash-table-container .previous-next-container button:hover {
    background-color: #e9ecef !important;
}

/* Dash 디버그 메뉴 숨기기 */
.dash-debug-menu {
    display: none !important;
}

/* 테이블 필터 입력창 스타일 수정 */
.dash-table-container .dash-spreadsheet tr th input[type="text"] {
    border: 1px solid #dee2e6 !important;
    border-radius: 4px !important;
    padding: 8px 12px !important;
    width: 100% !important;
    font-size: 14px !important;
    color: #495057 !important;
    background-color: #fff !important;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05) !important;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
}

.dash-table-container .dash-spreadsheet tr th input[type="text"]:focus {
    border-color: #80bdff !important;
    outline: 0 !important;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25) !important;
}

/* 필터 헤더 스타일 */
.dash-table-container .dash-spreadsheet .dash-filter {
    background-color: #f8f9fa !important;
    border-bottom: 1px solid #dee2e6 !important;
    padding: 8px 4px !important;
}

/* placeholder 텍스트 스타일 */
.dash-table-container .dash-spreadsheet tr th input[type="text"]::placeholder {
    color: #adb5bd !important;
    font-style: italic !important;
}

/* footer 스타일 수정 */
.fixed-bottom {
    position: fixed;
    bottom: 0;
    width: 100%;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 15px 0;
    z-index: 1000;
}

/* pulse animation moved to line 672 with refined scaling */

.history-counter {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    animation: pulse 1s ease-in-out;
}

.history-button {
    transition: all 0.3s ease;
}

.history-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* 테이블 셀 내의 p 태그 스타일 재정의 */
.dash-cell p {
    margin: 0 !important;
    padding: 0 !important;
}

/* 더 구체적인 선택자로 마크다운 링크를 포함하는 p 태그도 처리 */
.dash-table-container .dash-spreadsheet td.dash-cell p {
    margin: 0 !important;
    padding: 0 !important;
}

/* 드롭다운과 버튼 스타일 통일 */
.dash-dropdown .Select-control {
    font-size: 14px !important;
}

.btn {
    font-size: 14px !important;
}

/* 필터 블록 내 텍스트 크기 통일 */
.filter-block label {
    font-size: 14px !important;
    color: #495057;
    font-weight: 500;
}

.filter-block .dash-dropdown {
    font-size: 14px !important;
}

/* 결과 통계 텍스트 스타일 */
.result-stats {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 10px;
}

/* 필터 결과 텍스트 상단 여백 추가 */
.filter-result-text {
    margin-top: 15px !important;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
}

/* Trait Title Button Styles */
.trait-title-btn {
    transition: all 0.3s ease !important;
    font-size: 11px !important;
    font-weight: bold !important;
    
    border-radius: 8px !important;
    
    cursor: pointer !important;
}

/* Trait Graph Container Styles */
.trait-graph-container:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    border-color: #007bff !important;
    transform: translateY(-2px) !important;
}

/* Individual Trait Plot Styles */
.trait-individual-plot {
    width: 100%;
    height: 300px;
    border-radius: 8px;
    overflow: hidden;
}

/* Flexbox Layout for Trait Plots */
.trait-plots-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 15px;
    width: 100%;
}

.trait-plot-item {
    flex: 0 0 calc(33.333% - 20px);
    min-width: 250px;
    max-width: calc(33.333% - 20px);
    padding: 15px;
    margin: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background-color: #fafafa;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.trait-plot-item:hover {
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
    border-color: #007bff;
    transform: translateY(-3px);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .trait-plot-item {
        flex: 0 0 calc(50% - 20px);
        max-width: calc(50% - 20px);
    }
}

@media (max-width: 768px) {
    .trait-plot-item {
        flex: 0 0 calc(100% - 20px);
        max-width: calc(100% - 20px);
    }
}

/* =============================================================================
 * 🎨 ENHANCED TRAIT COLOR MAPPING STYLES
 * ============================================================================= */

/* 🚫 "Trait Color Mapping Available" 텍스트 숨기기 */
.trait-color-mapping-available,
#trait-color-mapping-text,
div[id*="trait-color-mapping-available"] {
    display: none !important;
    visibility: hidden !important;
}

/* 🎯 30% width trait name spans - 클릭 가능한 trait 이름들 */
.trait-clickable-span {
    width: 30% !important;
    display: inline-block !important;
    margin: 4px !important;
    padding: 8px 12px !important;
    background-color: #e9ecef !important;
    border-radius: 20px !important;
    border: 2px solid #007bff !important;
    font-size: 13px !important;
    font-weight: bold !important;
    color: #007bff !important;
    text-align: center !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-sizing: border-box !important;
}

.trait-clickable-span:hover {
    background-color: #007bff !important;
    color: white !important;
    transform: scale(1.05) !important;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3) !important;
}

.trait-clickable-span:active {
    transform: scale(0.95) !important;
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.5) !important;
}

/* 📊 일반 차트 컨테이너 스타일 */
.trait-plots-container {
    display: inline-block !important;
    vertical-align: top !important;
    margin: 0 1.5% !important;
    max-height: 600px !important;
    overflow-y: auto !important;
    padding: 15px !important;
    background-color: #ffffff !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    border: 2px solid #e9ecef !important;
}

/* 📊 개별 trait 그래프 컨테이너 스타일 */
.trait-graph-container {
    margin-bottom: 20px !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 10px !important;
    padding: 12px !important;
    background-color: #fafafa !important;
    transition: all 0.3s ease !important;
}

.trait-graph-container:hover {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15) !important;
    border-color: #007bff !important;
    transform: translateY(-2px) !important;
}

/* 🔘 클릭 가능한 trait 제목 버튼 스타일 개선 */


.trait-title-btn:active {
    transform: scale(0.98) !important;
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.5) !important;
}

/* 📈 개별 trait 플롯 스타일 */
.trait-individual-plot {
    width: 100% !important;
    height: 280px !important;
    border-radius: 6px !important;
    overflow: hidden !important;
}

/* 🎨 범례 영역 스타일 개선 */
#trait-legend-section {
    padding: 20px !important;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border-radius: 12px !important;
    border: 2px solid #dee2e6 !important;
    margin-bottom: 25px !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.4s ease !important;
}

#trait-legend-section:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15) !important;
    transform: translateY(-2px) !important;
}

#trait-legend-content {
    animation: fadeInUp 0.5s ease-out !important;
}

/* 📱 반응형 미디어 쿼리 */
@media (max-width: 1200px) {
    .trait-plots-container {
        width: 45% !important;
        margin: 0 2.5% !important;
    }
    
    .trait-clickable-span {
        width: 45% !important;
    }
}

@media (max-width: 768px) {
    .trait-plots-container {
        width: 95% !important;
        margin: 0 2.5% 20px 2.5% !important;
        display: block !important;
    }
    
    .trait-clickable-span {
        width: 95% !important;
        margin: 2px !important;
        display: block !important;
    }
}

/* 🎯 범주형 데이터 시각화 개선 */
.categorical-marker {
    font-size: 14px !important;
    font-weight: bold !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3) !important;
}

/* ✨ 애니메이션 효과 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* 🔄 클릭 효과 애니메이션 */


/* 📊 스크롤바 커스터마이징 */
.trait-plots-container::-webkit-scrollbar {
    width: 8px;
}

.trait-plots-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.trait-plots-container::-webkit-scrollbar-thumb {
    background: #007bff;
    border-radius: 10px;
}

.trait-plots-container::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

/* 🎨 노드 색상 매핑 강화 - stroke와 fill 분리 */
.pedigree-node.color-mapped {
    stroke-width: 3px !important;
    stroke: #34495e !important;
    stroke-opacity: 1 !important;
}

.pedigree-node.color-mapped:hover {
    stroke-width: 4px !important;
    stroke: #2c3e50 !important;
}

/* 🔍 선택된 노드 특별 표시 */
.pedigree-node.selected.color-mapped {
    stroke-width: 5px !important;
    stroke: #e74c3c !important;
    filter: drop-shadow(0 0 8px rgba(231, 76, 60, 0.6)) !important;
}
/* 🚩 COMPLETELY REDESIGNED PEDIGREE NODE STYLES - TRAIT COLOR PRIORITY */

/* ========================================
   🎯 TRAIT COLOR SYSTEM - BASE RULES
   ======================================== */

/* 1️⃣ 기본 trait-colored 노드 - 모든 trait 노드에 일관 적용 */
.pedigree-node.trait-colored {
    /* Trait color will be set via CSS variables or inline styles */
    background-opacity: 0.9;
    border-width: 3px;
    border-style: solid;
    z-index: 1000;
    transition: all 0.3s ease;
}

/* ========================================
   🎯 NODE STATE COMBINATIONS
   ======================================== */

/* 2️⃣ Search/Selected + Trait: Pink background + Trait border */
.pedigree-node.selected.trait-colored,
.pedigree-node.search-result.trait-colored {
    background-color: #ffc0cb !important; /* Pink fill 유지 */
    /* Trait color border will be applied via CSS variables */
    border-width: 5px !important;
    border-style: solid !important;
    box-shadow: 0 0 0 2px #dc3545 inset !important; /* Red selection indicator */
    z-index: 1001 !important;
}

/* 3️⃣ Expanded + Trait: Trait background + Green border */
.pedigree-node.expanded.trait-colored {
    /* Trait color background will be applied via CSS variables */
    border-color: #28a745 !important; /* Green border 유지 */
    border-width: 4px !important;
    border-style: solid !important;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.6) !important;
    z-index: 1002 !important;
}

/* 4️⃣ Child/Trait + Trait: Orange background preserved */
.pedigree-node.trait.trait-colored {
    background-color: #fd7e14 !important; /* Orange fill 유지 */
    border-color: #e07c03 !important;
    border-width: 3px !important;
    border-style: solid !important;
    z-index: 997 !important;
}

/* ========================================
   🎯 STATE-ONLY RULES (without trait-colored)
   ======================================== */

/* Selected/Search nodes without trait colors */
.pedigree-node.selected:not(.trait-colored),
.pedigree-node.search-result:not(.trait-colored) {
    background-color: #ffc0cb;
    border-color: #dc3545;
    border-width: 4px;
    border-style: solid;
    z-index: 999;
    box-shadow: 0 0 8px rgba(220, 53, 69, 0.6);
}

/* Expanded nodes without trait colors */
.pedigree-node.expanded:not(.trait-colored) {
    border-color: #28a745;
    border-width: 4px;
    border-style: solid;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.6);
    z-index: 1000;
}

/* Child/Trait nodes without trait colors */
.pedigree-node.trait:not(.trait-colored) {
    background-color: #fd7e14;
    border-color: #e07c03;
    border-width: 3px;
    border-style: solid;
    z-index: 997;
}

/* ========================================
   🎯 DEFAULT PEDIGREE NODE STYLES
   ======================================== */

.pedigree-node {
    background-color: #4A90E2;
    border-color: #357ABD;
    border-width: 2px;
    border-style: solid;
    color: white;
    text-valign: center;
    text-halign: center;
    font-size: 12px;
    shape: ellipse;
    width: 80px;
    height: 40px;
    z-index: 900;
    transition: all 0.3s ease;
}

/* Hover effects */
.pedigree-node:hover {
    transform: scale(1.05);
    z-index: 1010;
}

/* ========================================
   🎯 RESET VIEW BUTTON
   ======================================== */

#reset-view-button {
    position: fixed;
    top: 120px;
    right: 20px;
    z-index: 1100;
    background-color: rgba(255, 255, 255, 0.95);
    border: 2px solid #007bff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    color: #007bff;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#reset-view-button:hover {
    background-color: #007bff;
    color: white;
    transform: scale(1.05);
}

#reset-view-button:active {
    transform: scale(0.95);
}

#reset-view-button .fas {
    line-height: 46px;
}

#reset-view-button:hover .fas {
    animation: spin 0.5s linear;
}

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