:root {
    /* Modern tech color palette - Light Mode */
    --primary-color: #2563eb;        /* Clean blue */
    --primary-dark: #1e40af;
    --secondary-color: #10b981;      /* Tech green */
    --accent-color: #8b5cf6;         /* Purple accent */
    --text-dark: #0f172a;            /* Slate dark */
    --text-medium: #475569;          /* Slate medium */
    --text-light: #64748b;           /* Slate light */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;         /* Very light slate */
    --bg-dark: #1e293b;              /* Dark slate */
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Dark Mode Theme */
[data-theme="dark"] {
    --primary-color: #3b82f6;        /* Brighter blue for dark */
    --primary-dark: #2563eb;
    --secondary-color: #10b981;      /* Tech green stays */
    --accent-color: #a78bfa;         /* Lighter purple */
    --text-dark: #f1f5f9;            /* Light text */
    --text-medium: #cbd5e1;          /* Medium light */
    --text-light: #94a3b8;           /* Light gray */
    --bg-primary: #0f172a;           /* Dark background */
    --bg-secondary: #1e293b;         /* Slightly lighter dark */
    --bg-dark: #334155;              /* Card backgrounds */
    --border-color: #334155;
    --success-color: #10b981;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Navigation */
.site-header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .site-header {
    background-color: rgba(15, 23, 42, 0.95);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    gap: 1.5rem;
}

.logo img {
    height: 50px;
    width: auto;
    transition: transform 0.2s ease;
}

.logo:hover img {
    transform: scale(1.05);
}

/* Search Bar */
.search-container {
    flex: 1;
    max-width: 500px;
    position: relative;
    margin: 0 1rem;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 2rem;
    padding: 0.625rem 1.25rem;
    transition: all 0.2s ease;
}

.search-box:focus-within {
    border-color: var(--primary-color);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-icon {
    color: var(--text-light);
    flex-shrink: 0;
    margin-right: 0.75rem;
}

#search-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.95rem;
    color: var(--text-dark);
    font-family: inherit;
}

#search-input::placeholder {
    color: var(--text-light);
}

.clear-search {
    background: transparent;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    margin-left: 0.5rem;
}

.clear-search:hover {
    background: var(--border-color);
    color: var(--text-dark);
}

/* Search Results Dropdown */
.search-results {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
}

@media (max-width: 768px) {
    .search-results {
        max-height: 300px;
        font-size: 0.9rem;
    }
}

.search-result-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s ease;
    text-decoration: none;
    display: block;
    color: inherit;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--bg-secondary);
}

.search-result-category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.375rem;
}

.search-result-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.search-result-excerpt {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.4;
}

.search-result-highlight {
    background: rgba(37, 99, 235, 0.15);
    color: var(--primary-color);
    font-weight: 600;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
}

.search-no-results {
    padding: 2rem;
    text-align: center;
    color: var(--text-light);
}

.search-no-results svg {
    width: 48px;
    height: 48px;
    color: var(--border-color);
    margin-bottom: 1rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: var(--text-medium);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    position: relative;
    padding: 0.5rem 0;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text-dark);
    transition: all 0.3s;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    color: var(--bg-primary);
    padding: 120px 0 100px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(37, 99, 235, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.hero-content .highlight {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    opacity: 0.9;
    color: #cbd5e1;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary::after {
    content: '→';
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.btn-primary:hover::after {
    transform: translateX(4px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Blog Section */
.blog-section {
    padding: 100px 0;
    background-color: var(--bg-secondary);
}

.blog-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 3rem;
    align-items: start;
}

.blog-main {
    min-width: 0;
}

.active-filter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--bg-primary);
    border-radius: 0.75rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.active-filter span {
    color: var(--text-medium);
    font-size: 0.95rem;
}

.active-filter strong {
    color: var(--primary-color);
    font-weight: 600;
}

#clear-filter {
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 0.375rem 1rem;
    border-radius: 0.375rem;
    color: var(--text-medium);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

#clear-filter:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.75rem;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.section-header p {
    font-size: 1.125rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.blog-card {
    background-color: var(--bg-primary);
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.blog-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background-color: var(--border-color);
}

.blog-category {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: var(--primary-color);
    padding: 0.375rem 0.875rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.blog-content {
    padding: 1.5rem;
}

.blog-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 500;
}

.blog-meta span::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    background: var(--text-light);
    border-radius: 50%;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.blog-meta span:first-child::before {
    display: none;
}

.blog-content h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
}

.blog-content h3 a {
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.2s ease;
    display: inline-block;
}

.blog-content h3 a:hover {
    color: var(--primary-color);
}

.blog-content p {
    color: var(--text-light);
    margin-bottom: 15px;
    line-height: 1.7;
}

.read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.read-more::after {
    content: '→';
    transition: transform 0.2s ease;
}

.read-more:hover {
    color: var(--primary-dark);
    gap: 0.75rem;
}

.read-more:hover::after {
    transform: translateX(4px);
}

/* Technology Sidebar */
.tech-sidebar {
    position: sticky;
    top: 100px;
    background: var(--bg-primary);
    border-radius: 1rem;
    padding: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.tech-sidebar h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.sidebar-subtitle {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    display: block;
}

.tech-filters {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.tech-filter {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.tech-filter:hover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.03);
    transform: translateX(-4px);
}

.tech-filter.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(139, 92, 246, 0.05));
    box-shadow: var(--shadow-sm);
}

.tech-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.tech-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.tech-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.tech-count {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 500;
}

.sidebar-stats {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 0.625rem;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Blog card filtering */
.blog-card.hidden {
    display: none;
}

/* About Section */
.about-section {
    padding: 100px 0;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.about-content p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

/* Contact Section */
.contact-section {
    padding: 100px 0;
    background: linear-gradient(135deg, var(--bg-dark) 0%, #334155 100%);
    color: var(--bg-primary);
    text-align: center;
    position: relative;
}

.contact-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 50%, rgba(37, 99, 235, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 70% 50%, rgba(16, 185, 129, 0.15) 0%, transparent 50%);
}

.contact-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.contact-section p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Footer */
.site-footer {
    background-color: #0f172a;
    color: #cbd5e1;
    padding: 80px 0 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: white;
}

.footer-section p {
    opacity: 0.8;
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section ul li a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-wrapper {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .logo {
        order: 1;
    }

    .mobile-menu-toggle {
        order: 2;
    }

    .search-container {
        order: 3;
        width: 100%;
        max-width: 100%;
        margin: 0;
        flex-basis: 100%;
    }

    .nav-menu {
        display: none;
        order: 4;
        width: 100%;
    }

    .nav-menu.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: var(--shadow-lg);
        padding: 1rem;
        gap: 0.5rem;
    }

    .nav-menu a {
        padding: 0.75rem;
        border-radius: 0.5rem;
    }

    .nav-menu a:hover {
        background: var(--bg-secondary);
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }

    .blog-layout {
        grid-template-columns: 1fr;
    }

    .tech-sidebar {
        position: static;
        order: -1;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .section-header h2 {
        font-size: 2rem;
    }
}

@media (max-width: 1024px) {
    .blog-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .tech-sidebar {
        position: static;
    }
    
    .tech-filters {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

@media (max-width: 640px) {
    .nav-wrapper {
        padding: 0.75rem 0;
    }

    .logo img {
        height: 40px;
    }

    .search-box {
        padding: 0.5rem 1rem;
    }

    #search-input {
        font-size: 0.875rem;
    }

    .tech-filters {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 80px 0 60px;
    }

    .hero-content h1 {
        font-size: 1.75rem;
    }

    .section-header h2 {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 60px 0;
    }

    .blog-section,
    .about-section,
    .contact-section {
        padding: 50px 0;
    }
}

/* Dark Mode Toggle Button */
.theme-toggle {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-dark);
    flex-shrink: 0;
}

.theme-toggle:hover {
    transform: scale(1.1);
    border-color: var(--primary-color);
    background: var(--bg-secondary);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.theme-toggle:hover svg {
    transform: rotate(20deg);
}

/* Hide sun icon in light mode, moon icon in dark mode */
.theme-toggle .sun-icon {
    display: none;
}

.theme-toggle .moon-icon {
    display: block;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: block;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: none;
}
