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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

h1 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.subtitle {
    color: #7f8c8d;
    font-size: 1.1em;
}

main {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
}

#hive-plot {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px;
    min-height: 600px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Add this new styling for the selection overlay */
#selection-overlay {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #3498db;
    border-radius: 8px;
    padding: 15px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    max-width: 400px;
    text-align: center;
    z-index: 10;
}

#selection-overlay.visible {
    opacity: 1;
    visibility: visible;
}

#selection-overlay .close-btn {
    position: absolute;
    top: 5px;
    right: 8px;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #7f8c8d;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#selection-overlay .close-btn:hover {
    color: #e74c3c;
}

#legend, #info-panel {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px;
}

#legend {
    grid-column: 2;
    grid-row: 1;
}

#info-panel {
    grid-column: 2;
    grid-row: 2;
}

#info-panel h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

#selection-info {
    margin-top: 15px;
    padding: 10px;
    background: #ecf0f1;
    border-radius: 4px;
    min-height: 50px;
    font-size: 0.9em;
}

/* Hive plot styling */
.axis-line {
    stroke: #95a5a6;
    stroke-width: 2;
}

.axis-label {
    font-size: 14px;
    font-weight: bold;
    fill: #2c3e50;
}

.node {
    stroke: white;
    stroke-width: 2;
    cursor: pointer;
    transition: r 0.2s;
}

.node:hover {
    stroke-width: 3;
}

.link {
    fill: none;
    stroke-opacity: 0.3;
    stroke-width: 1.5;
    transition: stroke-opacity 0.2s;
    cursor: pointer;
}

.link:hover {
    stroke-opacity: 0.8;
    stroke-width: 2.5;
}

.link.highlighted {
    stroke-opacity: 1;
    stroke-width: 3;
    stroke-dasharray: 5,5;
    animation: dash 1s linear infinite;
}

@keyframes dash {
    to {
        stroke-dashoffset: -10;
    }
}

.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;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 10px;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.legend-label {
    font-size: 14px;
    color: #2c3e50;
}

@media (max-width: 1024px) {
    main {
        grid-template-columns: 1fr;
    }

    #legend, #info-panel {
        grid-column: 1;
    }
}