/* Main layout */
.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 20px;
    overflow: hidden;
    background-color: #f0f2f5;
}

header {
    background: #fff;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    border-radius: 4px;
}

header h1 {
    margin: 0;
    text-align: center;
    color: #333;
}

main {
    display: flex;
    flex: 1;
    gap: 20px;
    overflow: hidden;
    min-height: 0; /* Important for Firefox */
}

/* Sidebar */
.sidebar {
    width: 250px;
    min-width: 200px;
    max-width: 300px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.disease-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.disease-list h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.disease-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.disease-list li {
    padding: 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.disease-list li:hover {
    background-color: #f0f0f0;
}

.disease-list li.active {
    background-color: #e6f7ff;
    font-weight: bold;
}

/* Main content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    min-width: 0;
    overflow: hidden;
    min-height: 0; /* Important for Firefox */
}

.controls {
    display: flex;
    gap: 10px;
    padding: 10px;
    align-items: center;
    border-bottom: 1px solid #ddd;
    flex-shrink: 0; /* Prevent controls from shrinking */
}

button {
    padding: 4px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}

button:hover {
    background: #f0f0f0;
}

button.active {
    background: #1890ff;
    color: #fff;
    border-color: #1890ff;
}

/* Graph container */
#graphContainer {
    flex: 1;
    min-height: 0;
    position: relative;
    width: 200%;
    height: 200%;
    overflow: hidden;
}

/* Tooltip */
.tooltip {
    position: absolute;
    display: none;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
    pointer-events: none;
    z-index: 1000;
    max-width: 300px;
    word-wrap: break-word;
}

/* Pathway info */
.pathway-info {
    position: absolute;
    top: 60px;
    left: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
    max-width: 300px;
    display: none;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 5px;
    margin-left: auto;
}

.pagination button {
    padding: 5px 10px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 4px;
}

.pagination button.active {
    background: #1890ff;
    color: white;
    border-color: #1890ff;
}

.view-controls {
    display: flex;
    gap: 10px;
    margin-left: 20px;
}

.view-controls button {
    padding: 5px 10px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 4px;
}

.view-controls button.active {
    background: #1890ff;
    color: white;
    border-color: #1890ff;
}

/* Loading spinner */
.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    color: #666;
}
