/* GitHub Dark Mode Variables */
:root {
    --gh-bg: #0d1117;
    --gh-bg-secondary: #161b22;
    --gh-border: #30363d;
    --gh-text-main: #c9d1d9;
    --gh-text-muted: #8b949e;
    --gh-link: #58a6ff;
    --gh-btn-bg: #21262d;
    --gh-btn-hover: #30363d;
    --gh-btn-primary: #238636;
    --gh-btn-primary-hover: #2ea043;
    --gh-green: #2ea043;
    --gh-orange: #e34c26;
    --gh-yellow: #e3b341;

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}

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

body {
    background-color: var(--gh-bg);
    color: var(--gh-text-main);
    line-height: 1.5;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: var(--gh-link);
}

a:hover {
    text-decoration: underline;
}

/* --- HEADER --- */
header {
    background-color: #010409;
    padding: 16px;
    border-bottom: 1px solid var(--gh-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.header-logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo svg {
    fill: white;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
}

.header-title {
    color: var(--gh-text-main);
    font-size: 32px;
    font-weight: 600;
    display: inline-block;
    line-height: 32px;
    margin-left: 16px;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    fill: white;
    cursor: pointer;
}

/* --- MAIN LAYOUT --- */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    gap: 24px;
    flex-grow: 1;
}

/* --- SIDEBAR (Profile) --- */
.sidebar {
    width: 296px;
    flex-shrink: 0;
}

.sidebar-header {
    display: flex;
    flex-direction: column;
}

.avatar {
    width: 100%;
    max-width: 220px;
    height: auto;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 1px solid var(--gh-border);
    margin-bottom: 16px;
    object-fit: cover;
}

.vcard-names {
    margin-bottom: 16px;
}

.vcard-fullname {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--gh-text-main);
}

.vcard-username {
    font-size: 20px;
    font-weight: 300;
    line-height: 1.25;
    color: var(--gh-text-muted);
}

.user-profile-bio {
    margin-bottom: 16px;
    font-size: 16px;
    color: var(--gh-text-main);
}

.btn-profile {
    display: block;
    width: 100%;
    text-align: center;
    background: var(--gh-btn-bg);
    border: 1px solid var(--gh-border);
    color: var(--gh-text-main);
    padding: 5px 16px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    margin-bottom: 16px;
}

.btn-profile:hover {
    background: var(--gh-btn-hover);
    text-decoration: none;
}

.vcard-details {
    list-style: none;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--gh-border);
    padding-bottom: 16px;
}

.vcard-details li {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    color: var(--gh-text-main);
    font-size: 14px;
    word-break: break-all;
}

.vcard-details svg {
    fill: var(--gh-text-muted);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.skills-section h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.skills-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.badge {
    border: 1px solid var(--gh-border);
    padding: 2px 10px;
    border-radius: 2em;
    font-size: 12px;
    font-weight: 500;
    color: var(--gh-text-muted);
    white-space: nowrap;
}

/* --- MAIN CONTENT AREA --- */
.content {
    flex-grow: 1;
    min-width: 0;
}

/* Tabs */
.UnderlineNav {
    display: flex;
    border-bottom: 1px solid var(--gh-border);
    margin-bottom: 20px;
    gap: 8px;
}

.UnderlineNav-item {
    padding: 8px 16px;
    font-size: 14px;
    color: var(--gh-text-main);
    cursor: default;
    border-bottom: 2px solid #f78166;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.UnderlineNav-item svg {
    fill: var(--gh-text-muted);
    width: 16px;
    height: 16px;
}

.repo-count {
    background: rgba(110, 118, 129, 0.4);
    border-radius: 2em;
    padding: 0 6px;
    font-size: 12px;
    font-weight: 500;
}

/* --- REPOSITORY FILTER BAR --- */
.repo-filter-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    align-items: center;
    flex-wrap: wrap;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gh-border);
}

.local-search {
    background: var(--gh-bg);
    border: 1px solid var(--gh-border);
    padding: 6px 12px;
    border-radius: 6px;
    color: var(--gh-text-main);
    width: 100%;
    max-width: 320px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.local-search:focus {
    border-color: var(--gh-link);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.3);
}

.local-search::placeholder {
    color: var(--gh-text-muted);
}

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

.filter-btn {
    background: var(--gh-btn-bg);
    border: 1px solid var(--gh-border);
    color: var(--gh-text-main);
    padding: 4px 14px;
    border-radius: 2em;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
}

.filter-btn:hover {
    background: var(--gh-btn-hover);
}

.filter-btn.active {
    background: var(--gh-link);
    color: #fff;
    border-color: var(--gh-link);
}

/* Repositories Grid */
.repo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

/* Repo Card with Image */
.repo-card {
    border: 1px solid var(--gh-border);
    border-radius: 6px;
    background: var(--gh-bg);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: border-color 0.2s;
    overflow: hidden;
}

.repo-card:hover {
    border-color: var(--gh-text-muted);
}

.card-cover-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-bottom: 1px solid var(--gh-border);
}

.repo-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.repo-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 8px;
}

.repo-title-group {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}

.repo-title-group svg {
    fill: var(--gh-text-muted);
    width: 16px;
    height: 16px;
    margin-top: 2px;
    flex-shrink: 0;
}

.repo-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gh-link);
    word-break: break-word;
}

.repo-badge {
    border: 1px solid var(--gh-border);
    color: var(--gh-text-muted);
    font-size: 12px;
    padding: 0 7px;
    border-radius: 2em;
    line-height: 18px;
    white-space: nowrap;
}

.repo-desc {
    color: var(--gh-text-muted);
    font-size: 12px;
    margin-bottom: 16px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.repo-tags {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.topic-tag {
    background: rgba(56, 139, 253, 0.1);
    color: var(--gh-link);
    font-size: 12px;
    font-weight: 500;
    padding: 0 10px;
    border-radius: 2em;
    line-height: 22px;
    white-space: nowrap;
}

.repo-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 12px;
    color: var(--gh-text-muted);
    flex-wrap: wrap;
}

.lang-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
}

.lang-python {
    background-color: #3572A5;
}

.lang-jupyter {
    background-color: #DA5B0B;
}

.lang-javascript {
    background-color: #f1e05a;
}

.lang-html {
    background-color: #e34c26;
}

.lang-css {
    background-color: #563d7c;
}

.lang-other {
    background-color: #8b949e;
}

/* Contribution Graph */
.contrib-graph {
    border: 1px solid var(--gh-border);
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 40px;
    overflow-x: hidden;
}

.contrib-title {
    font-size: 16px;
    font-weight: 400;
    margin-bottom: 8px;
}

.graph-squares {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.g-sq {
    width: 11px;
    height: 11px;
    border-radius: 2px;
    background: #161b22;
    outline: 1px solid rgba(255, 255, 255, 0.05);
    outline-offset: -1px;
}

.g-l1 {
    background: #0e4429;
}

.g-l2 {
    background: #006d32;
}

.g-l3 {
    background: #26a641;
}

.g-l4 {
    background: #39d353;
}

/* No Results Message */
.no-results {
    display: none;
    padding: 40px;
    text-align: center;
    color: var(--gh-text-muted);
    border: 1px dashed var(--gh-border);
    border-radius: 6px;
    grid-column: span 2;
}

/* --- SITE FOOTER (DYNAMIC YEAR) --- */
.site-footer {
    border-top: 1px solid var(--gh-border);
    padding: 40px 24px;
    margin-top: 20px;
    text-align: center;
    font-size: 12px;
    color: var(--gh-text-muted);
    background-color: var(--gh-bg);
}

.site-footer a {
    color: var(--gh-link);
    text-decoration: none;
    margin: 0 10px;
}

.site-footer a:hover {
    text-decoration: underline;
}

/* --- MODAL --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: 0.2s;
    padding: 16px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--gh-bg-secondary);
    border: 1px solid var(--gh-border);
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.98);
    transition: 0.2s;
    box-shadow: 0 0 0 1px #30363d, 0 16px 32px rgba(0, 0, 0, 0.85);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 16px;
    border-bottom: 1px solid var(--gh-border);
    background: var(--gh-bg-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
    word-break: break-word;
    padding-right: 16px;
}

.close-btn {
    background: none;
    border: none;
    color: var(--gh-text-muted);
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
}

.close-btn:hover {
    color: var(--gh-text-main);
}

.close-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.modal-body {
    padding: 16px;
    overflow-y: auto;
    flex-grow: 1;
}

.modal-img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    margin-bottom: 16px;
    border: 1px solid var(--gh-border);
}

.modal-desc {
    font-size: 14px;
    color: var(--gh-text-main);
    line-height: 1.5;
    margin-bottom: 8px;
}

.modal-footer {
    padding: 16px;
    border-top: 1px solid var(--gh-border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    background: var(--gh-bg-secondary);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.btn-cancel {
    background: var(--gh-btn-bg);
    border: 1px solid var(--gh-border);
    color: var(--gh-text-main);
    padding: 5px 16px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
}

.btn-cancel:hover {
    background: var(--gh-btn-hover);
}

.btn-primary {
    background: var(--gh-btn-primary);
    border: 1px solid rgba(240, 246, 252, 0.1);
    color: #fff;
    padding: 5px 16px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}

.btn-primary:hover {
    background: var(--gh-btn-primary-hover);
    text-decoration: none;
}

.icon {
    display: inline-block;
    vertical-align: text-bottom;
    fill: currentColor;
}

@media (max-width: 768px) {
    .header-left {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-logo-container {
        justify-content: flex-start;
        width: 100%;
    }

    .mobile-menu-btn {
        display: block;
    }

    .container {
        flex-direction: column;
        padding: 16px;
        gap: 16px;
    }

    .sidebar {
        width: 100%;
    }

    .sidebar-header {
        flex-direction: row;
        align-items: center;
        gap: 16px;
        margin-bottom: 16px;
    }

    .avatar {
        width: 80px;
        height: 80px;
        margin-bottom: 0;
        max-width: none;
    }

    .vcard-names {
        margin-bottom: 0;
    }

    .vcard-fullname {
        font-size: 20px;
    }

    .vcard-username {
        font-size: 16px;
    }

    .repo-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .no-results {
        grid-column: span 1;
    }

    .contrib-graph {
        padding: 12px;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer button,
    .modal-footer a {
        width: 100%;
    }

    .local-search {
        max-width: 100%;
    }
}