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

:root {
    --color-primary: rgb(1, 4, 9);
    --color-secondary: #161b22;
    --color-tertiary: #21262d;
    --color-hover: #30363d;

    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --bg-hover: #30363d;

    --border-default: #30363d;
    --border-muted: #21262d;

    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --text-inverse: #0d1117;

    --accent-primary: #58a6ff;
    --accent-secondary: #1f6feb;
    --accent-success: #3fb950;
    --accent-warning: #d29922;
    --accent-danger: #f85149;

    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    --font-size-primary: 0.875rem;
}


body {
    font-family: var(--font-primary);
    font-size: var(--font-size-primary);
    line-height: 1.5;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-direction: column;
    min-height: 100vh;
}

header {
    width: 100%;
    padding: 1rem 1.5rem;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-default);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background-color: rgba(22, 27, 34, 0.95);
}

@media (min-width: 768px) {
    header {
        flex-direction: row;
        justify-content: space-between;
    }
}

.header__logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
}

.header__logo svg {
    fill: var(--text-primary);
}

.header__logo-text {
    font-weight: 600;
    font-size: 1.25rem;
}

.header_div_nav_bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

@media (min-width: 768px) {
    .header_div_nav_bar {
        flex-direction: row;
        width: auto;
        gap: 2rem;
    }
}

.search-container {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    max-width: 300px;
}

#search-input {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    width: 100%;
    font-size: 0.9rem;
}

#search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.3);
}

#search-btn {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#search-btn:hover {
    background-color: var(--bg-hover);
}

.header_nav_bar {
    width: 100%;
}

.header_nav_bar ol {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.header_nav_bar_list_item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
    transition: color 0.2s;
    padding: 0.5rem;
    border-bottom: 2px solid transparent;
}

.header_nav_bar_list_item:hover,
.header_nav_bar_list_item.active {
    color: var(--text-primary);
}

.header_nav_bar_list_item.active {
    border-bottom-color: var(--accent-warning);
}

.header_nav_bar_list_item svg {
    fill: currentColor;
}

main {
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    flex: 1;
}

.profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-default);
    animation: fadeIn 0.5s ease-in-out;
}

@media (min-width: 768px) {
    .profile {
        /* Keep column to stack Header + Readme vertically */
        align-items: flex-start;
        text-align: left;
    }
}

.profile__avatar img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 2px solid var(--border-default);
    box-shadow: 0 0 0 1px var(--bg-primary);
}

.profile__info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 1rem;
    width: 100%;
    align-items: center;
}

@media (min-width: 768px) {
    .profile__info {
        align-items: flex-start;
    }
}

.profile__name {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.profile__login {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 300;
}

.profile__bio {
    margin-top: 1rem;
    font-size: 1rem;
    max-width: 600px;
}

.profile__stats {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

@media (min-width: 768px) {
    .profile__stats {
        justify-content: flex-start;
    }
}

.profile__stat-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.profile__link {
    margin-top: 1rem;
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
}

.profile__link:hover {
    text-decoration: underline;
}

.repositories {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeIn 0.5s ease-in-out;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.repos__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .repos__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .repos__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.repo-card {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    height: 100%;
}

.repo-card:hover {
    transform: translateY(-2px);
    border-color: var(--text-secondary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.repo-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.repo-card__title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-primary);
    text-decoration: none;
    word-break: break-all;
}

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

.repo-card__badge {
    font-size: 0.75rem;
    border: 1px solid var(--border-default);
    padding: 0.125rem 0.5rem;
    border-radius: 2rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.repo-card__description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    flex-grow: 1;
    line-height: 1.5;
}

.repo-card__footer {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: auto;
}

.repo-card__lang {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.repo-card__lang-color {
    width: 12px;
    height: 12px;
    background-color: var(--accent-warning);
    border-radius: 50%;
    display: inline-block;
}

.loading {
    color: var(--text-muted);
    font-style: italic;
    padding: 2rem;
    text-align: center;
    width: 100%;
}

.error-message {
    color: var(--accent-danger);
    padding: 1rem;
    border: 1px solid var(--accent-danger);
    border-radius: 6px;
    background-color: rgba(248, 81, 73, 0.1);
}

.fatal-error {
    text-align: center;
    margin-top: 4rem;
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Readme Styles */
.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
    width: 100%;
}

@media (min-width: 768px) {
    .profile-header {
        flex-direction: row;
        text-align: left;
        align-items: flex-start;
        gap: 2rem;
    }
}

.profile__readme {
    width: 100%;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-default);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    /* Prevent horizontal scroll from large images */
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Center content like badges */
}

/* Markdown Styles (Generic) */
.profile__readme h1,
.profile__readme h2,
.profile__readme h3 {
    margin-bottom: 1rem;
    margin-top: 2rem;
    /* Removed border-bottom to fix 'extra headers lines' issue */
    border-bottom: none;
    padding-bottom: 0.5rem;
    color: var(--text-primary);
    width: 100%;
    text-align: center;
    /* Center headers to match badges/images */
}

.profile__readme h1 {
    font-size: 2rem;
}

.profile__readme h2 {
    font-size: 1.5rem;
}

.profile__readme h3 {
    font-size: 1.25rem;
}

.profile__readme p {
    margin-bottom: 1rem;
    width: 100%;
    text-align: center;
    /* Center text/images in paragraphs */
}

.profile__readme div {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
}

.profile__readme a {
    color: var(--accent-primary);
    text-decoration: none;
    display: inline-block;
    /* Helps with image links */
}

.profile__readme a:hover {
    text-decoration: underline;
}

.profile__readme ul,
.profile__readme ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
    text-align: left;
    /* Keep lists left aligned */
    width: 100%;
    max-width: 800px;
    /* Readability */
}

.profile__readme img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    background-color: transparent;
}

.profile__readme pre,
.profile__readme code {
    background-color: var(--bg-tertiary);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}

.profile__readme pre {
    padding: 1rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.profile__readme pre code {
    background-color: transparent;
    padding: 0;
}

.profile__readme blockquote {
    border-left: none;
    /* Removed side border */
    padding-left: 0;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-style: italic;
}

.profile__readme hr {
    border: none;
    border-top: 1px solid var(--border-muted);
    /* Subtle separator if needed, or none */
    margin: 2rem auto;
    width: 50%;
    /* Not full width */
    opacity: 0.3;
}