:root {
    /* Color Palette */
    --primary-color: #2563EB;
    /* Royal Blue */
    --secondary-color: #1E40AF;
    /* Darker Blue for hover */
    --background-color: #FFFFFF;
    --text-main: #111827;
    /* Gray 900 */
    --text-muted: #6B7280;
    /* Gray 500 */
    --border-color: #E5E7EB;
    /* Gray 200 */
    --card-bg: #F9FAFB;
    /* Gray 50 */

    /* Spacing & Layout */
    --container-width: 1200px;
    --header-height: 70px;
    --section-spacing: 4rem;

    /* Typography */
    --font-base: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
    font-family: var(--font-base);
    background-color: var(--background-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    /* Pill shape */
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    font-size: 0.95rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-1px);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--text-main);
    background-color: var(--card-bg);
}

/* Navigation */
header {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-circle {
    width: 32px;
    height: 32px;
    background-color: var(--primary-color);
    border-radius: 50%;
    /* Placeholder for actual logo image */
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-main);
}

.nav-link-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--text-muted);
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.nav-link-btn:hover {
    color: var(--primary-color);
}

/* Responsive Navigation */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        /* Hidden by default on mobile */
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background-color: white;
        flex-direction: column;
        padding: 1rem;
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }

    .nav-links.active {
        display: flex;
    }

    .mobile-menu-btn {
        display: block;
    }
}

/* Hero Section */
.hero-section {
    padding: 6rem 0;
    width: 100%;
    overflow: hidden;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-title {
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 90%;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

/* Slider Styles */
.hero-slider {
    position: relative;
    width: 100%;
    height: 300px;
    background: var(--card-bg);
    /* Fallback */
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.slider-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #EFF6FF 0%, #FFFFFF 100%);
    pointer-events: none;
    /* Let clicks pass through inactive slides if stacked, though opacity handles visibility */
}

.slide.active {
    opacity: 1;
    z-index: 10;
    pointer-events: auto;
}

.slide-content {
    padding: 2rem;
    text-align: center;
}

.tag {
    display: inline-block;
    background: #DBEAFE;
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.slide h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.slide-link {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    font-size: 1rem;
}

.slide-link:hover {
    text-decoration: underline;
}

.slider-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 20;
}

.slider-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.slider-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* Newsletter Section */
.newsletter-section {
    padding: 4rem 0;
    background-color: var(--card-bg);
}

.newsletter-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
}

.newsletter-box h2 {
    font-size: 1.75rem;
    font-weight: 700;
}

.newsletter-form {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    max-width: 500px;
}

.newsletter-form input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    outline: none;
    font-family: var(--font-base);
}

.newsletter-form input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-color);
}

/* Responsive Hero */
@media (max-width: 968px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-description {
        margin: 0 auto 2.5rem;
    }

    .hero-buttons {
        justify-content: center;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-form button {
        width: 100%;
    }
}

/* About Section */
.about-section {
    background-color: white;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-intro {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    line-height: 1.8;
    text-align: center;
}

.about-intro strong {
    color: var(--text-main);
    font-weight: 600;
}

.about-sub-section {
    margin-bottom: 3rem;
}

.about-sub-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    display: inline-block;
}

/* Skills Table */
.skills-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

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

.skills-table th {
    background-color: var(--card-bg);
    color: var(--text-main);
    font-weight: 600;
    width: 30%;
}

.skills-table td {
    color: var(--text-muted);
}

.skills-table tr:last-child td,
.skills-table tr:last-child th {
    border-bottom: none;
}

/* Experience / Education Items */
.timeline-item {
    margin-bottom: 2rem;
    padding-left: 1.5rem;
    border-left: 3px solid var(--primary-color);
}

.timeline-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.timeline-subtitle {
    font-size: 1rem;
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.timeline-date {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 0.5rem;
    display: block;
}

.timeline-desc {
    color: var(--text-muted);
}

/* Section General */
.section {
    padding: 5rem 0;
}

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

.section-header.text-center {
    text-align: center;
}

.section-title {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
}

.view-all-link {
    float: right;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    margin-top: 10px;
}

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

.project-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 3rem 2rem;
    border-radius: 20px;
    text-decoration: none;
    color: white;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
}

.card-ml {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
}

.card-ds {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

.card-llm {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.project-card:hover .card-icon {
    opacity: 0;
}

.project-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.project-card p {
    font-size: 1rem;
    opacity: 0.9;
}

/* Blog / Articles */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.blog-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.blog-image {
    height: 200px;
    background-color: #E5E7EB;
    position: relative;
    overflow: hidden;
}

.placeholder-img {
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease;
}

.blog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.blog-overlay i {
    color: white;
    font-size: 2rem;
    transform: scale(0) rotate(-45deg);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.blog-card:hover .placeholder-img {
    transform: scale(1.1);
}

.blog-card:hover .blog-overlay {
    opacity: 1;
}

.blog-card:hover .blog-overlay i {
    transform: scale(1) rotate(0deg);
}

.blog-content {
    padding: 1.5rem;
}

.blog-date {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: block;
}

.blog-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    transition: color 0.2s;
}

.blog-card:hover h3 {
    color: var(--primary-color);
}

.blog-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 2;
}

.read-more {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.2s;
    text-decoration: none;
}

.read-more::after {
    content: '\f061';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.8rem;
    transition: transform 0.2s;
}

.blog-card:hover .read-more {
    gap: 0.75rem;
}

.read-more:hover {
    text-decoration: underline;
}

/* Responsive Fixes */
@media (max-width: 768px) {
    .section-header {
        text-align: center;
    }

    .view-all-link {
        float: none;
        display: block;
        margin-top: 1rem;
    }
}

/* Community / Contact */
.community-section {
    background-color: var(--card-bg);
}

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

.social-icon {
    width: 60px;
    height: 60px;
    background-color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-main);
    text-decoration: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.social-icon:hover {
    transform: translateY(-5px);
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.15);
}

/* Footer */
.main-footer {
    padding: 3rem 0;
    border-top: 1px solid var(--border-color);
    background-color: white;
    position: relative;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.go-top-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    opacity: 0;
    visibility: hidden;
    z-index: 99;
}

.go-top-btn.visible {
    opacity: 1;
    visibility: visible;
}

/* ===========================
   Blog & Article Styles
   =========================== */

/* ===========================
   Articles & Blog Styles
   =========================== */

/* Articles Listing Page (Grid Layout) */
.articles-header {
    background-color: var(--background-color);
    padding: 4rem 0 2rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.articles-header h1 {
    font-size: 3rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-weight: 800;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    /* Adaptive columns */
    gap: 1.5rem;
    margin-top: 3rem;
}

.article-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    /* Context for stretched link */
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

/* Article Card Image/Placeholder */
.article-card-image {
    height: 160px;
    position: relative;
    overflow: hidden;
    background-color: #f3f4f6;
}

.placeholder-img {
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease;
}

.article-card:hover .placeholder-img {
    transform: scale(1.05);
}

.blog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.article-card:hover .blog-overlay {
    opacity: 1;
}

.blog-overlay i {
    color: white;
    font-size: 2rem;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.article-card:hover .blog-overlay i {
    transform: translateY(0);
}

.article-card-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.article-meta-small {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.article-card h3 {
    font-size: 1.15rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    font-weight: 700;
    color: var(--text-main);
}


.card-bg-red {
    background: linear-gradient(135deg, #EF4444, #B91C1C);
}

.article-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.article-meta-small {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.article-card h3 {
    font-size: 1.1rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.article-read-btn {
    margin-top: auto;
    display: inline-block;
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.article-read-btn:hover {
    color: var(--primary-dark);
}

/* Stretched Link to make whole card clickable */
.article-read-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Ensure other links are clickable */
.article-card a:not(.article-read-btn) {
    z-index: 2;
    position: relative;
}

/* Single Article Layout (Right Sidebar) */
.single-article-container {
    display: grid;
    grid-template-columns: 1fr 320px;
    /* Content | Sidebar */
    gap: 3rem;
    margin: 3rem auto;
    max-width: var(--container-width);
    padding: 0 1.5rem;
}

.article-main {
    min-width: 0;
    /* Prevent overflow */
}

/* clean typography for article body */
.article-body {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #2e3646;
    /* Prevent container expansion */
    max-width: 100%;
    overflow-x: hidden;
}

/* Fix for wide code blocks and outputs */
pre,
.wp-block-preformatted,
.wp-block-code {
    white-space: pre-wrap;
    word-wrap: break-word;
    max-width: 100%;
    overflow-x: auto;
    background: #f4f4f5;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

/* Ensure code tags inside pre don't double padding */
pre code {
    padding: 0;
    background: transparent;
    border: none;
}

/* Fix for images overflowing */
.article-body img,
.article-body figure,
.wp-block-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    /* Optional polish */
}

.article-body p {
    margin-bottom: 1.5rem;
}

.article-body h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-size: 1.8rem;
    color: #111827;
}

.article-body h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.4rem;
    color: #1f2937;
}

.article-body ul {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.article-body li {
    margin-bottom: 0.5rem;
}

/* Sidebar Styles */
.sidebar-area {
    position: relative;
}

.sticky-sidebar-content {
    position: sticky;
    top: 90px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar-widget {
    background: white;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
}

.popular-posts-list {
    list-style: none;
}

.popular-posts-list li {
    margin-bottom: 1rem;
}

.popular-posts-list a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
    display: block;
}

.popular-posts-list a:hover {
    color: var(--primary-color);
}

/* Ad Containers - Flexible */
.ad-unit {
    background-color: #f9fafb;
    border: 1px dashed #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 0.8rem;
    overflow: hidden;
    margin: 1rem 0;
    max-width: 100%;
    /* Ensure responsiveness */
}

.ad-leaderboard {
    width: 100%;
    height: auto;
    min-height: 90px;
    /* Flexible height */
    margin-bottom: 2rem;
}

.ad-sidebar-vertical {
    width: 100%;
    /* Adapts to sidebar width */
    height: auto;
    min-height: 600px;
}

.ad-in-content {
    width: 100%;
    height: auto;
    min-height: 250px;
    margin: 2.5rem 0;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .single-article-container {
        grid-template-columns: 1fr;
    }

    .sticky-sidebar-content {
        position: static;
    }

    .ad-sidebar-vertical {
        width: 100%;
        height: 250px;
    }
}

@media (max-width: 600px) {
    .articles-grid {
        grid-template-columns: 1fr;
    }
}

.go-top-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
}

/* =========================================
   SEARCH OVERLAY STYLES (Immersive Dark Mode)
   ========================================= */

.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(17, 24, 39, 0.98);
    /* Tailwind Gray-900 with opacity */
    backdrop-filter: blur(12px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: none;
    /* Changed from flex to none */
    justify-content: center;
    padding-top: 100px;
}

.search-overlay.active {
    display: flex;
    /* Activate flex here */
    opacity: 1;
    visibility: visible;
}

.search-container {
    width: 100%;
    max-width: 800px;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    height: 80vh;
    /* Contain results within view */
}

/* Close Button */
.search-close-btn {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    color: #9CA3AF;
    /* Gray 400 */
    font-size: 2.5rem;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.search-close-btn:hover {
    color: white;
}

/* Large Input Field */
#search-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid #374151;
    /* Gray 700 */
    color: white;
    font-size: 2.5rem;
    font-weight: 600;
    padding: 1rem 0;
    margin-bottom: 3rem;
    outline: none;
    transition: border-color 0.3s;
    font-family: var(--font-base);
}

#search-input:focus {
    border-color: var(--primary-color);
}

#search-input::placeholder {
    color: #4B5563;
    /* Gray 600 */
    font-weight: 500;
}

/* Results Container */
.search-results {
    overflow-y: auto;
    padding-bottom: 3rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    /* Custom Scrollbar for dark theme */
    scrollbar-width: thin;
    scrollbar-color: #4B5563 transparent;
}

.search-results::-webkit-scrollbar {
    width: 6px;
}

.search-results::-webkit-scrollbar-track {
    background: transparent;
}

.search-results::-webkit-scrollbar-thumb {
    background-color: #4B5563;
    border-radius: 20px;
}

/* Result Item Card */
.search-result-item {
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-result-link {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem;
    text-decoration: none;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: all 0.2s;
}

.search-result-link:hover {
    background-color: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Thumbnail/Icon */
.search-result-image {
    width: 100px;
    /* Thumbnail width */
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #1F2937;
}

.search-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background-color: rgba(37, 99, 235, 0.2);
    /* Primary color low opacity */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.search-result-icon i {
    color: #60A5FA;
    /* Lighter Blue */
    font-size: 1.5rem;
}

/* Content */
.search-result-content {
    flex: 1;
    min-width: 0;
    /* Fix flex text overflow */
}

.search-result-content h4 {
    color: #F3F4F6;
    /* Gray 100 */
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-content p {
    color: #9CA3AF;
    /* Gray 400 */
    font-size: 0.9rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    /* One line desc */
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

/* Meta Tags */
.search-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
}

.search-category {
    color: #60A5FA;
    /* Blue 400 */
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(37, 99, 235, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

.search-date {
    color: #6B7280;
    /* Gray 500 */
}

.no-results {
    text-align: center;
    color: #6B7280;
    font-size: 1.2rem;
    margin-top: 2rem;
}

/* Ensure Search Trigger is Visible and Styled */
.search-trigger-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-muted);
    padding: 0.5rem;
    margin-right: 1rem;
    transition: color 0.2s;
    display: flex;
    /* Ensure icon is centered */
}

.search-trigger-btn:hover {
    color: var(--primary-color);
}

/* Tech Stack Grid Cards */
.stack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.stack-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.stack-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.stack-label {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

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

.stack-tag {
    background-color: white;
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.stack-tag:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: #EFF6FF;
}

/* Flashing outline for Live Projects button */
.btn-flash {
    position: relative;
    overflow: hidden;
    animation: pulse-flash 2s infinite;
}

@keyframes pulse-flash {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
        border-color: var(--primary-color);
        background-color: rgba(37, 99, 235, 0.05);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}