/**
 * GDG Network Graph - Styles
 * 
 * A clean, minimal design with soft pastel colors.
 * Optimized for readability and a welcoming open-source experience.
 */

/* =============================================================================
   RESET & BASE STYLES
   ============================================================================= */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #fafafa;
    overflow: hidden;
    color: #1f2937;
    -webkit-font-smoothing: antialiased;
}

.container {
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* =============================================================================
   SIDEBAR
   ============================================================================= */

.sidebar {
    width: 360px;
    min-width: 360px;
    background: #fafafa;
    overflow-y: auto;
    padding: 28px 24px;
    border-right: 1px solid #e5e7eb;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.sidebar-logo {
    height: 24px;
    width: auto;
    border-radius: 4px;
    object-fit: contain;
}

.sidebar h2 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    letter-spacing: -0.01em;
}

/* Minimal scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #e5e7eb;
    border-radius: 2px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #d1d5db;
}

/* =============================================================================
   CONTRIBUTOR CARDS
   ============================================================================= */

.person-card {
    padding: 16px 12px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    border-radius: 8px;
    border-bottom: 1px solid #f3f4f6;
}

.person-card:last-child {
    border-bottom: none;
}

.person-card:hover {
    background: #f9fafb;
}

.person-card.active {
    background: #f1f5f9;
}

.person-card.active .person-name {
    color: #2563eb;
}

/* Search highlighting */
.person-card.search-match {
    background: #e0f2fe;
    box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.3);
}

.person-card.search-dim {
    opacity: 0.35;
}

.person-name {
    font-size: 15px;
    font-weight: 500;
    color: #111827;
    margin-bottom: 4px;
}

.person-details {
    font-size: 13px;
    color: #9ca3af;
}

.person-links {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.person-links a {
    font-size: 12px;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.15s ease;
}

.person-links a:hover {
    color: #2563eb;
}

/* =============================================================================
   GRAPH CONTAINER
   ============================================================================= */

.graph-container {
    flex: 1;
    position: relative;
    background: #fafafa;
}

#network-graph {
    width: 100%;
    height: 100%;
}

/* GitHub repo link - bottom right */
.repo-link {
    position: absolute;
    bottom: 16px;
    right: 16px;
    font-size: 12px;
    color: #6b7280;
    text-decoration: none;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    transition: color 0.15s ease, border-color 0.15s ease;
    z-index: 100;
}

.repo-link:hover {
    color: #2563eb;
    border-color: #2563eb;
}

/* =============================================================================
   SEARCH BAR
   ============================================================================= */

.search-container {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
}

#search-input {
    width: 220px;
    padding: 10px 14px;
    font-size: 13px;
    font-family: inherit;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    color: #1f2937;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#search-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

#search-input::placeholder {
    color: #9ca3af;
}

/* =============================================================================
   GRAPH ELEMENTS
   ============================================================================= */

/* Connection lines between nodes */
.link {
    stroke: #e2e8f0;
    stroke-width: 1px;
}

/* Node circles (soft pastel colors) */
.node circle {
    fill: #94a3b8;
    stroke: #ffffff;
    stroke-width: 2px;
    cursor: pointer;
    transition: fill 0.15s ease, filter 0.15s ease;
}

.node circle:hover {
    fill: #64748b;
}

/* Active/selected node - clearly highlighted */
.node.active circle {
    fill: #3b82f6;
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.6));
}

/* Node labels */
.node text {
    font-size: 12px;
    font-weight: 500;
    fill: #374151;
    pointer-events: none;
    user-select: none;
}

/* Search match - glowing highlight */
.node.search-match circle {
    fill: #60a5fa;
    filter: drop-shadow(0 0 6px rgba(96, 165, 250, 0.5));
}

.node.search-match text {
    fill: #334155;
    font-weight: 600;
}

/* Dimmed state for non-matching nodes */
.node.search-dim circle {
    fill: #e2e8f0;
}

.node.search-dim text {
    opacity: 0.4;
}

/* =============================================================================
   TOOLTIPS
   ============================================================================= */

.tooltip {
    position: fixed;
    padding: 12px 16px;
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    pointer-events: none;
    font-size: 13px;
    opacity: 0;
    transition: opacity 0.15s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    max-width: 280px;
    z-index: 1000;
}

.tooltip.visible {
    opacity: 1;
}

.tooltip.detailed {
    pointer-events: auto;
    padding: 16px;
}

/* Hover tooltip content */
.tooltip .name {
    font-weight: 600;
    color: #111827;
    margin-bottom: 2px;
}

.tooltip .year {
    font-size: 12px;
    color: #6b7280;
}

/* Detailed tooltip content */
.tooltip-header {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f3f4f6;
}

.tooltip-section {
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.4;
}

.tooltip-section strong {
    color: #6b7280;
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.tooltip-section a {
    color: #2563eb;
    text-decoration: none;
    font-size: 13px;
    display: block;
    margin-top: 2px;
    word-break: break-all;
}

.tooltip-section a:hover {
    text-decoration: underline;
}

.tooltip-close {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid #f3f4f6;
    font-size: 11px;
    color: #9ca3af;
    text-align: center;
}

/* =============================================================================
   RESPONSIVE - TABLET (768px - 1024px)
   ============================================================================= */

@media (max-width: 1024px) {
    .sidebar {
        width: 280px;
        min-width: 280px;
        padding: 20px 16px;
    }

    .sidebar-header {
        gap: 12px;
        margin-bottom: 20px;
        padding-bottom: 16px;
    }

    .sidebar-logo {
        height: 20px;
    }

    .sidebar h2 {
        font-size: 14px;
    }

    .person-card {
        padding: 12px 10px;
    }

    .person-name {
        font-size: 14px;
    }

    #search-input {
        width: 180px;
        padding: 8px 12px;
        font-size: 12px;
    }

    .node text {
        font-size: 10px;
    }
}

/* =============================================================================
   RESPONSIVE - MOBILE (< 768px)
   ============================================================================= */

@media (max-width: 768px) {
    body {
        overflow: auto;
    }

    .container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .sidebar {
        width: 100%;
        min-width: 100%;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        padding: 16px;
    }

    .sidebar-header {
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .graph-container {
        height: 60vh;
        min-height: 300px;
    }

    .search-container {
        top: 12px;
        right: 12px;
    }

    #search-input {
        width: 160px;
        padding: 8px 10px;
        font-size: 12px;
    }

    .person-card {
        padding: 10px 8px;
    }

    .person-name {
        font-size: 13px;
    }

    .person-details {
        font-size: 12px;
    }

    .person-links {
        gap: 10px;
        margin-top: 6px;
    }

    .person-links a {
        font-size: 11px;
    }

    .node circle {
        stroke-width: 1.5px;
    }

    .node text {
        font-size: 9px;
    }

    .tooltip {
        max-width: 240px;
        font-size: 12px;
        padding: 10px 12px;
    }

    .tooltip.detailed {
        padding: 12px;
    }

    .tooltip-header {
        font-size: 14px;
        margin-bottom: 10px;
        padding-bottom: 6px;
    }

    .tooltip-section {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .tooltip-section strong {
        font-size: 10px;
    }

    .tooltip-section a {
        font-size: 12px;
    }
}

/* =============================================================================
   RESPONSIVE - SMALL MOBILE (< 480px)
   ============================================================================= */

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

    .sidebar-header {
        gap: 10px;
    }

    .sidebar-logo {
        height: 18px;
    }

    .sidebar h2 {
        font-size: 13px;
    }

    .graph-container {
        height: 65vh;
    }

    #search-input {
        width: 140px;
        padding: 6px 8px;
        font-size: 11px;
    }

    .person-card {
        padding: 8px 6px;
    }

    .tooltip {
        max-width: 200px;
    }
}