/* --- Import Google Fonts --- */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap");

/* --- Light Theme (Default) --- */
:root {
    --bg-color: #fcfcfc;
    --text-color: #111827;
    --primary-color: #0064ff; /* Teal */
    --primary-rgb: 0, 100, 255;
    --alt-bg-color: #d1d1d1;
    --header-bg-color: rgba(252, 252, 252, 0.8);
    --border-color: #e5e7eb;
    --shadow-color: rgba(0, 0, 0, 0.05);
    --link-hover-color: #0064ff; /* Darker Teal */
}

/* --- Dark Theme --- */
[data-theme="dark"] {
    --bg-color: #0d1117; /* Dark Blue */
    --text-color: #e5e7eb;
    --primary-color: #0064ff; /* Bright Teal */
    --primary-rgb: 0, 100, 255;
    --alt-bg-color: #31373e;
    --header-bg-color: rgba(13, 17, 23, 0.8);
    --border-color: #30363d;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --link-hover-color: #0064ff; /* Lighter Teal */
}

.material-icons {
    line-height: unset !important;
}

hidden {
    display: none;
}

/* --- Base Styles --- */
body {
    font-family: "Inter", sans-serif;
    margin: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition:
        background-color 0.3s ease,
        color 0.3s ease;
}

/* --- Header & Navigation --- */
header {
    background-color: var(--header-bg-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    position: fixed;
    top: 0;
    width: calc(100% - 4rem); /* Adjust for padding */
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    transition:
        background-color 0.3s ease,
        border-color 0.3s ease;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 30px;
    margin: 0 auto;
}

.nav-right-container {
    display: flex;
    align-items: center;
    gap: 15px;
}
.nav-left-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-left-container h1 {
    margin: 0; /* Remove default h1 margin */
    font-size: 1.1rem;
    padding: 0;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 25px;
}
#hamburger-btn {
    margin-right: 10px;
    padding-top: 4px;
    display: none;
}

nav ul li a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    padding-bottom: 5px;
    transition: color 0.3s ease;
}

nav ul li a::after {
    content: "";
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

nav ul li a:hover {
    color: var(--primary-color);
}

nav ul li a:hover::after {
    width: 100%;
}

/* The full-screen overlay menu */
#mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-color);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    /* Hide it by default */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-100%);
    transition: all 0.4s ease-in-out;
}
#mobile-menu #close-btn {
    padding-top: 5px;
    position: absolute;
    top: 18px;
    right: 20px;
}
#mobile-menu ul {
    list-style: none;
    font-size: 1.8em;
    height: 60vh;
    width: 60vw;
    align-content: center;
}
#mobile-menu ul li a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}
#mobile-menu ul li a:hover {
    color: var(--primary-color);
}
/* The class that will be toggled with JavaScript to show the menu */
#mobile-menu.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
/* Prevent scrolling when the menu is open */
body.menu-open {
    overflow: hidden;
}

/* --- Theme Toggle Button --- */
#theme-toggle {
    right: 0;
    cursor: pointer;
    width: 40px;
    height: 40px;
    background-color: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        background-color 0.3s ease,
        transform 0.3s ease;
}

#theme-toggle:hover {
    background-color: var(--alt-bg-color);
}

#theme-toggle .material-icons {
    color: var(--text-color);
    transition:
        color 0.3s ease,
        transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

html[data-theme="dark"] #theme-toggle .material-icons {
    transform: rotate(180deg);
}

/* --- Main Content --- */
main {
    padding: 40px 20px;
    max-width: 900px;
    margin: 50px auto 0px; /* Increased top margin for fixed header */
}

.main-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin: 0;
}
.gallery-image {
    object-position: 0% 32%;
}

section {
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.page-header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 2rem;
}

.page-header h1 {
    margin: 0;
}

.page-header p {
    margin: 0.5rem 0 0 0;
    font-size: 1.1rem;
    opacity: 0.8;
}

.hashtag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 0.5rem;
}

.hashtag {
    display: flex;
    align-items: center;
    background-color: var(--alt-bg-color);
    border-radius: 16px;
    padding: 6px 12px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.hashtag.dragging {
    opacity: 0.5;
}

.hashtag:hover {
    background-color: color-mix(
        in srgb,
        var(--primary-color) 20%,
        var(--alt-bg-color)
    );
}

.hashtag.inactive {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    opacity: 0.6;
}

.hashtag .close-icon {
    font-size: 1rem;
    margin-left: 8px;
    opacity: 0.8;
    transition:
        transform 0.3s ease,
        opacity 0.2s ease;
}

.hashtag.inactive .close-icon {
    transform: rotate(90deg);
}

.hashtag:hover .close-icon {
    opacity: 1;
}

h1,
h2 {
    color: var(--text-color);
    margin-top: 0;
}

p {
    line-height: 1.7;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--link-hover-color);
    text-decoration: underline;
}

hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 2rem 0;
}

/* --- Project & Blog Specific Styles --- */
.project,
.blog-article {
    margin-bottom: 1.5rem;
}

/* --- Form Styles --- */
form div {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition:
        border-color 0.3s ease,
        background-color 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px
        color-mix(in srgb, var(--primary-color) 20%, transparent);
}

button {
    background-color: var(--alt-bg-color);
    color: var(--text-color);
    border: none;
    padding: 5px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    transition:
        background-color 0.3s ease,
        transform 0.2s ease;
}
button:hover {
    background-color: var(--link-hover-color);
    transform: translateY(-2px);
}

button[type="submit"] {
    background-color: var(--primary-color);
    color: var(--bg-color);
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    transition:
        background-color 0.3s ease,
        transform 0.2s ease;
}
button[type="submit"]:hover {
    background-color: var(--link-hover-color);
    transform: translateY(-2px);
}

/* --- Footer --- */
footer {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 0rem 2rem 2rem;
    background: linear-gradient(
        to bottom,
        var(--bg-color),
        var(--alt-bg-color)
    );
    color: var(--text-color);
    transition: background 0.3s ease;
}

#fortune-text {
    opacity: 0.8;
    margin-bottom: 4rem;
    font-size: 0.9rem;
    min-height: 1em; /* Prevent layout shift while loading */
    line-height: 1.3;
    letter-spacing: 0.17em;
    cursor: help;
}

.footer-bottom {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.footer-bottom p {
    margin: 0;
    opacity: 0.7;
}

.color-palette {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.color-palette h5 {
    margin: 0;
    font-size: 0.8rem;
    font-weight: normal;
    opacity: 0.8;
}

.palette-colors {
    display: flex;
    border: 1px solid var(--text-color);
    border-radius: 4px;
    overflow: hidden;
}

.palette-color {
    width: 15px;
    height: 20px;
}

/* --- Cursor Tooltip --- */
.cursor-tooltip {
    display: none;
    position: fixed;
    z-index: 2000;
    background-color: var(--alt-bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    box-shadow: 0 4px 8px var(--shadow-color);
    width: max-content;
    max-width: 300px;
    font-size: 0.9rem;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

strong[data-tooltip] {
    color: var(--primary-color);
    cursor: help;
}

/* --- Media Queries for Responsiveness --- */
@media (max-width: 768px) {
    /* Hide the desktop navigation on mobile */
    #desktop-nav {
        display: none;
    }

    /* Show the hamburger button on mobile */
    #hamburger-btn {
        display: block;
    }

    .main-image {
        height: 100px;
    }
}

/* --- Social Links --- */
.social-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.social-link {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 1rem;
    background-color: var(--alt-bg-color);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-color);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
    border: 1px solid var(--border-color);
    aspect-ratio: 1 / 1;
}

.social-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px var(--shadow-color);
    color: var(--primary-color);
}

.social-link:hover .social-svg-stroked {
    stroke: var(--link-hover-color);
}

/* Base style for all social SVGs */
.social-svg {
    width: 48px;
    height: 48px;
}

/* Style for line-art icons */
.social-svg-stroked {
    stroke: var(--primary-color);
    fill: none;
    stroke-width: 1.5;
    transition: stroke 0.2s ease;
}

.social-text {
    font-weight: 500;
    font-size: 1rem;
}

/* --- 404 Page --- */
.text-center {
    text-align: center;
}

.button-primary {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--bg-color);
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    text-decoration: none;
    transition:
        background-color 0.3s ease,
        transform 0.2s ease;
}

.button-primary:hover {
    background-color: var(--link-hover-color);
    transform: translateY(-2px);
}

/* --- Quotes Page --- */
#quotes-grid {
    display: grid;
    gap: 1.5rem;
}

.quote-card {
    background-color: var(--alt-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    box-shadow: 0 4px 6px -1px var(--shadow-color);
    transition: box-shadow 0.3s ease;
}

.quote-card:hover {
    box-shadow: 0 8px 15px var(--shadow-color);
}

.quote-preview {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    cursor: pointer;
}

.quote-text {
    font-size: 1.2rem;
    font-style: italic;
    font-weight: 500;
    margin: 0;
    grid-column: 1 / -1;
}

.quote-author {
    display: block;
    text-align: left;
    font-weight: 500;
    color: var(--primary-color);
    margin-top: 1rem;
    grid-column: 1 / 2;
}

.quote-expand-icon {
    font-size: 2rem;
    color: var(--text-color);
    opacity: 0.7;
    transition:
        transform 0.3s ease,
        opacity 0.3s ease;
    grid-column: 2 / 3;
    justify-self: end;
}

.quote-preview:hover .quote-expand-icon {
    opacity: 1;
}

.quote-card.expanded .quote-expand-icon {
    transform: rotate(360deg);
}

.quote-details {
    max-height: 0;
    overflow: hidden;
    transition:
        max-height 0.5s ease-in-out,
        padding-top 0.5s ease-in-out;
}

.quote-card.expanded .quote-details {
    max-height: 1000px;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    margin-top: 1.5rem;
}

.quote-details h3 {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-color);
    opacity: 0.7;
    margin-top: 0;
    margin-bottom: 0.5rem;
    border: none;
    padding: 0;
}

.quote-details p {
    font-size: 1rem;
    line-height: 1.6;
    margin-top: 0;
    margin-bottom: 1.5rem;
}

/* --- Blog --- */
.blog-list-item {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2rem;
    margin-bottom: 2rem;
}

.blog-list-item h2 {
    margin: 0 0 0.5rem 0;
    border: none;
}

.blog-list-item h2 a {
    text-decoration: none;
}

.blog-list-item p {
    margin: 0.5rem 0;
}

.read-more {
    display: inline-block;
    margin-top: 1rem;
    font-weight: bold;
}

.post-content {
    line-height: 1.8;
}

.post-content h1,
.post-content h2,
.post-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.post-content p {
    margin-bottom: 1rem;
}

.post-content blockquote {
    margin: 1rem 0;
    padding: 1rem;
    background-color: var(--alt-bg-color);
    border-left: 4px solid var(--primary-color);
}

.search-bar-container {
    margin-bottom: 2rem;
}

#blog-search-bar {
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* --- About Page --- */
.about-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem; /* Reduced gap for paragraph flow */
}

.about-content p {
    margin: 0; /* Remove default paragraph margins */
}

.about-section h2 {
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
}

.education-item {
    margin-bottom: 1.5rem;
}

.education-item h3 {
    margin: 0 0 0.5rem 0;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.education-item p {
    margin: 0;
}

.instagram-header {
    text-align: center;
    margin-bottom: 2rem;
}

.instagram-header h2 {
    margin: 0 0 0.5rem 0;
    border: none; /* Override default h2 border */
    font-size: 1.4rem;
}

.instagram-header a {
    font-size: 1.1rem;
    font-weight: 500;
}

/* --- Gallery Page --- */
.instagram-section {
    background-color: var(--alt-bg-color);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.projects-section {
    margin-top: 2rem;
}

.project-card {
    background-color: var(--alt-bg-color);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.project-card h3 {
    margin-top: 0;
    color: var(--primary-color);
}
