:root[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --highlight-color: #ffffff;
    --dim-color: #808080;
    --overlay-color: rgba(26, 26, 26, 0.75);
    --font-mono: Consolas, 'Andale Mono', 'Lucida Console', monospace;
}

:root[data-theme="light"] {
    --bg-color: #f5f5f5;
    --text-color: #2a2a2a;
    --highlight-color: #000000;
    --dim-color: #666666;
    --overlay-color: rgba(245, 245, 245, 0.75);
    --font-mono: Consolas, 'Andale Mono', 'Lucida Console', monospace;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-mono);
    line-height: 1.6;
    height: 100vh;
    display: grid;
    grid-template-columns: 300px 1fr;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
        "sidebar header"
        "sidebar main"
        "sidebar footer";
    transition: background-color 0.3s ease, color 0.3s ease;
}

.sidebar {
    grid-area: sidebar;
    padding: 2rem;
    border-right: 1px solid var(--dim-color);
    background: linear-gradient(var(--overlay-color), var(--overlay-color)),
        url('profile.jpg');
    background-size: cover;
    background-position: 35% center;
    transition: border-color 0.3s ease;
}

.header {
    grid-area: header;
    padding: 2rem;
    border-bottom: 1px solid var(--dim-color);
    font-family: var(--font-mono);
    transition: border-color 0.3s ease;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#theme-toggle {
    background: none;
    border: 1px solid var(--dim-color);
    color: var(--text-color);
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    margin-left: 1rem;
    transition: border-color 0.3s ease, color 0.3s ease;
    font-family: var(--font-mono);
}

#theme-toggle:hover {
    border-color: var(--highlight-color);
}

[data-theme="dark"] #theme-toggle .theme-icon:first-child {
    display: none;
}

[data-theme="light"] #theme-toggle .theme-icon:last-child {
    display: none;
}

#terminal-path {
    color: var(--dim-color);
    transition: color 0.3s ease;
}

#current-section {
    color: var(--text-color);
    transition: color 0.3s ease;
}

.main {
    grid-area: main;
    padding: 2rem;
    overflow-y: auto;
}

.footer {
    grid-area: footer;
    padding: 1rem 2rem;
    text-align: center;
    color: var(--dim-color);
    font-size: 0.8rem;
    transition: color 0.3s ease;
}

.nav {
    margin-top: 3rem;
}

.nav-item {
    margin: 1rem 0;
    cursor: pointer;
    transition: color 0.3s ease;
}

.nav-item.active {
    color: var(--highlight-color);
}

.nav-item:before {
    content: "$ ";
    color: var(--dim-color);
    transition: color 0.3s ease;
}

.nav-item.active:before {
    content: "> ";
}

.content-section {
    display: none;
    animation: fadeIn 0.5s ease;
    max-width: 800px;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.key-hint {
    color: var(--dim-color);
    font-size: 0.8rem;
    margin-left: 1rem;
    transition: color 0.3s ease;
}

h1,
h2,
h3 {
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
}

.cursor {
    display: inline-block;
    width: 0.5rem;
    height: 1rem;
    background-color: var(--text-color);
    animation: blink 1s step-end infinite;
    vertical-align: middle;
    margin-left: 0.2rem;
    transition: background-color 0.3s ease;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.book-item {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--dim-color);
    transition: border-color 0.3s ease;
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.book-cover {
    width: 80px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.book-info {
    flex: 1;
}

.book-item:last-child {
    border-bottom: none;
}

.now-reading-section {
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--dim-color);
    padding-bottom: 2rem;
}

.now-reading-item {
    border-bottom: none;
    margin-bottom: 0;
}

#recommendations {
    margin-top: 3rem;
    border-top: 1px solid var(--dim-color);
    padding-top: 2rem;
}

.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.recommendation-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.recommendation-cover {
    width: 100px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    margin-bottom: 0.8rem;
    transition: transform 0.2s ease;
}

.recommendation-item:hover .recommendation-cover {
    transform: translateY(-5px);
}

.recommendation-item h3 {
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
    color: var(--text-color);
}

.book-title-link,
.book-title-link-small {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.book-title-link:hover,
.book-title-link-small:hover {
    color: var(--highlight-color);
}

.book-author-small {
    font-size: 0.8rem;
    color: var(--dim-color);
    margin-bottom: 0.2rem;
}

.book-author {
    color: var(--dim-color);
    font-size: 0.9rem;
    margin-top: 0.2rem;
}

.rating {
    color: #ffd700;
    /* Gold color for stars */
    font-size: 0.8rem;
    letter-spacing: 2px;
}

.project-item {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--dim-color);
    transition: border-color 0.3s ease;
}

.project-item:last-child {
    border-bottom: none;
}

.project-link {
    color: var(--highlight-color);
    text-decoration: none;
    border-bottom: 1px dotted var(--dim-color);
    transition: all 0.3s ease;
}

.project-link:hover {
    color: var(--text-color);
    border-bottom-style: solid;
}

.blog-post {
    margin-bottom: 3rem;
}

.blog-date {
    color: var(--dim-color);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.resume-section {
    margin-bottom: 2rem;
}

.resume-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--dim-color);
}

.resume-item:last-child {
    border-bottom: none;
}

.resume-title {
    color: var(--highlight-color);
    margin-bottom: 0.5rem;
    font-size: 1.1em;
    transition: color 0.3s ease;
}

.resume-date {
    color: var(--dim-color);
    font-size: 0.9em;
    margin-bottom: 0.5rem;
}

.resume-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.skill-tag {
    background-color: var(--dim-color);
    color: var(--bg-color);
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: var(--font-mono);
}

.social-links {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-top: 2rem;
}

.social-icon {
    color: var(--text-color);
    font-size: 1.75rem;
    transition: color 0.3s ease;
    text-decoration: none;
}

.social-icon:hover {
    color: var(--highlight-color);
}

@media (max-width: 768px) {
    body {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 1fr auto;
        grid-template-areas:
            "header"
            "sidebar"
            "main"
            "footer";
        height: auto;
    }

    .sidebar {
        padding: 1rem 2rem;
        border-right: none;
        border-bottom: 1px solid var(--dim-color);
        background: var(--bg-color);
        /* Remove image */
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .sidebar h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .nav {
        margin-top: 1rem;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1.5rem;
    }

    .nav-item {
        margin: 0;
        font-size: 0.9rem;
    }

    .key-hint {
        display: none;
    }

    .header {
        display: none;
    }

    .header {
        display: block;
        padding: 1rem 2rem;
        border-bottom: none;
    }

    #terminal-path {
        display: none;
        /* Hide path on mobile */
    }

    .header-content {
        justify-content: flex-end;
        /* Just theme toggle */
    }

    .main {
        padding: 1.5rem;
        overflow-y: visible;
        /* Let body scroll */
    }

    .project-item {
        padding-bottom: 2rem;
    }
}