/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #0d1117;
    color: #e6edf3;
    line-height: 1.5;
}

/* Container and layout */
.container {
    display: flex;
    min-height: 100vh;
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
    gap: 24px;
}

/* Sidebar */
.sidebar {
    flex: 0 0 296px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 16px;
    height: fit-content;
    position: sticky;
    top: 24px;
}

/* Profile section */
.profile-section {
    margin-bottom: 24px;
}

.avatar-container {
    margin-bottom: 16px;
}

.avatar-link {
    display: block;
    transition: opacity 0.2s ease;
}

.avatar-link:hover {
    opacity: 0.8;
}

.avatar {
    width: 260px;
    height: 260px;
    border-radius: 50%;
    border: 1px solid #30363d;
    object-fit: cover;
}

.name-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: opacity 0.2s ease;
}

.name-link:hover {
    opacity: 0.8;
}

.name {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #f0f6fc;
}

.pronouns {
    font-size: 16px;
    font-weight: 400;
    color: #7d8590;
    margin-bottom: 16px;
}

.bio {
    font-size: 16px;
    margin-bottom: 16px;
    color: #e6edf3;
}

.profile-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.detail-icon {
    width: 16px;
    text-align: center;
}

.detail-icon.social-icon {
    width: 16px;
    height: 16px;
    fill: #7d8590;
    transition: fill 0.2s ease;
}

.detail-item:hover .detail-icon.social-icon {
    fill: #58a6ff;
}

.detail-text {
    color: #e6edf3;
}

.detail-link {
    color: #58a6ff;
    text-decoration: none;
}

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

.social-links {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #30363d;
}

/* Sidebar Languages Section */
.sidebar-languages-section {
    border-top: 1px solid #30363d;
    padding-top: 16px;
    margin-top: 16px;
}

.sidebar-section-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #f0f6fc;
}

.sidebar-languages-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sidebar-language-tag {
    background: #21262d;
    color: #58a6ff;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid #30363d;
    transition: all 0.2s ease;
}

.sidebar-language-tag:hover {
    background: #30363d;
    border-color: #58a6ff;
}

/* Sidebar Organizations Section */
.sidebar-organizations-section {
    border-top: 1px solid #30363d;
    padding-top: 16px;
    margin-top: 16px;
}

.sidebar-organizations-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sidebar-org-link {
    display: inline-block;
    transition: transform 0.2s ease;
}

.sidebar-org-link:hover {
    transform: scale(1.1);
}

.sidebar-org-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #21262d;
    border: 1px solid #30363d;
    transition: border-color 0.2s ease;
}

.sidebar-org-link:hover .sidebar-org-icon {
    border-color: #58a6ff;
}

/* GitHub section in About tab */
.github-section {
    margin-top: 32px;
    padding: 24px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
}

.github-section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 24px;
    color: #f0f6fc;
    text-align: center;
}

/* GitHub Stats Grid */
.github-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
}

.stat-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 16px;
    text-align: center;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.stat-card:hover {
    background: #1c2128;
    border-color: #58a6ff;
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: #58a6ff;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: #7d8590;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-subtitle {
    font-size: 10px;
    color: #6e7681;
    margin-top: 2px;
}

/* Main content */
.main-content {
    flex: 1;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    overflow: hidden;
}

/* Tab navigation */
.tab-navigation {
    display: flex;
    background: #0d1117;
    border-bottom: 1px solid #30363d;
}

.tab-button {
    background: none;
    border: none;
    color: #7d8590;
    padding: 16px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.tab-button:hover {
    color: #e6edf3;
    background: #21262d;
}

.tab-button.active {
    color: #f0f6fc;
    border-bottom-color: #fd7e14;
}

/* Breadcrumb navigation */
.breadcrumb-nav {
    background: #161b22;
    border-bottom: 1px solid #30363d;
    padding: 12px 24px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 14px;
    color: #7d8590;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-link {
    color: #7d8590;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-link:hover {
    color: #58a6ff;
}

.breadcrumb-current {
    color: #e6edf3;
    font-weight: 500;
}

.breadcrumb-separator {
    margin: 0 8px;
    color: #30363d;
}

/* Tab content */
.tab-content {
    padding: 24px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #7d8590;
    font-size: 14px;
}

/* Markdown content styling */
.markdown-content {
    max-width: none;
    line-height: 1.6;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    color: #f0f6fc;
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.25;
}

.markdown-content h1:first-child,
.markdown-content h2:first-child,
.markdown-content h3:first-child,
.markdown-content h4:first-child,
.markdown-content h5:first-child,
.markdown-content h6:first-child {
    margin-top: 0;
}

.markdown-content h1 { font-size: 32px; border-bottom: 1px solid #30363d; padding-bottom: 8px; }
.markdown-content h2 { font-size: 24px; border-bottom: 1px solid #30363d; padding-bottom: 8px; }
.markdown-content h3 { font-size: 20px; }
.markdown-content h4 { font-size: 16px; }

/* Heading anchor links */
.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    position: relative;
}

.heading-anchor {
    position: absolute;
    left: -24px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    font-size: 14px;
    text-decoration: none;
    color: #7d8590;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    background: transparent;
}

.heading-anchor:hover {
    color: #58a6ff;
    background: #21262d;
    text-decoration: none;
}

.markdown-content h1:hover .heading-anchor,
.markdown-content h2:hover .heading-anchor,
.markdown-content h3:hover .heading-anchor,
.markdown-content h4:hover .heading-anchor,
.markdown-content h5:hover .heading-anchor,
.markdown-content h6:hover .heading-anchor {
    opacity: 1;
}

.markdown-content p {
    margin-bottom: 16px;
    color: #e6edf3;
}

.markdown-content a {
    color: #58a6ff;
    text-decoration: none;
}

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

.markdown-content ul,
.markdown-content ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.markdown-content li {
    margin-bottom: 4px;
    color: #e6edf3;
}

.markdown-content code {
    background: #262c36;
    color: #f0f6fc;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 85%;
}

.markdown-content pre {
    background: #262c36;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 16px;
    overflow-x: auto;
    margin-bottom: 16px;
}

.markdown-content pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    font-size: 12px;
}

.markdown-content blockquote {
    border-left: 4px solid #30363d;
    padding-left: 16px;
    margin-bottom: 16px;
    color: #7d8590;
}

.markdown-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 16px 0;
}

/* Blog specific styles */
.blog-post-list {
    margin-bottom: 32px;
}

.blog-post-item {
    padding: 16px;
    border: 1px solid #30363d;
    border-radius: 6px;
    margin-bottom: 16px;
    transition: background-color 0.2s ease;
}

.blog-post-item:hover {
    background: #21262d;
}

.blog-post-title {
    font-size: 18px;
    font-weight: 600;
    color: #58a6ff;
    text-decoration: none;
    margin-bottom: 8px;
    display: block;
}

.blog-post-title:hover {
    text-decoration: underline;
}

.blog-post-meta {
    font-size: 14px;
    color: #7d8590;
    margin-bottom: 8px;
}

.blog-post-excerpt {
    color: #e6edf3;
    font-size: 14px;
}

/* Projects specific styles */
.projects-header {
    margin-bottom: 24px;
}

.projects-title {
    font-size: 24px;
    font-weight: 600;
    color: #f0f6fc;
    margin-bottom: 8px;
}

.projects-subtitle {
    font-size: 16px;
    color: #7d8590;
    margin-bottom: 0;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.project-card {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 16px;
    transition: all 0.2s ease;
    position: relative;
    min-height: 140px;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    border-color: #58a6ff;
    background: #161b22;
}

.project-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.project-icon {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    opacity: 0.8;
}

.project-name {
    font-size: 16px;
    font-weight: 600;
    color: #58a6ff;
    text-decoration: none;
    flex: 1;
}

.project-name:hover {
    text-decoration: underline;
}

.project-visibility {
    font-size: 12px;
    color: #7d8590;
    background: #21262d;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 2px 8px;
    margin-left: auto;
}

.project-description {
    color: #e6edf3;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
    flex: 1; /* Make description take available space */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 12px;
    color: #7d8590;
    margin-top: auto; /* Push stats to bottom */
}

.project-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.project-stat-icon {
    width: 12px;
    height: 12px;
}

.project-language {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.language-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

/* Language colors (GitHub standard) */
.language-color.javascript { background: #f1e05a; }
.language-color.python { background: #3572A5; }
.language-color.typescript { background: #2b7489; }
.language-color.go { background: #00ADD8; }
.language-color.rust { background: #dea584; }
.language-color.java { background: #b07219; }
.language-color.html { background: #e34c26; }
.language-color.css { background: #563d7c; }
.language-color.shell { background: #89e051; }
.language-color.dockerfile { background: #384d54; }
.language-color.yaml { background: #cb171e; }
.language-color.json { background: #292929; }
.language-color.markdown { background: #083fa1; }
.language-color.hcl { background: #844FBA; }

.projects-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: #7d8590;
    font-size: 14px;
}

.projects-error {
    text-align: center;
    padding: 48px 24px;
    color: #f85149;
    font-size: 14px;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1001;
    background: #21262d;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    flex-direction: column;
    gap: 3px;
    transition: background-color 0.2s ease;
}

.mobile-menu-toggle:hover {
    background: #30363d;
}

.mobile-menu-toggle span {
    width: 20px;
    height: 2px;
    background: #e6edf3;
    transition: all 0.3s ease;
    border-radius: 1px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile styles */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        padding: 16px;
        gap: 16px;
    }

    .sidebar {
        flex: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        border-radius: 0;
        border-left: none;
        border-top: none;
        border-bottom: none;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .main-content {
        margin-top: 48px;
    }

    .avatar {
        width: 200px;
        height: 200px;
    }

    .tab-navigation {
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .tab-navigation::-webkit-scrollbar {
        display: none;
    }

    .tab-button {
        white-space: nowrap;
        padding: 12px 20px;
    }

    .tab-content {
        padding: 16px;
    }

    .github-stats {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .stat-item {
        padding: 8px;
    }

    .stat-number {
        font-size: 16px;
    }

    /* GitHub section mobile styles */
    .github-section {
        margin-top: 24px;
        padding: 16px;
    }

    .github-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-number {
        font-size: 20px;
    }

    /* Sidebar mobile styles */
    .sidebar-languages-list {
        gap: 4px;
    }

    .sidebar-language-tag {
        font-size: 10px;
        padding: 2px 4px;
    }

    .sidebar-organizations-list {
        gap: 6px;
    }

    .sidebar-org-icon {
        width: 28px;
        height: 28px;
    }

    /* Projects mobile styles */
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .project-card {
        padding: 12px;
    }

    .project-stats {
        flex-wrap: wrap;
        gap: 12px;
    }

    .project-language {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 8px;
    }

    .avatar {
        width: 150px;
        height: 150px;
    }

    .name {
        font-size: 20px;
    }

    .username {
        font-size: 16px;
    }

    .tab-content {
        padding: 12px;
    }

    .markdown-content h1 { font-size: 24px; }
    .markdown-content h2 { font-size: 20px; }
    .markdown-content h3 { font-size: 18px; }
    
    /* Mobile heading anchors */
    .heading-anchor {
        position: static;
        display: inline-block;
        margin-left: 8px;
        opacity: 1;
        font-size: 12px;
    }
}

/* Loading animation */
@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.loading {
    animation: pulse 2s infinite;
}

/* Error states */
.error {
    color: #f85149;
    text-align: center;
    padding: 24px;
    font-size: 14px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    margin: 16px 0;
}

.error h3 {
    color: #f85149;
    margin-bottom: 8px;
    font-size: 16px;
}

.error p {
    color: #e6edf3;
    margin-bottom: 8px;
    font-size: 14px;
}

/* Scrollbar styling for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0d1117;
}

::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #484f58;
}

/* External content loading states */
.loading-external {
    color: #7d8590;
    font-style: italic;
    padding: 20px 0;
    text-align: center;
}

.external-content-error {
    color: #f78166;
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid rgba(248, 81, 73, 0.2);
    border-radius: 6px;
    padding: 16px;
    margin: 16px 0;
}

.external-content-error p {
    margin-bottom: 8px;
}

.external-content-error p:last-child {
    margin-bottom: 0;
}

/* Projects page styles */
.loading-projects {
    color: #7d8590;
    font-style: italic;
    padding: 20px 0;
    text-align: center;
}

.projects-error {
    color: #f78166;
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid rgba(248, 81, 73, 0.2);
    border-radius: 6px;
    padding: 16px;
    margin: 16px 0;
}

/* GitHub Pinned Repos Style */
.pinned-repo {
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
    background-color: #0d1117;
    transition: border-color 0.15s ease-in-out;
}

.pinned-repo:hover {
    border-color: #58a6ff;
}

.pinned-repo-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.repo-icon {
    fill: #7d8590;
    margin-right: 8px;
    flex-shrink: 0;
}

.repo-name {
    font-weight: 600;
    color: #58a6ff;
    text-decoration: none;
    font-size: 14px;
    margin-right: 8px;
}

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

.repo-visibility {
    border: 1px solid #30363d;
    border-radius: 2em;
    padding: 0 7px;
    font-size: 12px;
    color: #7d8590;
    font-weight: 500;
    line-height: 18px;
}

.repo-description {
    color: #8b949e;
    font-size: 12px;
    margin: 0 0 8px 0;
    line-height: 1.5;
}

.repo-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 12px;
    color: #7d8590;
}

.repo-language {
    display: flex;
    align-items: center;
    gap: 4px;
}

.language-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.repo-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #7d8590;
}

.repo-stat .repo-icon {
    width: 16px;
    height: 16px;
    margin-right: 4px;
}

/* Language colors matching GitHub */
.language-color[data-language="shell"] { background-color: #89e051; }
.language-color[data-language="python"] { background-color: #3572A5; }
.language-color[data-language="go"] { background-color: #00ADD8; }
.language-color[data-language="hcl"] { background-color: #844FBA; }
.language-color[data-language="javascript"] { background-color: #f1e05a; }
.language-color[data-language="typescript"] { background-color: #2b7489; }
.language-color[data-language="dockerfile"] { background-color: #384d54; }

/* Projects grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

/* Responsive design for projects */
@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .pinned-repo {
        padding: 12px;
    }
}

/* README page styles */
.loading-readme {
    color: #7d8590;
    font-style: italic;
    padding: 20px 0;
    text-align: center;
}

.readme-error {
    color: #f78166;
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid rgba(248, 81, 73, 0.2);
    border-radius: 6px;
    padding: 16px;
    margin: 16px 0;
}

.readme-error h2 {
    margin-top: 0;
    color: #f78166;
}

.readme-error a {
    color: #58a6ff;
}

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