/* style.css */

:root {
    --bg: #121212;
    --card-bg: #1e1e24;
    --text: #ffffff;
    --color-50: #00b894;
    --color-70: #fdcb6e;
    --color-80: #e17055;
    --color-90: #0984e3;
    --color-00: #a29bfe;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    margin: 0;
}

/* HEADER */
.sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(18, 18, 18, 0.95);
    border-bottom: 1px solid #333;
    padding: 0.8rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    backdrop-filter: blur(5px);
}

.sticky-header h1 {
    margin: 0 0 10px 0;
    font-family: 'Anton', sans-serif;
    letter-spacing: 1px;
    font-size: 1.5rem;
    text-transform: uppercase;
}

.legend-bar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    color: #000;
}
.era-50 { background: var(--color-50); }
.era-70 { background: var(--color-70); }
.era-80 { background: var(--color-80); }
.era-90 { background: var(--color-90); }
.era-00 { background: var(--color-00); }
.hof-badge { background: transparent; color: gold; border: 1px solid gold; color: #fff; }

/* SCROLL WRAPPER */
.scroll-wrapper {
    width: 100vw;
    height: 100vh;
    overflow: auto;
    padding-top: 100px;
    position: relative;
    -webkit-overflow-scrolling: touch; 
}

/* GRID CONTAINER */
.timeline-grid {
    display: grid;
    gap: 60px 50px;
    padding: 200px 140px 350px;
    justify-content: start;
    grid-auto-rows: 60px; 
    grid-auto-columns: 220px;
    min-width: max-content;
    margin: 0 auto;
    position: relative; 
}

/* SVG CONNECTION LAYER */
#connections-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1; 
    overflow: visible;
}

.connection-line {
    fill: none;
    stroke: rgba(255, 255, 255, 0.2); 
    stroke-width: 2px;
    stroke-linecap: round;
    transition: all 0.3s ease;
}

.connection-line.active {
    stroke: #ffeb3b;
    stroke-width: 4px;
    opacity: 1;
    filter: drop-shadow(0 0 5px rgba(255, 235, 59, 0.7));
    position: relative; 
    z-index: 100;
}

.connection-line.dimmed {
    stroke: rgba(255, 255, 255, 0.05);
    opacity: 0.1;
}

/* --- CARDS --- */
.music-node {
    background: var(--card-bg);
    border: 1px solid #333;
    border-radius: 6px;
    position: relative; 
    transition: all 0.3s ease;
    z-index: 10; 
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    height: fit-content;
    width: 100%;
    overflow: visible; 
}

/* Borders */
.music-node.era_50_60 { border-top: 4px solid var(--color-50); }
.music-node.era_70    { border-top: 4px solid var(--color-70); }
.music-node.era_80    { border-top: 4px solid var(--color-80); }
.music-node.era_90    { border-top: 4px solid var(--color-90); }
.music-node.era_00    { border-top: 4px solid var(--color-00); }

/* Hover */
.music-node:hover {
    transform: translateY(-3px);
    border-color: var(--color-80);
    z-index: 20;
}

/* --- NEW: Connected State (The Glow) --- */
.music-node.connected {
    border-color: #ffeb3b; /* Gold Border */
    box-shadow: 0 0 20px rgba(255, 235, 59, 0.3); /* Gold Glow */
    z-index: 15; /* Sit above regular nodes */
}

/* --- NEW: Dimmed State (Fade out unrelated) --- */
.music-node.dimmed {
    opacity: 0.3;
    filter: grayscale(0.5);
    z-index: 5;
}

/* --- NEW: Selected State (The Glow & Highlight) --- */
.music-node.selected {
    transform: scale(1.03);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.4);
    border-color: #fff !important; /* Use important to override era border */
    z-index: 1001;
}

/* Active (Clicked) State - Highest Priority */
.music-node.active {
    /* Styles for highlighting moved to .selected */
    z-index: 1000; /* Stays on top but below selected */
}

/* Header & Content */
.node-header {
    padding: 12px 15px;
    background: var(--card-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 6px;
    position: relative;
    z-index: 2;
}

.node-header h3 {
    margin: 0;
    font-family: 'Anton', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.expand-icon {
    font-weight: bold;
    color: #666;
    transition: transform 0.3s;
}

.music-node.active .expand-icon {
    transform: rotate(45deg);
    color: #fff;
}

/* Dropdown */
.node-content {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%; 
    max-height: 0;
    opacity: 0;
    padding: 0;
    background: #16161a;
    border: 1px solid #555;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.9);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1; 
    box-sizing: border-box; 
    min-width: 400px; 
}

.music-node.active .node-content {
    max-height: 400px;
    opacity: 1;
    padding: 15px;
    overflow-y: auto;
    width: 280px;
    left: -90px; 
}


/* Genre Bio */
.genre-bio {
    font-size: 0.85rem;
    line-height: 1.35;
    color: rgba(255,255,255,0.85);
    margin: 0 0 10px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}
/* Artists */
.artist-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.artist-pill {
    font-size: 0.95rem;
    padding: 4px 8px;
    background: #2a2d35;
    border-radius: 4px;
    color: #ccc;
    border: 1px solid transparent;
}
.artist-pill.hof {
    color: #fff;
    border-color: rgba(255, 215, 0, 0.5);
    background: rgba(255, 215, 0, 0.1);
}
.artist-pill.hof::after { 
    content: '★'; margin-left: 3px; color: gold; 
}

/* --- MOBILE STYLING --- */
@media (max-width: 768px) {
    .timeline-grid {
        /* Replace transform with actual dimension changes */
        grid-auto-columns: 80px;
        grid-auto-rows: 10px;
        gap: 40px 30px;
        padding: 100px 20px 150px;
    }
    .node-header {
        padding: 0 5px;
    }
    .node-header h3 {
        font-size: 0.4rem; /* smaller text */
        font-family: Helvetica, sans-serif;
        font-weight: 400;
        letter-spacing:0;
    }
    .node-content {
        min-width:auto;
    }
    .music-node.active .node-content {
        width: 200px; /* Adjust dropdown width */
        left: -60px;
    }
    .artist-pill {
        font-size: 0.5rem;
        padding: 2px;
    }
}