@media (max-width: 900px) {
  .toc-sidebar-container, .toc-sidebar {
    display: none !important;
  }
}
/* ========== css/style.css (Corrected with All Page Styles) ========== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

/* --- CSS Variables (Dark Mode Only) --- */
:root {
    --dark-bg: #0d0d1a;
    --card-background: #1a1a2e;
    --glass-card-background: rgba(26, 26, 46, 0.5);
    --text-color: #e0e0e0;
    --heading-color: #ffffff;
    --border-color: rgba(255, 255, 255, 0.1);
    --primary-color: #00a8ff;
    --secondary-color: #9c88ff;
}

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

html {
    background-color: var(--dark-bg);
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    overflow-x: hidden;
    background-color: transparent;
}

body:not(.home-page) {
    background-color: var(--dark-bg);
}

body.no-scroll {
    overflow: hidden;
}

.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
}

main {
    padding-top: 80px;
}

/* --- Header & Navigation --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 20px 0;
    background: rgba(13, 13, 26, 0.7);
    backdrop-filter: blur(12px);
    transition: background-color 0.3s, box-shadow 0.3s, backdrop-filter 0.3s, transform 0.3s cubic-bezier(.4,0,.2,1);
}
header.scrolled {
    background: rgba(13, 13, 26, 0.92);
    box-shadow: 0 2px 16px 0 rgba(0,0,0,0.12);
    backdrop-filter: blur(16px);
}
@media (max-width: 768px) {
  header {
    background: rgba(13, 13, 26, 0.85);
    backdrop-filter: blur(16px);
    box-shadow: 0 2px 16px 0 rgba(0,0,0,0.18);
  }
}
/* --- Scroll to Top Button --- */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
header nav a.logo { 
    font-size: 1.8em; 
    font-weight: 700; 
    color: var(--heading-color); 
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px; 
}

header nav a.logo img {
    height: 60px;
}
.nav-links { list-style: none; display: flex; align-items: center; }
.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    position: relative;
    padding: 5px 20px;
}
.nav-links a.active, .nav-links a:hover { color: var(--primary-color); }

/* --- Hamburger Menu --- */
.hamburger {
    display: none; /* Hidden on desktop */
    flex-direction: column;
    justify-content: space-around;
    width: 2rem;
    height: 2rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}
.hamburger span {
    width: 2rem;
    height: 0.25rem;
    background: var(--heading-color);
    border-radius: 10px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
}

.close-btn { display: none; }

/* --- Homepage Specific Styles --- */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    outline: none;
    z-index: -1;
}

#page-content {
    width: 100%;
    position: relative;
    z-index: 1;
}

.content-section {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 100px 0;
}

#home.content-section {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0px 0;

}

.hero-content h1 { font-size: clamp(2.5rem, 8vw, 5rem); color: var(--heading-color); }
.hero-content .subtitle { font-size: clamp(1rem, 4vw, 1.5rem); margin-bottom: 30px; }

.about-content { 
    display: flex; 
    align-items: center; 
    gap: 3rem; /* Increased gap for better spacing */
}
.about-image img { 
    width: 450px;   /* Increased from 400px */
    height: 450px;  /* Increased from 400px */
    border-radius: 10%; 
    object-fit: cover; 
}
.about-text {
    background: rgba(26, 26, 46, 0.6); /* Semi-transparent glass background */
    backdrop-filter: blur(10px);      /* The frosted glass effect */
    border-radius: 15px;              /* Rounded corners for the card */
    padding: 2.5rem;                  /* Space inside the card */
    border: 1px solid rgba(255, 255, 255, 0.1); /* A subtle border to catch the light */
}
/* --- Add this new block to style.css for the News List --- */

/* This is the NEW, updated rule */
.news-list-container {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(26, 26, 46, 0.6); /* Semi-transparent glass background */
    backdrop-filter: blur(10px);      /* The frosted glass effect */
    border-radius: 15px;              /* Rounded corners for the card */
    padding: 2rem;                    /* Space inside the card */
    border: 1px solid rgba(255, 255, 255, 0.1); /* A subtle border */
}

.news-item-row {
    display: grid;
    grid-template-columns: 150px 1fr; /* Date column | Description column */
    gap: 2rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
    align-items: start;
}

.news-item-row:last-child {
    border-bottom: none; /* Remove border from the last item */
}

.news-date {
    font-weight: 600;
    color: var(--text-color);
    opacity: 0.8;
}

.news-description {
    color: var(--text-color);
    line-height: 1.6;
}

.news-description a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.news-description a:hover {
    text-decoration: underline;
}

/* --- Homepage Footer Contact Form --- */
footer.content-section {
    min-height: auto;
    padding: 80px 0;
}
.contact-form-footer { 
    display: flex; 
    flex-direction: column; 
    gap: 15px; 
    max-width: 600px; 
    margin: 0 auto 40px; 
}
.contact-form-footer input, .contact-form-footer textarea {
    width: 100%; 
    padding: 15px; 
    border-radius: 8px; 
    border: 1px solid var(--border-color);
    background: rgba(0,0,0,0.2); 
    color: var(--text-color); 
    font-family: 'Poppins', sans-serif;
    font-size: 1em;
}
.contact-form-footer button {
    border: none;
    cursor: pointer;
    width: fit-content;
    align-self: center;
    margin-top: 10px;
}
.social-links { 
    text-align: center; 
    margin: 20px 0; 
}
.social-links a { 
    font-size: 1.5em; 
    color: var(--text-color); 
    margin: 0 15px; 
}
.copyright { 
    text-align: center; 
    font-size: 0.9em; 
    margin-top: 30px; 
    opacity: 0.7; 
}

/* --- ★★★ RESTORED STYLES FOR OTHER PAGES ★★★ --- */

/* --- Generic Page Styles --- */
.page-section { padding: 80px 0; }
.section-title {
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 60px;
    color: var(--heading-color);
    position: relative;
}
.section-title::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 4px;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
}
.cta-button {
    display: inline-block;
    padding: 12px 28px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 168, 255, 0.2);
}
.progress-bar {
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1001;
    width: 0%;
}
.home-page .progress-bar { display: none; }

/* --- Blog Page --- */
.blog-layout { display: flex; gap: 40px; }
.blog-posts { flex: 3; }
.blog-sidebar { flex: 1; }
#blogSearchInput { width: 100%; padding: 12px; border-radius: 8px; border: 1px solid var(--border-color); background: var(--card-background); color: var(--text-color); font-size: 1em; margin-bottom: 30px; }
.blog-card { background: var(--card-background); border: 1px solid var(--border-color); border-radius: 10px; margin-bottom: 30px; overflow: hidden; transition: transform 0.3s; }
.blog-card a { text-decoration: none; }
.blog-card:hover { transform: translateY(-5px); }
.blog-card-content { padding: 30px; }
.blog-date { font-size: 0.9em; color: var(--primary-color); }
.blog-card h3 { font-size: 1.8em; color: var(--heading-color); margin: 5px 0 10px; }
.blog-card p { color: var(--text-color); }
.blog-tags { margin-top: 20px; }
.blog-tags span { display: inline-block; background: var(--dark-bg); padding: 5px 10px; border-radius: 5px; font-size: 0.8em; margin-right: 10px; }
.blog-sidebar h3 { color: var(--heading-color); margin-bottom: 20px; }
.category-list { list-style: none; }
.category-list li a { text-decoration: none; color: var(--text-color); display: block; padding: 10px; border-radius: 5px; transition: background-color 0.3s, color 0.3s; }
.category-list li a:hover { background-color: var(--primary-color); color: white; }

/* --- Single Blog Post Page --- */
.blog-post-header { text-align: center; padding: 40px 0; }
.blog-post-header h1 { font-size: 3em; margin-bottom: 10px; color: var(--heading-color); }
.blog-post-meta { font-size: 1em; color: var(--secondary-color); }
.blog-post-image {
    width: 100vw;
    max-width: 100vw;
    min-width: 0;
    max-height: 500px;
    object-fit: cover;
    border-radius: 0;
    margin-bottom: 40px;
    display: block;
    margin-left: 50%;
    transform: translateX(-50%);
}
@media (min-width: 601px) {
  .blog-post-image {
    width: 100%;
    max-width: 800px;
    border-radius: 10px;
    margin-left: auto;
    margin-right: auto;
    transform: none;
  }
}
.blog-post-content { max-width: 800px; margin: 0 auto; font-size: 1.1em; line-height: 1.8; }
.blog-post-content p { margin-bottom: 20px; }
.blog-post-content h2 { margin-top: 40px; margin-bottom: 20px; color: var(--primary-color); }
.blog-post-content img { max-width: 100%; border-radius: 8px; margin: 20px 0; }

/* --- Projects Page --- */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 30px; }
.project-card { background: var(--card-background); border-radius: 10px; overflow: hidden; border: 1px solid var(--border-color); box-shadow: 0 4px 6px rgba(0,0,0,0.05); transition: transform 0.3s; }
.project-card:hover { transform: translateY(-10px); }
.project-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    display: block;
    max-width: 100%;
    background: #222;
    aspect-ratio: 16/9;
    /* fallback for browsers without aspect-ratio */
}

@media (max-width: 600px) {
  .project-card img {
    height: auto;
    aspect-ratio: 16/9;
    min-height: 140px;
    max-height: 220px;
  }
}
.project-info { padding: 25px; }
.project-links { margin-top: 20px; }
.project-links a { text-decoration: none; color: var(--primary-color); margin-right: 15px; font-weight: 600; }

/* --- Resume Page --- */
.resume-download { text-align: center; margin-bottom: 50px; }
.resume-content { max-width: 800px; margin: 0 auto; background: var(--card-background); padding: 40px; border-radius: 10px; border: 1px solid var(--border-color); }
.resume-section { margin-bottom: 40px; }
.resume-section h3 { color: var(--primary-color); border-bottom: 2px solid var(--border-color); padding-bottom: 10px; margin-bottom: 20px; }
.resume-item { margin-bottom: 20px; }
.resume-item h4 { font-size: 1.2em; color: var(--heading-color); }
.skills-list span { display: inline-block; background: var(--dark-bg); padding: 8px 15px; border-radius: 5px; margin: 5px; }
.meme-container {
    max-width: 600px; /* Control the max size of the meme */
    margin: 0 auto; /* Center the container */
    text-align: center; /* Center the button below the image */
}

.meme-container img {
    width: 100%; /* Make the image responsive */
    height: auto; /* Maintain aspect ratio */
    border-radius: 10px;
    margin-bottom: 2rem; /* Space between image and button */
    background-color: var(--card-background); /* Placeholder color */
}

/* --- GitHub Stats Page --- */
.github-card { max-width: 700px; margin: 0 auto; background: var(--card-background); border-radius: 15px; border: 1px solid var(--border-color); overflow: hidden; }
.github-header { display: flex; align-items: center; gap: 20px; padding: 25px; background: var(--dark-bg); }
.github-avatar { width: 80px; height: 80px; border-radius: 50%; }
.github-header h4 { font-size: 1.4em; color: var(--heading-color); }
.github-header a { color: var(--primary-color); text-decoration: none; }
.github-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); padding: 25px; gap: 20px; }
.stat-item { text-align: center; }
.stat-item i { font-size: 1.8em; color: var(--primary-color); margin-bottom: 10px; }
.stat-item span { font-size: 1.5em; font-weight: 700; color: var(--heading-color); }
.github-footer { display: flex; justify-content: space-between; align-items: center; padding: 20px 25px; background: linear-gradient(90deg, var(--primary-color), var(--secondary-color)); color: white; }
.rank p { font-size: 2em; font-weight: 700; }
.rank-percent { font-size: 1.2em; font-weight: 600; padding: 8px 15px; background: rgba(255,255,255,0.2); border-radius: 20px; }

/* --- Single Blog Post Page with Table of Contents --- */

    .blog-post-layout {
    display: grid; /* Using grid is more robust for this layout */
    grid-template-columns: 3fr 1fr; /* Main content is 3x wider than sidebar */
    align-items: flex-start;
    gap: 3rem;
    }

    .blog-post-main {
        flex: 3; /* Makes the main content take up more space */
        min-width: 0; /* Prevents flexbox overflow issues */
    }

    .toc-sidebar-container {
        flex: 1; /* Sidebar takes up less space */
    }

    .toc-sidebar {
        position: sticky; /* Makes the sidebar stay in place on scroll */
        top: 120px; /* Positions it below your fixed header */
    }

    .toc-sidebar h3 {
        font-size: 1.1em;
        color: var(--heading-color);
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid var(--border-color);
    }

    #toc-list {
        list-style: none;
        padding-left: 0;
    }

    #toc-list li a {
        display: block;
        padding: 10px 15px;
        color: var(--text-color);
        text-decoration: none;
        border-radius: 5px;
        transition: all 0.2s ease-in-out;
        position: relative;
        border-left: 2px solid transparent; /* Placeholder border */
    }

    #toc-list li a:hover {
        background-color: rgba(255, 255, 255, 0.05);
        color: var(--primary-color);
    }

    /* This is the glowing pointer style */
    #toc-list li a.active {
        color: var(--primary-color);
        font-weight: 600;
        border-left-color: var(--primary-color); /* The solid part of the pointer */
        box-shadow: inset 3px 0 15px -4px var(--primary-color); /* The glow effect */
    }

/* --- Responsive Design & Mobile Menu --- */
@media (max-width: 768px) {
    /* Add this inside your existing @media block */
    .news-item-row {
    grid-template-columns: 1fr; /* Switch to a single column */
    gap: 0.5rem;
    }
    .toc-sidebar-container {
        display: none;
    }
    .blog-post-layout {
    display: block; /* Revert from grid to a simple block layout */
    }
    .hamburger {
        display: flex;
    }
    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 70%;
        background: rgba(13, 13, 26, 0.95);
        backdrop-filter: blur(15px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2rem;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        z-index: 100;
    }
    .nav-links.is-open {
        transform: translateX(0);
    }
    .nav-links li {
        width: 100%;
        text-align: center;
    }
    .nav-links a {
        font-size: 1.5rem;
        padding: 1rem 0;
    }
    .close-btn {
        display: block;
        position: absolute;
        top: 2rem;
        right: 2rem;
        background: none;
        border: none;
        color: white;
        font-size: 2.5rem;
        font-weight: bold;
        cursor: pointer;
    }
    .about-content { flex-direction: column; text-align: center; }
    .about-image img {
    width: 300px; /* A more suitable size for mobile */
    height: 300px;
    }
    /* Adjust the blog layout for mobile */
    .blog-layout { flex-direction: column; }
    /* Make the blog post title smaller on mobile */
    .blog-post-header h1 {
        font-size: 2.2em; /* Was 3em, much smaller now */
        line-height: 1.3; /* Improves readability */
    }

    /* Make the main blog text smaller and more readable on mobile */
    .blog-post-content {
        font-size: 1em; /* Was 1.1em */
        line-height: 1.7; /* A bit more spacing between lines on mobile */
    }

    /* Make the subheadings smaller on mobile */
    .blog-post-content h2 {
        font-size: 1.5em; /* Adjust as needed */
    }
    
}

/* --- Generic Footer for other pages --- */
footer:not(.content-section) {
    background: var(--card-background);
    padding: 50px 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: 50px;
}
footer:not(.content-section) h3 { color: var(--heading-color); margin-bottom: 10px; }
footer:not(.content-section) .social-links a { color: var(--text-color); font-size: 1.8em; margin: 0 15px; transition: color 0.3s, transform 0.3s; }
footer:not(.content-section) .social-links a:hover { color: var(--primary-color); transform: translateY(-5px); }
footer:not(.content-section) .copyright { font-size: 0.9em; margin-top: 20px; }

.github-card-divider {
    border: none;
    height: 1px;
    background-color: var(--border-color);
    margin: 0 25px; /* Adds spacing on the sides */
}

.github-trophy-body {
    padding: 20px;
}

.github-trophy-body img {
    width: 100%;
}