/* ==================== GOOGLE FONTS ==================== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&family=Playfair+Display:wght@700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@400;500;600&display=swap');

/* ==================== VARIABLES CSS ==================== */
:root {
    /* Light Mode Variables (Default) */
    --hue-color: 230;
    --primary-color: hsl(var(--hue-color), 69%, 61%);
    --title-color: hsl(var(--hue-color), 8%, 15%);
    --text-color: hsl(var(--hue-color), 8%, 45%);
    --body-color: hsl(var(--hue-color), 60%, 99%);
    --container-color: #FFF;
    --input-color: hsl(var(--hue-color), 70%, 96%);
    --body-font: 'Poppins', sans-serif;
    --title-font: 'Playfair Display', serif;
}

html[data-theme='dark'] {
    /* Dark Mode Variables */
    --title-color: hsl(var(--hue-color), 8%, 95%);
    --text-color: hsl(var(--hue-color), 8%, 75%);
    --body-color: hsl(var(--hue-color), 28%, 12%);
    --container-color: hsl(var(--hue-color), 29%, 16%);
    --input-color: hsl(var(--hue-color), 29%, 20%);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--body-font);
    background-color: var(--body-color);
    color: var(--text-color);
    line-height: 1.7;
    transition: background-color 0.4s, color 0.4s;
}

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

a:hover {
    color: hsl(var(--hue-color), 69%, 70%);
}

h1,
h2,
h3 {
    font-family: var(--title-font);
    color: var(--title-color);
    line-height: 1.3;
}

ul {
    list-style-type: none;
    padding-left: 0;
}

li {
    margin-bottom: 0.75rem;
}

/* ==================== POST LAYOUT ==================== */
.post-header {
    padding: 1.5rem 2rem;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-header__back-link {
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.post-main {
    padding: 0 2rem;
}

.post-article {
    max-width: 800px;
    margin: 0 auto;
}

.post-title-header {
    text-align: center;
    padding: 3rem 0;
    border-bottom: 1px solid var(--input-color);
    margin-bottom: 3rem;
}

.post-category {
    display: inline-block;
    background-color: var(--primary-color);
    color: #FFF;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.post-title-header h1 {
    font-size: 2.75rem;
}

.post-subtitle {
    font-size: 1.1rem;
    max-width: 650px;
    margin: 1rem auto 0;
}

.post-content h2 {
    font-size: 1.75rem;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--input-color);
}

.post-footer {
    text-align: center;
    padding: 4rem 2rem;
    margin-top: 3rem;
}

/* ==================== PROJECT DETAILS LAYOUT ==================== */
.project-item {
    background-color: var(--container-color);
    padding: 2rem;
    border-radius: 1rem;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.project-item h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.project-item p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.project-item h4 {
    font-size: 1.1rem;
    color: var(--title-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-family: var(--body-font);
    font-weight: 600;
}

.tools-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.tools-table th,
.tools-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--input-color);
}

.tools-table th {
    color: var(--title-color);
    font-weight: 600;
}

.skills-list li,
p.skills-summary {
    background-color: var(--input-color);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-color);
}


/* --- Unique Style for Cybersecurity Post --- */
.cybersecurity-post .project-item {
    border-top: 4px solid hsl(270, 70%, 75%);
    /* Purple top border */
    border-left: none;
}

.cybersecurity-post .project-item:hover {
    box-shadow: 0 8px 30px hsla(270, 70%, 50%, 0.15);
}

.cybersecurity-post .project-item h3 {
    color: hsl(270, 70%, 75%);
    /* Purple title */
}

    /* Responsive: Make all cybersecurity cards same size on mobile */
    @media screen and (max-width: 600px) {
        .cybersecurity-post .project-item {
            min-width: 0;
            max-width: 100%;
            width: 100%;
            box-sizing: border-box;
            border-radius: 0.7rem;
            padding: 1rem;
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            align-items: stretch;
            height: 100%;
            margin-left: 0;
            margin-right: 0;
        }
    }


/* --- Unique Style for RATs Post --- */
.rats-post .project-item {
    border-left: 4px solid hsl(270, 69%, 61%);
    /* Purple left border */
    background-color: hsla(270, 20%, 12%, 0.7);
}

.rats-post .project-item:hover {
    box-shadow: 0 8px 30px hsla(270, 69%, 50%, 0.15);
}

.rats-post .project-item h3 {
    color: hsl(270, 70%, 75%);
    /* Purple title */
}


/* --- Unique Style for Malware Analysis Post --- */
.malware-post .project-item {
    border-right: none;
    /* Remove right border */
    border-left: 4px solid hsl(145, 69%, 61%);
    /* Add green left border */
    text-align: left;
    /* Align text to the left */
}


/* --- Unique Style for Networking Posts --- */
.networking-post .project-item {
    border-left: none;
    border-top: 4px solid hsl(190, 80%, 65%);
    /* Cyan top border */
    background-color: hsla(230, 29%, 16%, 0.7);
    backdrop-filter: blur(4px);
}

.networking-post .project-item:hover {
    box-shadow: 0 8px 30px hsla(190, 80%, 50%, 0.15);
}

.networking-post .project-item h3 {
    color: hsl(190, 80%, 70%);
    /* Cyan title */
}

/* ==================== UNIQUE POST STYLES ==================== */
html[data-theme='dark'] body.cybersecurity-post {
    background-image: linear-gradient(rgba(18, 24, 38, 0.9), rgba(18, 24, 38, 0.9)), url('assets/cybersecurity-bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

html[data-theme='light'] body.programming-post {
    background-color: #f0f2f5;
    background-image: radial-gradient(hsl(230, 15%, 85%) 1px, transparent 1px);
    background-size: 15px 15px;
}

html[data-theme='light'] .programming-post a,
html[data-theme='light'] .programming-post .resource-list a::before {
    color: hsl(210, 60%, 50%);
}

html[data-theme='light'] .programming-post h1,
html[data-theme='light'] .programming-post h2,
html[data-theme='light'] .programming-post p,
html[data-theme='light'] .programming-post li,
html[data-theme='light'] .programming-post .post-subtitle,
html[data-theme='light'] .programming-post .cheatsheet-info h3 {
    color: hsl(210, 20%, 25%);
}

html[data-theme='light'] .programming-post .project-item {
    background-color: hsl(230, 20%, 97%);
    border-color: hsl(230, 15%, 90%);
}

/* --- Handwritten Notes Post (Paper Theme) --- */
body.notes-post {
    background-color: #077698; /* Light paper-like background */
    background-image: url('assets/paper-texture.png'); /* A subtle paper texture image */
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}
/* Center the resource cards in the notes post */
body.notes-post .resource-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    justify-items: center; /* This centers the cards horizontally */
    align-items: start;
    justify-content: center; /* Ensures grid is centered */
}
    /* Responsive: 3 columns on large tablets */
    @media screen and (max-width: 1200px) {
        body.notes-post .resource-container {
            grid-template-columns: repeat(3, 1fr);
            gap: 1.5rem;
        }
    }

    /* Responsive: 2 columns on tablets */
    @media screen and (max-width: 900px) {
        body.notes-post .resource-container {
            grid-template-columns: repeat(2, 1fr);
            gap: 1rem;
            max-width: 98vw;
            padding: 0 0.5rem;
        }
        body.notes-post .resource-card {
            min-width: 0;
            max-width: 100%;
        }
        body.notes-post .resource-thumbnail {
            height: 140px;
        }
    }

    /* Responsive: 1 column on mobile */
    @media screen and (max-width: 600px) {
        body.notes-post .resource-container {
            grid-template-columns: 1fr;
            gap: 0.7rem;
            max-width: 99vw;
            padding: 0 0.2rem;
        }
        body.notes-post .resource-card {
            min-width: 0;
            max-width: 100%;
            width: 100%;
            border-radius: 0.5rem;
            padding: 0.7rem;
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            align-items: stretch;
            height: 100%;
        }
        body.notes-post .resource-thumbnail {
            height: 100px;
        }
        body.notes-post .resource-info {
            padding: 0.7rem;
        }
    }

/* Always center the resource cards inside the grid */
body.notes-post .resource-card {
    min-width: 250px;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    padding: 1rem;
    border-radius: 0.75rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
}

/* On this page, force all text to be dark */
.notes-post .post-header__back-link,
.notes-post h1, .notes-post h2, .notes-post h3,
.notes-post p, .notes-post li, .notes-post span {
    color: #fcf5f5;
}
.notes-post a {
    color: #0056b3;
}
.notes-post .post-title-header {
    border-bottom-color: #d8d8d8;
}

/* Use a script font for the category tag */
.notes-post .post-category {
    font-family: 'Dancing Script', cursive;
    font-size: 1.5rem;
    background-color: #333;
    color: #fff;
    padding: 0.5rem 1rem;
}

/* Style the cards to look like index cards */
.notes-post .resource-card a {
    background-color: #ffffff;
    border: 1px solid #ddd;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s, border-color 0.3s;
    /* Make all cards same border radius and padding */
    border-radius: 0.75rem;
    padding: 0;
    display: block;
    height: 100%;
}

/* Card glow effect on hover */
.notes-post .resource-card a:hover {
    box-shadow: 0 0 25px 5px #a97fff, 0 2px 20px rgba(63,13,125,0.15);
    border-color: #a97fff;
}

/* Make all thumbnails same size and style */
.notes-post .resource-thumbnail {
    background-color: #f8f8f8;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem 0.5rem 0 0;
    overflow: hidden;
}
.notes-post .resource-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
}

/* Make info section consistent */
.notes-post .resource-info {
    padding: 1rem;
    text-align: center;
}
.notes-post .resource-info span {
    font-style: normal;
}

/* --- Cybersecurity Books & Tools Post (Futuristic Grid Theme) --- */
body.cyber-resources-post {
    background-color: #0d0d1a; /* Very dark purple */
    background-image: 
        linear-gradient(rgba(13, 13, 26, 0.95), rgba(13, 13, 26, 0.95)),
        url('assets/cyber-grid-bg.jpg'); /* Your futuristic background image */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* Align post titles and h2 perfectly center and shape */
.cyber-resources-post .post-title-header {
    text-align: center;
    padding: 3rem 0 2rem 0;
    border-bottom: 2px solid hsl(280, 100%, 75%);
    margin-bottom: 2.5rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.cyber-resources-post .post-title-header h1 {
    font-size: 2.8rem;
    color: hsl(280, 100%, 85%);
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.cyber-resources-post .post-title-header h2 {
    font-size: 1.7rem;
    color: hsl(280, 100%, 75%);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    border-bottom: none;
    text-align: center;
}

.cyber-resources-post .post-content h2 {
    font-size: 1.7rem;
    color: hsl(280, 100%, 75%);
    margin-top: 2.5rem;
    margin-bottom: 1.2rem;
    font-weight: 600;
    border-bottom: 1px solid hsl(280, 100%, 75%);
    text-align: center;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* Make <p> one line (no wrap, ellipsis if too long) */
.cyber-resources-post .post-content p {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* This creates the 4-column layout for this page ONLY */
.cyber-resources-post .resource-container {
    grid-template-columns: repeat(4, 1fr);
    gap: 3rem;
    max-width: 1400px;
    margin: 0 auto;
    justify-content: center; /* Center the grid items horizontally */
}

/* Center single resource card when only one is present */
.cyber-resources-post .resource-container:only-child,
.cyber-resources-post .resource-container:has(.resource-card:only-child) {
    justify-items: center;
}

/* Center resource cards in all cases */
.cyber-resources-post .resource-container {
    justify-items: center;
}

.cyber-resources-post .resource-card {
    min-width: 250px;
}

/* Responsive: 3 columns on medium screens */
@media screen and (max-width: 1200px) {
    .cyber-resources-post .resource-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Responsive: 2 columns on tablets */
@media screen and (max-width: 900px) {
    .cyber-resources-post .resource-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Responsive: 1 column on mobile */
@media screen and (max-width: 600px) {
    .cyber-resources-post .resource-container {
        grid-template-columns: 1fr;
    }
    .cyber-resources-post .resource-card {
        min-width: 0;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        border-radius: 0.7rem;
        padding: 1rem;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        height: 100%;
        margin-left: 0;
        margin-right: 0;
    }
}

.cyber-resources-post .resource-card a {
    background-color: hsla(240, 20%, 15%, 0.6);
    border: 1px solid hsla(280, 100%, 80%, 0.2);
    backdrop-filter: blur(5px);
}

.cyber-resources-post .resource-card a:hover {
    border-color: hsl(280, 100%, 80%);
    box-shadow: 0 0 20px hsla(280, 100%, 80%, 0.15);
}

.cyber-resources-post .resource-thumbnail {
    background-color: hsla(240, 20%, 10%, 0.5);
}

.cyber-resources-post .resource-info h3 {
    color: hsl(280, 100%, 85%); /* Vibrant Lavender color for titles */
}

.cyber-resources-post .post-category {
    background-color: hsl(280, 100%, 75%);
}
/* ==================== AI TOOLS EXPLAINED POST (Futuristic Dark Theme) ==================== */

/* --- New Futuristic Dark Background --- */
body.ai-tools-post {
    background-color: #0f0f18; /* A deep, dark blue */
    background-image: 
        linear-gradient(135deg, rgba(66, 17, 128, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 100% 100%, 20px 20px;
}

/* --- FIX for all text visibility on this page --- */
.ai-tools-post .post-header__back-link,
.ai-tools-post .post-title-header h1,
.ai-tools-post .post-subtitle,
.ai-tools-post .post-content h2,
.ai-tools-post .project-item p,
.ai-tools-post .project-item h4,
.ai-tools-post .tools-table th,
.ai-tools-post .tools-table td {
    color: hsl(230, 8%, 85%); /* A bright, easy-to-read off-white */
}

/* --- New Floating Glass Card Design --- */
.ai-tools-post .project-item {
    background-color: hsla(240, 20%, 15%, 0.5); /* Semi-transparent dark background */
    backdrop-filter: blur(10px); /* Glassy effect */
    border: 1px solid hsla(270, 70%, 75%, 0.2); /* Faint purple border */
    border-top: 3px solid hsl(310, 80%, 70%); /* Bright magenta top border */
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.3s, transform 0.3s;
}

.ai-tools-post .project-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px hsla(310, 80%, 50%, 0.2); /* Magenta glow on hover */
}

/* --- New Color Palette --- */
.ai-tools-post .project-item h3 {
    color: hsl(310, 80%, 75%); /* Bright magenta for titles */
}

.ai-tools-post .post-category {
    background-color: hsl(310, 80%, 65%);
    color: #fff;
}

.ai-tools-post .tools-table th, 
.ai-tools-post .tools-table td {
    border-bottom-color: hsla(240, 20%, 25%, 0.5); /* Subtle table lines */
}

/* --- FIX for Bangla Font on this page --- */
.ai-tools-post .project-item p,
.ai-tools-post .project-item li {
    font-family: 'Hind Siliguri', 'Poppins', sans-serif;
    font-weight: 500;
}

/* --- AI Prompts Post Background (Futuristic Purple Theme) --- */
body.ai-post {
    background-color: #1a1a2e;
    /* Dark purple-blue fallback */
    background-image:
        linear-gradient(rgba(26, 26, 46, 0.94), rgba(26, 26, 46, 0.98)),
        url('assets/ai-bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.ai-post .project-item {
    border-left: none;
    border-top: 4px solid hsl(270, 80%, 70%);
    /* Bright purple top border */
    background-color: hsla(240, 30%, 20%, 0.5);
    backdrop-filter: blur(8px);
}

.ai-post .project-item:hover {
    box-shadow: 0 8px 30px hsla(270, 80%, 50%, 0.15);
}

.ai-post .project-item h3 {
    color: hsl(270, 80%, 80%);
    /* Bright purple title */
}

.ai-post .post-category {
    background-color: hsl(270, 80%, 70%);
}

.ai-post pre {
    background-color: hsla(240, 30%, 15%, 0.8);
    padding: 1rem;
    border-radius: 0.5rem;
    white-space: pre-wrap;
    font-family: 'Courier New', Courier, monospace;
    border: 1px solid hsl(240, 30%, 25%);
}


/* --- Port Forwarding Post Background (Networking Theme) --- */
body.networking-post {
    background-color: #1a1a2e;
    /* Dark blue-purple fallback */
    background-image:
        linear-gradient(rgba(26, 26, 46, 0.92), rgba(26, 26, 46, 0.96)),
        url('assets/networking-bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.networking-post .project-item h3 {
    color: hsl(190, 80%, 70%);
    /* A bright cyan color for titles */
}

.networking-post .project-item {
    border-left-color: hsl(190, 80%, 65%);
    /* A matching cyan for the border */
    background-color: hsla(230, 29%, 16%, 0.7);
    backdrop-filter: blur(4px);
}

.networking-post .post-category {
    background-color: hsl(190, 80%, 65%);
}

/* ==================== HEADER CONTROLS & SEARCH BAR ==================== */
.header-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-search {
    position: relative;
}

.header-search .fa-search {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-color);
    opacity: 0.7;
}

.resource-search {
    border: 1px solid var(--input-color);
    background-color: var(--container-color);
    border-radius: 25px;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    color: var(--title-color);
    font-family: var(--body-font);
    width: 200px;
    transition: width 0.3s, background-color 0.3s, border-color 0.3s;
}

.resource-search:focus {
    width: 250px;
    outline: none;
    border-color: var(--primary-color);
}

.dynamic-search-container {
    position: relative;
    max-width: 600px;
    margin: 2.5rem auto 0;
}

.dynamic-search-container .search-icon {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-color);
}

.dynamic-search-container .resource-search {
    width: 100%;
    font-size: 1rem;
    padding: 1rem 1.5rem 1rem 3.5rem;
}

/* ==================== CYBERSECURITY POST UNIQUE STYLES (FIX) ==================== */

/* --- This brings back your unique background --- */
body.cybersecurity-post {
    background-image: linear-gradient(rgba(18, 24, 38, 0.9), rgba(18, 24, 38, 0.9)), url('assets/cybersecurity-bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* --- FORCE DARK THEME on cards and ALL text for this page --- */
.cybersecurity-post .project-item {
    background-color: hsl(230, 29%, 16%);
    /* Dark card background */
    border-color: hsl(230, 29%, 25%);
}

/* This makes the titles inside the cards purple */
.cybersecurity-post .project-item h3 {
    color: hsl(270, 70%, 75%);
}

/* UPDATED: This now includes ALL other text on the page */
.cybersecurity-post .post-title-header h1,
.cybersecurity-post .post-subtitle,
.cybersecurity-post .post-content h2,
.cybersecurity-post .project-item p,
.cybersecurity-post .project-item h4,
.cybersecurity-post .tools-table th,
.cybersecurity-post .tools-table td,
.cybersecurity-post .skills-summary {
    color: hsl(230, 8%, 75%);
    /* Light text color */
}

.cybersecurity-post .tools-table th,
.cybersecurity-post .tools-table td {
    border-bottom-color: hsl(230, 29%, 25%);
}

.cybersecurity-post .skills-list li,
.cybersecurity-post p.skills-summary {
    background-color: hsl(230, 29%, 22%);
    /* Dark pill background */
}


/* --- This fixes the size of your two summary images --- */
.post-images-container {
    display: flex;
    gap: 2rem;
    margin: 0 auto 3rem;
    max-width: 800px;
    justify-content: center;
}

.post-images-container img {
    width: 80%;
    max-width: 485px;
    border-radius: 1rem;
    box-shadow: 0 8px 24px hsla(var(--hue-color), 28%, 8%, 0.2);
}

/* --- This makes the images stack correctly on mobile --- */
@media screen and (max-width: 768px) {
    .post-images-container {
        flex-direction: column;
        align-items: center;
        /* Center them when stacked */
    }
}

/* ==================== CHEATSHEET & RESOURCE CARDS ==================== */
.cheatsheet-container,
.resource-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.cheatsheet-card a,
.resource-card a {
    display: block;
    background-color: var(--container-color);
    border-radius: 0.75rem;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--input-color);
    height: 100%;
}

.cheatsheet-card a:hover,
.resource-card a:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.cheatsheet-thumbnail,
.resource-thumbnail {
    height: 150px;
    overflow: hidden;
    background-color: var(--input-color);
}

.cheatsheet-thumbnail img,
.resource-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.resource-thumbnail {
    height: 200px;
}

.resource-thumbnail img {
    object-fit: contain;
    padding: 1rem;
}

.cheatsheet-card a:hover .cheatsheet-thumbnail img,
.resource-card a:hover .resource-thumbnail img {
    transform: scale(1.05);
}

.cheatsheet-info,
.resource-info {
    padding: 1rem;
}

.cheatsheet-info h3,
.resource-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    color: var(--title-color);
}

.cheatsheet-info p,
.resource-info span {
    font-size: 0.9rem;
    color: var(--text-color);
}

.cheatsheet-info span {
    font-size: 0.8rem;
    font-weight: 600;
}

.resource-info {
    text-align: center;
}

.resource-info span {
    font-style: italic;
}

/* ==================== FLOATING ACTION BUTTON (FAB) ==================== */
.fab-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.fab-button {
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px hsla(var(--hue-color), 69%, 61%, 0.4);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.fab-button i {
    font-size: 1.5rem;
    color: #FFF;
    transition: transform 0.3s ease;
}

.fab-button.open i {
    transform: rotate(90deg);
}

.fab-menu {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 250px;
    background-color: var(--container-color);
    border-radius: 1rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.fab-menu.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.fab-link {
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}

.fab-link:hover {
    background-color: var(--input-color);
    color: var(--title-color);
}

.fab-controls {
    border-top: 1px solid var(--input-color);
    margin-top: 0.5rem;
    padding-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fab-controls .resource-search {
    width: 150px;
    padding: 0.5rem 1rem 0.5rem 2.2rem;
}

.fab-controls .resource-search:focus {
    width: 150px;
}

/* ==================== RATs POST UNIQUE STYLES ==================== */

/* --- New Orange Circuit Board Background --- */
body.rats-post {
    /* This now links to the image you downloaded */
    background-image:
        linear-gradient(rgba(20, 20, 35, 0.9), rgba(20, 20, 35, 0.92)),
        url('assets/circuit-bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* Make the titles and borders on this page a matching orange */
.rats-post .project-item h3 {
    color: hsl(35, 100%, 70%);
    /* Bright orange for titles */
}

.rats-post .project-item {
    border-left-color: hsl(35, 100%, 60%);
    /* A matching orange for the border */
}

/* ==================== MALWARE ANALYSIS POST UNIQUE STYLES ==================== */

/* --- New Abstract Blue Wave Background --- */
body.malware-post {
    background-color: #0c1427;
    /* Dark blue fallback */
    /* Link to a high-quality abstract blue wave image */
    background-image:
        linear-gradient(rgba(12, 20, 39, 0.9), rgba(12, 20, 39, 0.95)),
        url('assets/abstract-blue-wave-bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* --- New Card Style with Top Border --- */
.malware-post .project-item {
    border-left: none;
    /* Remove the old left border */
    border-top: 4px solid var(--primary-color);
    /* Add a new top border */
    background-color: hsla(230, 29%, 16%, 0.8);
    /* Semi-transparent dark blue */
    backdrop-filter: blur(5px);
    /* Adds a glassy effect */
}

/* Make the titles on this page the primary blue to match */
.malware-post .project-item h3 {
    color: var(--primary-color);
}

/* ==================== MEDIA QUERIES ==================== */
@media screen and (max-width: 768px) {

    .cheatsheet-container,
    .resource-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 480px) {

    .cheatsheet-container,
    .resource-container {
        grid-template-columns: 1fr;
    }
}

/* ==================== CODE TAG STYLES ==================== */
code {
    background-color: hsla(var(--hue-color), 15%, 85%, 0.15);
    color: var(--primary-color);
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', Courier, monospace;
    font-weight: 600;
}