* {
    box-sizing: border-box;
}

:root[data-theme="light"] {
    --bg-color: #FFFAED;
    --text-color: #333333;
    --header-bg: #2c3e50;
    --nav-bg: #ffffff;
    --nav-a-color: #333333;
    --card-bg: #ffffff;
    --card-border: #ddd;
}

:root[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #ffffff;
    --header-bg: #1c2833;
    --nav-bg: #2c3e50;
    --nav-a-color: #ffffff;
    --card-bg: #2d2d2d;
    --card-border: #404040;
}

body {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.3s, color 0.3s;
}

header {
    background-color: var(--header-bg);
    color: white;
    text-align: center;
    padding: 2rem 0;
}

nav {
    background-color: var(--nav-bg);
    padding: 0.5rem;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
    z-index: 1000;
    position: relative;
}
/* General link styles */
a {
    /* color: #FFD700;  Golden yellow */
    color: #3498db;
    text-decoration: none;
    /* border-bottom: 1px dotted #3498db; */
}

/* Keep footer links their original color */
.footer a {
    color: var(--text-color);
}

/* Keep blog card links readable */
.blog-card a {
    color: var(--text-color);
}

/* Keep project card links readable */
.project-card a {
    color: var(--text-color);
}

nav a {
    color: var(--nav-a-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.2s;
    white-space: nowrap;
}

nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.section {
    margin-bottom: 3rem;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    border: 1px solid var(--card-border);
    padding: 1rem;
    border-radius: 5px;
    background-color: var(--card-bg);
}

.blog-post {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: var(--card-bg);
    border-radius: 8px;
}

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

.blog-post-header h1 {
    font-family: 'Playfair Display', serif;
    margin: 1rem 0;
    font-size: 2.5rem;
}

.blog-content {
    line-height: 1.8;
    font-size: 1rem;
}

.blog-content h2 {
    font-family: 'Playfair Display', serif;
    margin: 2rem 0 1rem 0;
}

.blog-content p {
    margin-bottom: 1.5rem;
}

.blog-post-footer {
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid var(--card-border);
}

.post-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    background-color: var(--bg-color);
    color: var(--text-color);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}

.tag:hover {
    opacity: 0.8;
}

.theme-toggle {
    position: relative;
    right: auto;
    background: none;
    border: 2px solid var(--nav-a-color);
    color: var(--nav-a-color);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    margin-left: 0.5rem;
}

.theme-toggle:hover {
    background-color: 2d2d2d;
    color: var(--nav-bg);
}

.profile-pic {
    width: 300px;
    height: 300px;
    margin: 0 auto 2rem auto;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

.profile-pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Now page specific styles */
.now-page {
    max-width: 800px;
    line-height: 1.8;
}

.now-update {
    font-style: italic;
    color: var(--text-color);
    opacity: 0.8;
}

.last-update {
    color: var(--text-color);
    opacity: 0.7;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--card-border);
}

.now-section {
    margin-bottom: 3rem;
}

.now-section h2 {
    color: var(--text-color);
    margin-bottom: 1rem;
}

.now-page a {
    color: #3498db;
    text-decoration: none;
    border-bottom: 1px dotted #3498db;
}

.now-page a:hover {
    border-bottom-style: solid;
}

.nav-sticky {
    position: fixed;
    top: 0;
    left: 0;
}

/* Add padding to body when nav is sticky to prevent content jump */
body.has-sticky-nav {
    padding-top: 45px;
}

.header-with-bg {
    position: relative;
    background-image: url('../assets/images/background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
}

:root[data-theme="light"] .header-overlay {
    background-color: rgba(0, 0, 0, 0.05);
}

.header-content {
    position: relative;
    z-index: 1;  /* Places content above the overlay */
    text-align: center;
    color: white;  /* Makes text white for better contrast */
}

.header-content h1 {
    font-size: 3.5rem;
    font-weight: bold;
    margin: 1rem 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 0.05em;
}

.header-content p {
    font-size: 1.5rem;
    margin: 0.5rem 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    font-weight: 500;
    opacity: 0.95;
}

/* Adjust profile pic container if needed */
.profile-pic {
    position: relative;
    z-index: 2;
}

.footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
    border-top: 1px solid var(--card-border);
    color: var(--text-color);
    opacity: 0.8;
    font-size: 0.9rem;
}

.footer p {
    margin: 0;
}

.social-links {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
    border: 1px solid var(--card-border);
}

.social-link:hover {
    background-color: var(--card-bg);
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.social-link i {
    font-size: 1.2rem;
}

.blog-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 2rem;
    max-width: 800px;  /* Limits the width for better readability */
    margin-left: auto;
    margin-right: auto;
}

.blog-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 2rem;
    transition: transform 0.2s ease;
    width: 100%;
}

.blog-card:hover {
    transform: translateY(-3px);
}

.blog-date {
    color: var(--text-color);
    opacity: 0.7;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.blog-card h2 {
    font-family: 'Playfair Display', serif;
    margin: 0.5rem 0;
}

.blog-excerpt {
    color: var(--text-color);
    opacity: 0.9;
    margin: 1rem 0;
}

.read-more {
    display: inline-block;
    color: var(--text-color);
    text-decoration: none;
    font-weight: bold;
    transition: transform 0.2s ease;
}

.read-more:hover {
    transform: translateX(5px);
}

@media (min-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;  /* Forces single column */
    }
}

/* Add responsive adjustments */
@media (max-width: 600px) {
    nav {
        padding: 0.5rem;
        gap: 0.3rem;
    }

    nav a {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    .theme-toggle {
        padding: 6px 12px;
        font-size: 0.9rem;
        margin-top: 0.3rem;  /* Add some space when wrapped */
    }
}
