/*  Dark Dimmed Theme Inspiration */
:root {
    /* Color Palette */
    --color-canvas-default: #0d1117;
    --color-canvas-subtle: #161b22;
    --color-border-default: #30363d;
    --color-border-muted: #21262d;
    --color-accent-fg: #58a6ff;
    --color-fg-default: #c9d1d9;
    --color-fg-muted: #8b949e;
    --color-btn-bg: #21262d;
    --color-btn-border: #30363d;
    --color-btn-hover-bg: #30363d;

    /* Typography */
    --font-stack-system: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-stack-system);
    background-color: var(--color-canvas-default);
    background-image: radial-gradient(circle at top right, #1f2530 0%, transparent 40%),
        radial-gradient(circle at bottom left, #161b22 0%, transparent 40%);
    color: var(--color-fg-default);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-canvas-default);
}

::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 5px;
    border: 2px solid var(--color-canvas-default);
}

::-webkit-scrollbar-thumb:hover {
    background: #8b949e;
}

a {
    color: var(--color-accent-fg);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Layout */
.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 32px;
    /* Standard GitHub-like padding for full width */
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .container {
        flex-direction: row;
        padding-top: 32px;
        gap: 24px;
        align-items: flex-start;
        /* Ensure items align to top */
    }
}

/* Sidebar */
.profile-sidebar {
    width: 100%;
    /* Full width on mobile */
    margin-bottom: 24px;
}

@media (min-width: 768px) {
    .profile-sidebar {
        width: 296px;
        /* Fixed width on desktop */
        flex-shrink: 0;
    }
}

.avatar-container {
    position: relative;
    width: 100%;
    max-width: 296px;
    margin-bottom: 16px;
}

.avatar {
    width: 100%;
    border-radius: 50%;
    border: 1px solid var(--color-border-muted);
    box-shadow: 0 0 0 1px var(--color-border-muted);
    /* Simulating border ring */
}

.profile-names {
    margin-bottom: 16px;
}

.p-name {
    font-size: 24px;
    line-height: 1.25;
    font-weight: 600;
    color: var(--color-fg-default);
    display: block;
}

.p-nickname {
    font-size: 20px;
    font-style: normal;
    font-weight: 300;
    line-height: 24px;
    color: var(--color-fg-muted);
    display: block;
}

.p-bio {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--color-fg-default);
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
    background-color: var(--color-btn-bg);
    border: 1px solid var(--color-btn-border);
    color: var(--color-fg-default);
    padding: 5px 16px;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
    margin-bottom: 16px;
}

.btn-block:hover {
    background-color: var(--color-btn-hover-bg);
    border-color: #8b949e;
    text-decoration: none;
}

.profile-details {
    list-style: none;
    padding: 0;
    margin: 0;
    color: var(--color-fg-default);
}

.profile-details li {
    display: flex;
    align-items: center;
    padding-top: 4px;
}

.profile-details svg {
    fill: var(--color-fg-muted);
    margin-right: 8px;
}

.sidebar-section {
    border-top: 1px solid var(--color-border-muted);
    margin-top: 16px;
    padding-top: 16px;
}

.sidebar-heading {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--color-fg-default);
}

/* Main Content Area */
.application-main {
    flex-grow: 1;
    min-width: 0;
}

/* Navigation Tabs */
.UnderlineNav {
    display: flex;
    border-bottom: 1px solid var(--color-border-muted);
    margin-bottom: 16px;
    overflow-x: auto;
    /* Scroll on mobile if needed */
}

.UnderlineNav-item {
    color: var(--color-fg-default);
    padding: 8px 16px;
    font-size: 14px;
    line-height: 30px;
    text-align: center;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
}

.UnderlineNav-item:hover {
    border-bottom-color: var(--color-border-muted);
    text-decoration: none;
}

.UnderlineNav-item.selected {
    font-weight: 600;
    border-bottom-color: var(--color-accent-fg);
}

.UnderlineNav-item .Counter {
    background-color: rgba(110, 118, 129, 0.4);
    color: var(--color-fg-default);
    border-radius: 20px;
    padding: 0 6px;
    font-size: 12px;
    font-weight: 500;
    margin-left: 4px;
}

/* Filter Controls */
.filter-container {
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-btn {
    background-color: transparent;
    border: 1px solid var(--color-border-default);
    color: var(--color-fg-muted);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;
}

.filter-btn:hover {
    background-color: var(--color-btn-hover-bg);
    color: var(--color-fg-default);
}

.filter-btn.active {
    background-color: rgba(56, 139, 253, 0.15);
    color: #58a6ff;
    border-color: transparent;
}

/* Feed / Project Card Styles */
#project-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 200px;
    /* Prevent layout shift when filtering */
}

@media (min-width: 1012px) {
    #project-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
}

.project-card {
    border: 1px solid var(--color-border-default);
    border-radius: 6px;
    padding: 16px;
    background-color: var(--color-canvas-default);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.project-card:hover {
    border-color: var(--color-accent-fg);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.5);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.project-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.project-title a {
    color: var(--color-accent-fg);
}

/* Make the whole card clickable via the title link */
.project-title a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.project-meta {
    font-size: 12px;
    color: var(--color-fg-muted);
    border: 1px solid var(--color-border-default);
    border-radius: 24px;
    padding: 0 7px;
    line-height: 18px;
    display: inline-block;
}

.project-desc {
    color: var(--color-fg-muted);
    margin: 0 0 12px 0;
    /* Reset top margin to 0 */
    font-size: 14px;
    line-height: 1.5;
    /* Explicit line height */
    max-height: 3em;
    /* 1.5 line-height * 2 lines = 3em fallback */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Ensure ellipsis */
}

.topic-tag {
    display: inline-block;
    padding: 0 7px;
    font-size: 12px;
    font-weight: 500;
    line-height: 18px;
    border-radius: 2em;
    background-color: rgba(56, 139, 253, 0.15);
    color: #58a6ff;
    border: 1px solid transparent;
    margin-right: 4px;
    margin-bottom: 4px;
    position: relative;
    z-index: 2;
    /* Keep tags clickable separately if needed */
}

.topic-tag:hover {
    background-color: rgba(56, 139, 253, 0.3);
    /* Slightly darker on hover */
    text-decoration: none;
}

.project-footer {
    margin-top: 16px;
    font-size: 12px;
    color: var(--color-fg-muted);
    display: flex;
    align-items: center;
}

.language-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
}

/* Timeline Styles for Experience/Education */
.timeline-item {
    border-left: 2px solid var(--color-border-muted);
    padding-left: 20px;
    margin-bottom: 24px;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--color-border-muted);
    border: 2px solid var(--color-canvas-default);
}

.timeline-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-fg-default);
    margin: 0 0 4px 0;
}

.timeline-meta {
    font-size: 14px;
    color: var(--color-fg-muted);
    margin-bottom: 8px;
}

.timeline-desc {
    color: var(--color-fg-muted);
    font-size: 14px;
}

/* Content Visibility */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(13, 17, 23, 0.85);
    /* Dark dimmed background */
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modal-overlay.open {
    display: flex;
    opacity: 1;
}

.modal-content {
    background-color: var(--color-canvas-subtle);
    border: 1px solid var(--color-border-default);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    padding: 24px;
    position: relative;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.modal-overlay.open .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--color-fg-muted);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--color-fg-default);
}

.modal-header {
    margin-bottom: 16px;
}

#modal-title {
    margin: 0 0 8px 0;
    font-size: 24px;
}

.modal-meta {
    display: flex;
    align-items: center;
    margin-top: 16px;
    font-size: 14px;
    color: var(--color-fg-muted);
}

.language-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

#modal-link {
    display: inline-block;
    width: auto;
    padding: 8px 24px;
    margin-top: 10px;
}