:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --border-color: #30363d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --accent-blue: #58a6ff;
    --accent-green: #3fb950;
    --accent-purple: #a371f7;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

.container {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: 100vh;
    position: relative;
}

/* Sidebar */
.sidebar {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 20px;
    overflow-y: auto;
    height: 100vh;
}

.sidebar h1 {
    font-size: 1.25rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.sidebar .subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.stat-card .value {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--accent-blue);
}

.stat-card .label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 500;
}

.filter-section {
    margin-bottom: 20px;
}

.filter-section h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.chip:hover {
    border-color: var(--accent-blue);
}

.chip.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: var(--bg-primary);
}

.chip .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.chip .count {
    color: var(--text-secondary);
    font-size: 0.7rem;
}

.chip.active .count {
    color: var(--bg-secondary);
}

/* Favorites Button */
.favorites-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.favorites-btn:hover {
    border-color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
}

.favorites-btn.active {
    background: #fbbf24;
    border-color: #fbbf24;
    color: var(--bg-primary);
}

.favorites-icon {
    font-size: 1.1rem;
}

.favorites-btn.active .favorites-icon {
    filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.6));
}

/* Graph Container */
.graph-container {
    position: relative;
    background: var(--bg-primary);
    width: 100%;
    height: 100vh;
    overflow: hidden;
    min-width: 0;
    min-height: 0;
}

#cy {
    width: 100%;
    height: 100%;
    display: block;
}

/* Graph Help Tooltip - Top Center */
.graph-help-tooltip {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-blue);
    border: 2px solid var(--accent-blue);
    border-radius: 10px;
    padding: 16px 24px;
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 600;
    opacity: 1;
    pointer-events: none;
    z-index: 100;
    box-shadow: 0 6px 20px rgba(58, 134, 255, 0.5);
}

.graph-controls {
    position: absolute;
    top: 145px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.control-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-blue);
}

/* Hamburger Menu */
.hamburger-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 44px;
    height: 44px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    transition: left 0.3s;
}

.hamburger-btn.sidebar-open {
    left: 320px;
}

.hamburger-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-blue);
}

/* Show hamburger on small screens */
@media (max-width: 768px) {
    .hamburger-btn {
        display: flex;
    }

    .sidebar.mobile-open {
        left: 0;
    }
}

/* View Navigation */
.view-nav {
    position: fixed;
    top: 20px;
    /* Center in space between sidebar (280px) and right edge */
    left: calc(280px + (100vw - 280px) / 2);
    transform: translateX(-50%);
    display: flex;
    gap: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4px;
    z-index: 200;
    transition: left 0.3s ease;
}

/* Adjust nav position when details panel is open */
.details-panel.visible ~ .graph-container .view-nav {
    left: calc(280px + (100vw - 280px - 1100px) / 2);
}

.view-nav-btn {
    padding: 8px 24px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.view-nav-btn:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.view-nav-btn.active {
    color: var(--accent-blue);
    background: var(--bg-tertiary);
}

.view-nav-btn.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 8px;
    right: 8px;
    height: 2px;
    background: var(--accent-blue);
    border-radius: 1px;
}

/* Navigation Dropdown */
.nav-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    left: 0;
    min-width: 140px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4px;
    display: none;
    flex-direction: column;
    gap: 2px;
    z-index: 300;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Bridge the gap between button and dropdown */
.dropdown-menu::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 4px;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown.open .dropdown-menu,
.dropdown-menu:hover {
    display: flex;
}

.dropdown-item {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    white-space: nowrap;
}

.dropdown-item:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.dropdown-item.active {
    color: var(--accent-blue);
    background: var(--bg-tertiary);
}

/* Details Panel */
.details-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 800px;
    max-width: 80vw;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    border-radius: 0;
    padding: 20px;
    padding-left: 32px;
    overflow-y: auto;
    z-index: 1000;
    resize: horizontal;
    min-width: 350px;
    max-width: 90vw;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.details-panel.visible {
    opacity: 1;
    visibility: visible;
}

/* Resize Handle */
.resize-handle {
    position: absolute;
    left: 0;
    top: 0;
    width: 8px;
    height: 100%;
    cursor: ew-resize;
    background: transparent;
    z-index: 1001;
    border-radius: 0;
}

.resize-handle:hover {
    background: var(--accent-blue);
    opacity: 0.3;
}

.resize-handle:active {
    background: var(--accent-blue);
    opacity: 0.5;
}

/* Close button for details panel */
.close-panel-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002;
    transition: all 0.2s;
}

.close-panel-btn:hover {
    background: var(--bg-primary);
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

.details-panel h2 {
    font-size: 1rem;
    margin-bottom: 16px;
    color: var(--text-secondary);
    padding-right: 40px;
}

.repo-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
}

.repo-card .name {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--accent-blue);
    text-decoration: none;
    display: block;
    margin-bottom: 10px;
}

.repo-card .name:hover {
    text-decoration: underline;
}

.repo-card .description {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
}

.repo-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.repo-stats .stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1.05rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.languages-list, .topics-list {
    margin-top: 16px;
}

.languages-list h4, .topics-list h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.lang-bar {
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    margin-bottom: 8px;
}

.lang-segment {
    height: 100%;
}

.lang-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lang-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Loading state */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Layout Toggle */
.layout-select {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    margin-bottom: 20px;
}

/* 3D Graph specific styles */
.graph-container canvas {
    outline: none;
}

/* Portfolio Intro Overlay */
.intro-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 17, 23, 0.65);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    cursor: pointer;
}

.intro-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none !important;
}

.intro-content {
    max-width: 80%;
    padding: 100px 40px 40px 40px;
    text-align: center;
    cursor: pointer;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* IE10+/Edge */
    user-select: none; /* Prevent caret/text selection when clicking */
}

.intro-overlay .profile-image {
    width: 270px;
    height: 270px;
    border-radius: 50%;
    margin: 0 auto 32px;
    border: 4px solid var(--accent-blue);
    opacity: 1;
    box-shadow: 0 8px 32px rgba(88, 166, 255, 0.3);
    object-fit: cover;
    display: block;
}

.intro-overlay h1 {
    font-size: 3rem;
    margin-bottom: 16px;
    color: var(--text-primary);
    font-weight: 700;
}

.intro-overlay .tagline {
    font-size: 1.5rem;
    color: var(--accent-blue);
    margin-bottom: 24px;
    font-weight: 500;
}

.intro-overlay .description {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.intro-overlay .click-hint {
    font-size: 1.1rem;
    color: var(--text-secondary);
    opacity: .95;
    margin-top: 24px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Make sidebar name clickable */
.sidebar h1 {
    cursor: pointer;
    transition: color 0.2s;
}

.sidebar h1:hover {
    color: var(--accent-blue);
}

/* Responsive intro overlay */
@media (max-width: 1200px) {
    .intro-overlay .profile-image {
        width: 220px;
        height: 220px;
    }

    .intro-overlay h1 {
        font-size: 2.5rem;
    }

    .intro-overlay .tagline {
        font-size: 1.25rem;
    }
}

@media (max-width: 968px) {
    .intro-overlay .profile-image {
        width: 180px;
        height: 180px;
    }

    .intro-overlay h1 {
        font-size: 2rem;
    }

    .intro-overlay .tagline {
        font-size: 1.125rem;
    }

    .intro-overlay .description {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .intro-overlay .profile-image {
        width: 150px;
        height: 150px;
        margin-bottom: 24px;
    }

    .intro-overlay h1 {
        font-size: 1.75rem;
    }

    .intro-overlay .tagline {
        font-size: 1rem;
    }

    .intro-overlay .description {
        font-size: 0.9rem;
    }

    .intro-content {
        padding: 80px 24px 24px 24px;
    }
}

@media (max-width: 480px) {
    .intro-overlay .profile-image {
        width: 120px;
        height: 120px;
        margin-bottom: 20px;
    }

    .intro-overlay h1 {
        font-size: 1.5rem;
    }

    .intro-overlay .tagline {
        font-size: 0.9rem;
    }

    .intro-overlay .description {
        font-size: 0.85rem;
        line-height: 1.6;
    }

    .intro-content {
        padding: 70px 20px 20px 20px;
    }

    .intro-overlay .click-hint {
        font-size: 0.75rem;
    }
}

/* List View Container */
.list-view-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    overflow: hidden;
    z-index: 10;
}

.list-view-scroll {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 80px 0 20px 0;
}

.list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    max-width: 2000px;
    margin: 0 auto;
    gap: 24px;
    width: 100%;
    padding: 0 10%;
}

/* Ensure max 2 columns */
@supports (grid-template-columns: subgrid) {
    .list-grid {
        grid-template-columns: repeat(auto-fit, minmax(max(450px, calc(50% - 24px)), 1fr));
    }
}

/* List Empty State */
.list-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 40px auto;
}

.list-empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.list-empty-state p {
    font-size: 1rem;
    margin: 0;
}

/* Repository Card */
.repo-list-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.repo-list-card:hover {
    border-color: var(--accent-blue);
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.1);
}

/* Card Header */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-blue);
    text-decoration: none;
    flex: 1;
    word-break: break-word;
}

.card-title:hover {
    text-decoration: underline;
}

.card-stats {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.card-stats .stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Card Description */
.card-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Primary Language Badge */
.card-primary-lang {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-primary);
}

.card-primary-lang .lang-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* Card Languages Section */
.card-languages {
    margin-top: 4px;
}

/* Card Topics */
.card-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.card-topics .chip {
    font-size: 0.7rem;
    padding: 3px 10px;
    cursor: default;
}

/* README Toggle Button */
.readme-toggle {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    margin-top: 4px;
}

.readme-toggle:hover {
    background: var(--bg-primary);
    border-color: var(--accent-blue);
}

.readme-toggle .toggle-icon {
    font-size: 0.7rem;
    transition: transform 0.2s;
    display: inline-block;
}

.readme-toggle.expanded .toggle-icon {
    transform: rotate(90deg);
}

/* Card README Container */
.card-readme {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.card-readme.expanded {
    max-height: 600px;
    overflow-y: auto;
}

.card-readme .readme-content {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    font-size: 0.875rem;
    line-height: 1.6;
    margin-top: 8px;
}

.readme-loading {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.readme-loading p {
    margin-top: 12px;
    font-size: 0.875rem;
}

/* README Styles */
.readme-container {
    margin-top: 16px;
}

.readme-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.readme-header h3 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.readme-link {
    font-size: 0.75rem;
    color: var(--accent-blue);
    text-decoration: none;
}

.readme-link:hover {
    text-decoration: underline;
}

.readme-content {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    font-size: 0.875rem;
    line-height: 1.6;
}

/* Markdown styling */
.readme-content h1,
.readme-content h2,
.readme-content h3,
.readme-content h4 {
    color: var(--text-primary);
    margin-top: 24px;
    margin-bottom: 12px;
    font-weight: 600;
}

.readme-content h1 {
    font-size: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.readme-content h2 {
    font-size: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
}

.readme-content h3 {
    font-size: 1.125rem;
}

.readme-content p {
    margin-bottom: 12px;
    color: var(--text-primary);
}

.readme-content a {
    color: var(--accent-blue);
    text-decoration: none;
}

.readme-content a:hover {
    text-decoration: underline;
}

.readme-content code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85em;
    color: var(--accent-purple);
}

.readme-content pre {
    background: var(--bg-tertiary);
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 12px 0;
}

.readme-content pre code {
    background: none;
    padding: 0;
    color: var(--text-primary);
}

.readme-content ul,
.readme-content ol {
    margin-left: 20px;
    margin-bottom: 12px;
}

.readme-content li {
    margin-bottom: 4px;
}

.readme-content blockquote {
    border-left: 3px solid var(--accent-blue);
    padding-left: 12px;
    margin-left: 0;
    color: var(--text-secondary);
}

.readme-content img {
    max-width: 100%;
    border-radius: 6px;
    margin: 12px 0;
}

.readme-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 12px 0;
}

.readme-content table th,
.readme-content table td {
    border: 1px solid var(--border-color);
    padding: 8px;
    text-align: left;
}

.readme-content table th {
    background: var(--bg-tertiary);
    font-weight: 600;
}

.readme-loading {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
}

.repo-header-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 16px;
    text-decoration: none;
    transition: all 0.2s;
}

.repo-header-link:hover {
    border-color: var(--accent-blue);
    background: var(--bg-tertiary);
}

.repo-header-link .icon {
    font-size: 1.25rem;
}

.repo-header-link .text {
    flex: 1;
}

.repo-header-link .title {
    color: var(--accent-blue);
    font-weight: 600;
    font-size: 0.875rem;
}

.repo-header-link .subtitle {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* Scroll to Top Button */
.scroll-to-top {
    position: sticky;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    padding: 10px 16px;
    background: var(--accent-blue);
    color: var(--bg-primary);
    border: none;
    border-radius: 24px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s, transform 0.2s;
    pointer-events: none;
    margin-top: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.scroll-to-top.visible {
    opacity: 1;
    pointer-events: all;
}

.scroll-to-top:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.scroll-to-top:active {
    transform: translateX(-50%) translateY(0);
}

/* Responsive Design */
@media (max-width: 1400px) {
    .details-panel {
        width: 900px;
    }

    /* Update nav for smaller details panel */
    .details-panel.visible ~ .graph-container .view-nav {
        left: calc(280px + (100vw - 280px - 900px) / 2);
    }

    .list-grid {
        grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
        padding: 0 8%;
    }
}

@media (max-width: 1200px) {
    .container {
        grid-template-columns: 250px 1fr;
    }

    /* Update nav for smaller sidebar */
    .view-nav {
        left: calc(250px + (100vw - 250px) / 2);
    }

    .details-panel {
        width: 800px;
    }

    /* Update nav for smaller sidebar + details panel */
    .details-panel.visible ~ .graph-container .view-nav {
        left: calc(250px + (100vw - 250px - 800px) / 2);
    }

    .sidebar {
        padding: 16px;
    }
}

@media (max-width: 968px) {
    .container {
        grid-template-columns: 180px 1fr;
    }

    /* Update nav for smallest sidebar */
    .view-nav {
        left: calc(180px + (100vw - 180px) / 2);
    }

    .sidebar {
        padding: 12px;
    }

    .list-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 6%;
    }

    .list-view-scroll {
        padding: 70px 0 16px 0;
    }

    .sidebar h1 {
        font-size: 0.95rem;
    }

    .sidebar .subtitle {
        font-size: 0.7rem;
    }

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

    .stat-card {
        padding: 8px;
    }

    .stat-card .value {
        font-size: 1.25rem;
    }

    .filter-section h3 {
        font-size: 0.85rem;
    }

    .chip {
        font-size: 0.7rem;
        padding: 3px 8px;
    }

    .details-panel {
        width: 700px;
        right: 0;
    }
}

@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        height: 100vh;
        width: 280px;
        z-index: 999;
        transition: left 0.3s;
    }

    .details-panel {
        width: 100vw !important;
        right: 0;
        height: 100vh;
        padding-left: 24px;
    }

    /* Hide hamburger button when details panel is visible at small screen */
    .hamburger-btn.hidden-by-panel {
        display: none !important;
    }

    /* Navigation - same row as hamburger on mobile */
    .view-nav {
        top: 20px;
        left: 70px;
        transform: none;
        padding: 3px;
        width: auto;
        max-width: calc(100% - 90px);
    }

    .view-nav-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .dropdown-item {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    /* List view - single column */
    .list-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 0 16px;
    }

    .list-view-scroll {
        padding: 70px 0 12px 0;
    }

    .resize-handle {
        display: none;
    }

    .scroll-to-top {
        width: 100px;
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .graph-controls {
        margin-top: 10px;
        top: 130px;
        gap: 6px;
    }

    .control-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 240px;
        padding: 12px;
    }

    .sidebar h1 {
        font-size: 0.9rem;
    }

    .sidebar .subtitle {
        font-size: 0.65rem;
    }

    /* Navigation - compact on small phones, still same row as hamburger */
    .view-nav {
        top: 20px;
        left: 70px;
        width: auto;
        max-width: calc(100% - 85px);
        transform: none;
        padding: 2px;
    }

    .view-nav-btn {
        padding: 5px 8px;
        font-size: 0.7rem;
    }

    .dropdown-item {
        padding: 5px 10px;
        font-size: 0.7rem;
    }

    .stat-card .value {
        font-size: 1.1rem;
    }

    .stat-card .label {
        font-size: 0.7rem;
    }

    .graph-controls {
        flex-wrap: wrap;
        max-width: 90px;
    }

    .control-btn {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
}

/* Footer - always starts after sidebar */
.site-footer {
    position: fixed;
    bottom: 0;
    left: 280px;
    right: 0;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 150;
    transition: background-color 0.3s ease;
}

/* Footer background - transparent for graph view */
.site-footer.graph-view {
    background: transparent;
}

/* Footer background - solid for list/about view */
.site-footer.list-view,
.site-footer.about-view {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    width: 100%;
    padding: 0 40px;
    gap: 40px;
}

.footer-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

.footer-links a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--accent-blue);
}

.footer-links svg {
    flex-shrink: 0;
}

.footer-copyright {
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

/* Email copy tooltip */
.email-copy-tooltip {
    position: fixed;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--accent-blue);
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.email-copy-tooltip.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

#email-link {
    cursor: pointer;
}

/* Adjust graph container to account for footer */
.graph-container {
    height: calc(100vh - 50px);
}

/* Adjust list view container to fill graph container */
.list-view-container {
    height: 100%;
}

/* Responsive footer positioning for different sidebar widths */
@media (max-width: 1200px) {
    .site-footer {
        left: 250px;
    }
}

@media (max-width: 968px) {
    .site-footer {
        left: 180px;
        height: 60px;
    }

    .footer-content {
        flex-direction: column;
        gap: 12px;
        padding: 8px 20px;
    }

    .footer-links {
        gap: 20px;
    }

    .footer-links a {
        font-size: 0.8rem;
    }

    .footer-copyright {
        font-size: 0.75rem;
    }

    .graph-container {
        height: calc(100vh - 60px);
    }

    .list-view-container {
        height: 100%;
    }
}

@media (max-width: 768px) {
    /* Full width on mobile */
    .site-footer {
        left: 0;
    }

    .footer-links a span:not(.footer-links svg) {
        display: none;
    }

    .footer-links {
        gap: 16px;
    }

    .graph-help-tooltip {
        visibility: hidden;
    }

    .graph-controls {
        top: 65px;
    }
}

