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

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --background: #f8fafc;
    --card-background: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --tag-bg: #eff6ff;
    --tag-text: #2563eb;
    --tag-active-bg: #2563eb;
    --tag-active-text: #ffffff;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: url('bg/tech-abstract.jpg') center center / cover no-repeat fixed;
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem 1rem;
    position: relative;
    z-index: 1;
    margin-top: 0;
    display: flex;
}

.blog-section {
    flex: 1;
    min-width: 0;
}

header {
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    padding: 1rem 1rem;
    border-bottom: 2px solid rgba(0, 255, 255, 0.3);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 1400px;
    margin: 0 auto;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 2rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-bottom {
    display: none;
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 0.5rem;
    padding: 0.5rem;
    color: rgba(200, 255, 255, 0.9);
    cursor: pointer;
    transition: all 0.2s;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mobile-menu-btn:hover {
    background-color: rgba(0, 255, 255, 0.2);
    border-color: #00ffff;
    color: #00ffff;
}

.header-title-section {
    flex: 1;
    text-align: left;
}

header h1 {
    font-family: 'Courier New', Courier, 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 2rem;
    font-weight: 700;
    color: #00ffff;
    margin-bottom: 0rem;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.7), 0 2px 8px rgba(0, 0, 0, 0.8);
    letter-spacing: 1px;
    text-transform: lowercase;
}

.subtitle {
    font-family: 'Courier New', Courier, 'Monaco', 'Menlo', 'Consolas', monospace;
    color: rgba(200, 255, 255, 0.9);
    font-size: 1.2rem;
    text-shadow: 0 0 8px rgba(0, 255, 255, 1), 0 1px 4px rgba(0, 0, 0, 0.6);
    letter-spacing: 0px;
    font-weight: 400;
}

.controls {
    margin-bottom: 2rem;
}

.search-container {
    position: relative;
    min-width: 300px;
    max-width: 600px;
    width: 100%;
    flex-shrink: 0;
}

.mobile-search {
    display: none;
}

.search-input {
    width: 100%;
    padding: 0.6rem 0.6rem 0.6rem 2.5rem;
    font-size: 0.9rem;
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 0.5rem;
    background-color: rgba(0, 0, 0, 0.4);
    color: rgba(200, 255, 255, 0.9);
    font-family: 'Courier New', Courier, 'Monaco', 'Menlo', 'Consolas', monospace;
    transition: all 0.2s;
}

.search-input::placeholder {
    color: rgba(200, 255, 255, 0.5);
}

.search-input:focus {
    outline: none;
    border-color: #00ffff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
    background-color: rgba(0, 0, 0, 0.6);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(0, 255, 255, 0.6);
    pointer-events: none;
}


.results-info {
    margin-bottom: 1.2rem;
    font-family: 'Courier New', Courier, 'Monaco', 'Menlo', 'Consolas', monospace;
    font-weight: 600;
    color: #00ffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.7), 0 1px 2px rgba(0, 0, 0, 0.8);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
    grid-auto-flow: row;
    align-items: start;
}

.blog-card {
    background-color: var(--card-background);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    min-height: 0;
    width: 100%;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.blog-card-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    background-color: rgba(0, 0, 0, 0.3);
    object-position: center;
    display: block;
}

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

.blog-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
}

.blog-card-tag {
    padding: 0.25rem 0.75rem;
    background-color: var(--tag-bg);
    color: var(--tag-text);
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.no-results {
    text-align: left;
    padding: 0;
    margin-bottom: 1.2rem;
}

.no-results p {
    font-family: 'Courier New', Courier, 'Monaco', 'Menlo', 'Consolas', monospace;
    font-weight: 600;
    color: #00ffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.7), 0 1px 2px rgba(0, 0, 0, 0.8);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    margin: 0;
}

.pagination {
    width: 100%;
    position: sticky;
    bottom: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(0, 255, 255, 0.3);
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.3);
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    max-width: 1400px;
    margin: 0 auto;
}

.social-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: rgba(200, 255, 255, 0.9);
    transition: all 0.2s;
    border-radius: 0.4rem;
    border: 1px solid rgba(0, 255, 255, 0.3);
    background-color: rgba(0, 0, 0, 0.4);
}

.social-link:hover {
    color: #00ffff;
    border-color: #00ffff;
    background-color: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.3);
    transform: translateY(-1px);
}

.social-link svg {
    width: 18px;
    height: 18px;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex: 1;
    position: relative;
    z-index: 1;
}

.pagination-btn {
    padding: 0.4rem 0.8rem;
    background-color: rgba(255, 255, 255, 0.1);
    color: rgba(200, 255, 255, 0.9);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 0.4rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: 'Courier New', Courier, 'Monaco', 'Menlo', 'Consolas', monospace;
    transition: all 0.2s;
    min-width: 2.25rem;
    text-align: center;
    -webkit-tap-highlight-color: rgba(0, 255, 255, 0.3);
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    position: relative;
    z-index: 1;
}

.pagination-btn:hover:not(:disabled) {
    background-color: rgba(0, 255, 255, 0.2);
    color: #00ffff;
    border-color: #00ffff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
    transform: translateY(-1px);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn.active {
    background-color: rgba(0, 255, 255, 0.3);
    color: #00ffff;
    border-color: #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

.pagination-info {
    color: rgba(200, 255, 255, 0.9);
    font-size: 0.8rem;
    font-family: 'Courier New', Courier, 'Monaco', 'Menlo', 'Consolas', monospace;
    margin: 0 0.75rem;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.3);
}

.controls {
    margin-bottom: 2rem;
    max-width: 290px;
    padding: 0 10px;
}

.filter-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
}

.filter-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    display: flex;
}

.filter-label {
    font-family: 'Courier New', Courier, 'Monaco', 'Menlo', 'Consolas', monospace;
    font-weight: 600;
    color: #00ffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.7), 0 1px 2px rgba(0, 0, 0, 0.8);
    font-size: 0.9rem;
    max-width: 30%;
    line-height: 1.2;
}

.tag-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-filter {
    padding: 0.5rem 0.8rem;
    background-color: rgba(0, 0, 0, 0.8);
    color: rgba(200, 255, 255, 1);
    border: 1px solid rgba(0, 255, 255, 0.5);
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: 'Courier New', Courier, 'Monaco', 'Menlo', 'Consolas', monospace;
    transition: all 0.2s;
    letter-spacing: 0.5px;
    text-transform: lowercase;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.tag-filter:hover {
    background-color: rgba(0, 255, 255, 0.3);
    color: #00ffff;
    border-color: #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5), 0 2px 4px rgba(0, 0, 0, 0.5);
    transform: translateY(-1px);
}

.tag-filter.active {
    background-color: rgba(0, 255, 255, 0.4);
    color: #00ffff;
    border-color: #00ffff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.7), 0 2px 4px rgba(0, 0, 0, 0.5);
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

.clear-btn {
    padding: 0.5rem 1rem;
    background-color: rgba(0, 0, 0, 0.8);
    color: rgba(200, 255, 255, 1);
    border: 1px solid rgba(0, 255, 255, 0.5);
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Courier New', Courier, 'Monaco', 'Menlo', 'Consolas', monospace;
    transition: all 0.2s;
    letter-spacing: 0.5px;
    text-transform: lowercase;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    text-transform: capitalize;
}

.clear-btn:hover {
    background-color: rgba(0, 255, 255, 0.3);
    color: #00ffff;
    border-color: #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5), 0 2px 4px rgba(0, 0, 0, 0.5);
    transform: translateY(-1px);
}

/* Mobile Tags Drawer */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-tags-drawer {
    position: fixed;
    top: 0;
    left: -100%;
    width: 85%;
    max-width: 320px;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    z-index: 999;
    transition: left 0.3s ease;
    overflow-y: auto;
    border-right: 2px solid rgba(0, 255, 255, 0.3);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
}

.mobile-tags-drawer.active {
    left: 0;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1rem;
    border-bottom: 1px solid rgba(0, 255, 255, 0.3);
    position: sticky;
    top: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1;
}

.drawer-header h2 {
    font-family: 'Courier New', Courier, 'Monaco', 'Menlo', 'Consolas', monospace;
    color: #00ffff;
    font-size: 1.2rem;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.7);
    margin: 0;
}

.close-drawer-btn {
    background: transparent;
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 0.5rem;
    padding: 0.5rem;
    color: rgba(200, 255, 255, 0.9);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-drawer-btn:hover {
    background-color: rgba(0, 255, 255, 0.2);
    border-color: #00ffff;
    color: #00ffff;
}

.drawer-content {
    padding: 1rem;
}

.drawer-content .filter-container {
    max-width: 100%;
}

.drawer-content .tag-filters {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    padding-right: 0.5rem;
}

.drawer-content .tag-filters::-webkit-scrollbar {
    width: 6px;
}

.drawer-content .tag-filters::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.drawer-content .tag-filters::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 255, 0.5);
    border-radius: 3px;
}

.drawer-content .tag-filters::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 255, 0.7);
}

@media (max-width: 768px) {
    .container {
        padding: 0.5rem;
        display: block;
    }

    /* Hide sidebar on mobile */
    .controls {
        display: none;
    }

    /* Show blog section full width */
    .blog-section {
        width: 100%;
    }

    /* Mobile header */
    .header-content {
        gap: 0.5rem;
    }

    .header-top {
        flex-wrap: nowrap;
        gap: 0.75rem;
    }

    .header-left {
        flex: 1 1 auto;
        min-width: 0;
    }

    .header-title-section {
        flex: 1;
        min-width: 0;
    }

    .header-right {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
        flex-shrink: 0;
    }

    header h1 {
        font-size: 1.25rem;
        letter-spacing: 0.5px;
        line-height: 1.2;
    }
    
    header {
        padding: 0.75rem 0.5rem;
    }
    
    .subtitle {
        font-size: 0.75rem;
        letter-spacing: 0px;
        line-height: 1.3;
        margin-top: 0.25rem;
    }
    
    /* Search container - always visible at bottom on mobile */
    .header-bottom {
        display: block;
        width: 100%;
    }
    
    .mobile-search {
        display: block;
        width: 100%;
        max-width: 100%;
        min-width: auto;
    }
    
    .search-input {
        width: 100%;
        font-size: 0.9rem;
        padding: 0.5rem 0.5rem 0.5rem 2.25rem;
    }

    .blog-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 1rem;
    }

    /* Footer mobile optimization */
    .pagination {
        padding: 0.5rem 0.5rem;
        border-top-width: 1px;
    }

    .footer-content {
        flex-direction: column;
        gap: 0.5rem;
    }

    .social-links {
        justify-content: center;
        width: 100%;
        gap: 0.5rem;
    }

    .social-link {
        width: 32px;
        height: 32px;
    }

    .social-link svg {
        width: 16px;
        height: 16px;
    }

    .pagination-controls {
        justify-content: center;
        width: 100%;
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .pagination-btn {
        padding: 0.35rem 0.5rem;
        font-size: 0.8rem;
        min-width: 1.75rem;
        -webkit-tap-highlight-color: rgba(0, 255, 255, 0.3);
        touch-action: manipulation;
        min-height: 36px;
        position: relative;
        z-index: 2;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    
    .pagination-btn:active {
        transform: scale(0.95);
        -webkit-transform: scale(0.95) translateZ(0);
    }
    
    .pagination-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        pointer-events: none;
    }

    .pagination-info {
        margin: 0 0.25rem;
        font-size: 0.7rem;
    }

    /* Hide page numbers on very small screens, show only prev/next */
    /*@media (max-width: 480px) {
        .pagination-btn:not(.prev):not(.next):not(.active) {
            display: none;
        }

        .pagination-info {
            display: none;
        }
    }*/
}

@media (min-width: 768px) and (max-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filter-header {
        width: 100%;
    }

    .tag-filters {
        width: 100%;
    }

    .pagination {
        gap: 0.4rem;
        padding: 0.6rem 0.75rem;
    }

    .pagination-btn {
        padding: 0.4rem 0.7rem;
        font-size: 0.85rem;
        min-width: 2rem;
    }

    .pagination-info {
        margin: 0 0.5rem;
        font-size: 0.75rem;
    }
    
    .container {
        padding-bottom: 5rem;
    }

    .social-link {
        width: 34px;
        height: 34px;
    }

    .social-link svg {
        width: 17px;
        height: 17px;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 767px) {
    .container{
        display: block;
    }
    .controls{
        max-width: 100%;
    }
    /* .tag-filters{
        max-height: 120px;
        overflow-y: scroll;
    } */
    .filter-label{max-width: 100%;}
}
