/* Hematopoiesis Explorer - Custom Styles */

/* Theme colors - Blood/Hematopoiesis */
[data-theme="hematopoiesis"] {
    --primary-color: #e74c3c;
    --primary-hover: #c0392b;
    --accent-color: #d35400;
    --background-gradient-start: #e74c3c;
    --background-gradient-end: #c0392b;
}

/* Container & Layout */
.container {
    max-width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar Tree Navigation */
.sidebar {
    width: 400px;
    background: white;
    border-right: 1px solid #ddd;
    overflow-y: auto;
    padding: 1rem;
}

.tree-container {
    font-size: 0.95rem;
    user-select: none;
}

/* Tree Node Structure */
.tree-node {
    margin: 0.25rem 0;
}

.tree-children {
    margin-left: 1.2rem;
    border-left: 2px solid #ecf0f1;
    padding-left: 0.5rem;
}

.tree-node.collapsed .tree-children {
    display: none;
}

/* Tree Node Headers */
.tree-node-header {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

.tree-node-header:hover {
    background: #ecf0f1;
}

.tree-node.selected > .tree-node-header {
    background: #3498db;
    color: white;
}

/* Level-based styling */
.tree-node[data-depth="0"] > .tree-node-header {
    font-weight: 700;
    font-size: 1.1rem;
    color: #2c3e50;
    background: #ecf0f1;
}

.tree-node[data-depth="1"] > .tree-node-header {
    font-weight: 600;
    font-size: 1rem;
    color: #34495e;
}

.tree-node[data-depth="2"] > .tree-node-header {
    font-weight: 500;
    font-size: 0.95rem;
    color: #7f8c8d;
}

.tree-node[data-depth="3"] > .tree-node-header {
    font-weight: 400;
    font-size: 0.9rem;
    color: #95a5a6;
}

/* Tree Icons */
.tree-icon {
    font-size: 0.7rem;
    margin-right: 0.5rem;
    transition: transform 0.2s;
}

.tree-node.collapsed .tree-icon {
    transform: rotate(0deg);
}

.tree-icon-spacer {
    display: inline-block;
    width: 12px;
    margin-right: 0.5rem;
}

.tree-node-icon {
    font-size: 1rem;
    margin-right: 0.5rem;
}

.tree-label {
    flex: 1;
}

/* Info Icon */
.info-icon {
    margin-left: auto;
    font-size: 1.2rem;
    color: #3498db;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    transition: transform 0.2s, color 0.2s;
    opacity: 0.7;
}

.info-icon:hover {
    opacity: 1;
    transform: translateX(3px);
    color: #2980b9;
}

.tree-node.selected .info-icon {
    color: white;
    opacity: 1;
}

/* Detail Panel */
.detail-panel {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background: #fafafa;
}

.placeholder {
    text-align: center;
    margin-top: 4rem;
    color: #7f8c8d;
}

.placeholder h2 {
    margin-bottom: 1rem;
    color: #34495e;
}

.placeholder p {
    margin: 0.5rem 0;
}

.placeholder ul {
    text-align: left;
    max-width: 600px;
    margin: 1.5rem auto;
    line-height: 1.8;
}

.placeholder li {
    margin: 0.5rem 0;
}

/* Cell Detail View */
.cell-detail {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 900px;
    margin: 0 auto;
}

.cell-name {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* Lineage Detail View */
.lineage-detail {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 1000px;
    margin: 0 auto;
}

.lineage-name {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 600;
}

.lineage-overview {
    background: #f8f9fa;
    border-radius: 4px;
    padding: 1rem;
}

/* Lineage Stages */
.lineage-stages {
    margin: 2rem 0;
}

.lineage-stages > h2 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--primary-color);
}

.lineage-stage {
    margin: 2rem 0;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    background: #fafafa;
}

.stage-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #dee2e6;
}

.stage-number {
    background: #6c757d;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.stage-name {
    font-size: 1.3rem;
    color: #2c3e50;
    margin: 0;
    font-weight: 600;
}

.stage-section {
    margin: 1.25rem 0;
}

.stage-section h4 {
    color: #495057;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stage-section p {
    line-height: 1.8;
    color: #2c3e50;
    margin: 0.5rem 0;
}

.stage-section ul {
    margin-left: 2rem;
    line-height: 1.8;
}

.stage-section li {
    margin: 0.5rem 0;
    color: #2c3e50;
}

.stage-section strong {
    color: #2c3e50;
    font-weight: 600;
}

.stage-pearls {
    background: #fff8e1;
    border-left: 4px solid #ffa726;
    padding: 1rem;
    border-radius: 4px;
}

.stage-pearls h4 {
    color: #f57c00;
}

.stage-pearls li {
    font-weight: 500;
    color: #2c3e50;
}

.cell-lineage-badge {
    display: inline-block;
    color: #7f8c8d;
    padding: 0.25rem 0;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.cell-lineage-badge-small {
    display: inline-block;
    background: #ecf0f1;
    color: #7f8c8d;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    margin: 0.5rem 0;
}

.detail-section {
    margin: 2rem 0;
}

.detail-section h2 {
    color: #34495e;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
    font-weight: 600;
}

.detail-section p {
    line-height: 1.8;
    color: #2c3e50;
    margin: 0.75rem 0;
}

.detail-section ul {
    margin-left: 2rem;
    line-height: 1.8;
}

.detail-section li {
    margin: 0.5rem 0;
    color: #2c3e50;
}

.detail-section strong {
    color: #2c3e50;
    font-weight: 600;
}

/* Step 1 Pearls - Special Highlight */
.step1-pearls {
    background: #fff8e1;
    border-left: 4px solid #ffa726;
    padding: 1rem;
    border-radius: 4px;
    margin: 2rem 0;
}

.step1-pearls h2 {
    color: #f57c00;
    border-bottom: none;
    padding-bottom: 0;
}

.step1-pearls li {
    font-weight: 500;
    color: #2c3e50;
}

/* Tags (Markers, Transcription Factors, etc.) */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.tag {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.tag-marker {
    background: #f8f9fa;
    color: #495057;
    border-color: #dee2e6;
}

.tag-tf {
    background: #f8f9fa;
    color: #495057;
    border-color: #dee2e6;
}

.tag-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border: 1px solid var(--primary-color);
    border-radius: 12px;
    background: #fff5f5;
    color: var(--primary-color);
}

/* Cytokine & Granule Lists */
.cytokine-list, .granule-contents {
    margin-top: 1rem;
}

.cytokine-category, .granule-category {
    margin: 1rem 0;
}

.cytokine-category ul, .granule-category ul {
    margin-top: 0.5rem;
    margin-left: 1rem;
}

/* Cell Grid (for search results and lineage views) */
.cell-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.cell-card {
    padding: 1.5rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.cell-card:hover {
    border-color: #adb5bd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cell-card h3 {
    color: #2c3e50;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.cell-summary {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-top: 0.75rem;
}

.cell-markers-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0.75rem 0;
}

/* Search Results */
.search-results {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 1200px;
    margin: 0 auto;
}

.search-results h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

/* Error Message */
.error-message {
    text-align: center;
    padding: 3rem;
    color: #e74c3c;
}

.error-message h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* Modal Overrides */
.modal-content {
    max-width: 600px;
}

.modal-content h2 {
    color: var(--primary-color);
}

.modal-content h3 {
    color: var(--primary-color);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

/* Header Button Styling */
.header-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
    margin-top: 1rem;
}

.header-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

/* Responsive */
@media (max-width: 968px) {
    .main-content {
        grid-template-columns: 1fr;
        height: auto;
    }

    .sidebar {
        max-height: 400px;
    }

    .cell-name {
        font-size: 2rem;
    }

    .cell-grid {
        grid-template-columns: 1fr;
    }
}

/* Scrollbar Styling */
.sidebar::-webkit-scrollbar,
.detail-panel::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track,
.detail-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb,
.detail-panel::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.detail-panel::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}
