* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 30px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    font-size: 2.5rem;
    color: #1a4d1b;  /* Match deepest green */
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    color: #666;
}

.project-info {
    background: #f0f7f0;
    border-left: 4px solid #1a4d1b;
    border-radius: 4px;
    padding: 15px 20px;
    margin: 20px auto 0;
    max-width: 900px;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #444;
}

.project-info p {
    margin: 0 0 10px 0;
}

.project-info p:last-child {
    margin-bottom: 0;
}

.main-content {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.sidebar {
    flex-shrink: 0;
    width: 200px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.panel {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.panel h3 {
    margin: 0 0 12px 0;
    font-size: 1rem;
    color: #1a4d1b;  /* Match deepest green */
    border-bottom: 2px solid #1a4d1b;
    padding-bottom: 8px;
}

/* Legend styles */
.legend-note {
    font-size: 0.75rem;
    color: #666;
    font-style: italic;
    margin: -8px 0 8px 0;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.legend-circle-order {
    fill: hsl(120, 40%, 20%);  /* Dark green for order */
}

.legend-circle-family {
    fill: hsl(120, 50%, 30%);  /* Family example - dark */
}

.legend-circle-genus {
    fill: hsl(120, 45%, 50%);  /* Genus example - medium */
}

.legend-circle-species {
    fill: hsl(120, 40%, 70%);  /* Species example - light */
}

/* Stats styles */
.stats-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.stat-label {
    color: #666;
}

.stat-value {
    font-weight: bold;
    color: #1a4d1b;  /* Match deepest green */
}

.stat-item.stat-secondary {
    font-size: 0.8rem;
    padding-left: 10px;
    border-left: 2px solid #e0e0e0;
    margin-left: 5px;
}

.stat-item.stat-secondary .stat-label {
    color: #888;
    font-style: italic;
}

.stat-item.stat-secondary .stat-value {
    color: #666;
    font-weight: normal;
}

/* Controls styles */
.controls-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toggle-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 8px;
}

.radio-option {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 6px;
    border-radius: 4px;
    transition: background 0.2s;
}

.radio-label:hover {
    background: #f0f0f0;
}

.radio-label input[type="radio"] {
    margin-right: 8px;
    cursor: pointer;
}

.radio-hint {
    font-size: 0.7rem;
    color: #888;
    margin: 0 0 0 30px;
    font-style: italic;
}

.reset-button {
    background: #1a4d1b;  /* Deep forest green */
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 15px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.reset-button:hover {
    background: #2d7a30;  /* Medium forest green on hover */
}

.reset-button:active {
    background: #0f3310;  /* Even darker on click */
}

.hint {
    font-size: 0.8rem;
    color: #888;
    text-align: center;
    margin: 0;
}

#visualization {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* SVG styling */
.node circle {
    fill: #69b578;
    cursor: pointer;
    transition: all 0.3s ease;
}

.node circle:hover {
    fill: #85d196;
}

.node text {
    font-size: 11px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    pointer-events: none;
}

.link {
    fill: none;
    stroke: #999;
    stroke-opacity: 0.6;
    stroke-width: 1.5px;
}

/* Tooltip */
.tooltip {
    position: absolute;
    padding: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 1000;
}

.tooltip.visible {
    opacity: 1;
}

.tooltip .taxon-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.tooltip .taxon-metadata {
    font-size: 10px;
    font-weight: 300;
    color: #ccc;
    margin-bottom: 3px;
}

.tooltip .taxon-counts {
    font-size: 10px;
    color: #bbb;
    margin-bottom: 5px;
    padding: 4px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tooltip .taxon-level {
    font-size: 10px;
    color: #aaa;
}
