/*
Theme Name: SamKarTechtechnology_2026_03_02

Theme URI: https://samkartech.com
Author: SamKar Tech
Author URI: https://samkartech.com
Description: A modern tech theme for showcasing projects with source code, tutorials, and hardware projects. Perfect for developers and tech educators.
Version: 1.0.0
License: MIT
License URI: https://opensource.org/licenses/MIT
Text Domain: samkartech
Tags: projects, source-code, tutorials, hardware, plc, arduino, dark-theme, responsive, two-columns, custom-menu
*/

/* --- CSS VARIABLES --- */
:root {
    --bg-primary: #0a0c10;
    --bg-secondary: #111316;
    --card-bg: #1a1d24;
    --text-primary: #e5e9f0;
    --text-secondary: #9aa4b8;
    --accent-primary: #3b82f6;
    --accent-secondary: #8b5cf6;
    --accent-hardware: #10b981;
    --accent-plc: #f59e0b;
    --border-color: #2a2f3a;
    --nav-height: 75px;
    --gradient-1: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --gradient-2: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
}

/* --- NAVIGATION --- */
header {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--nav-height);
    background: rgba(10, 12, 16, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    line-height: 1;
}

.logo img {
    height: 35px;
    width: auto;
    display: block;
}

.nav-links {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-links li {
    margin: 0 0 0 30px;
}

.nav-links a {
    color: #ffffff !important;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    display: flex;
    align-items: center;
    height: var(--nav-height);
    font-size: 1rem;
}

.nav-links a:hover {
    color: var(--accent-primary) !important;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-1);
    transition: width 0.3s;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Hamburger menu styles */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    z-index: 1001;
    padding: 5px;
}

.hamburger .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 3px 0;
    background: var(--gradient-1);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger.active .bar:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger.active .bar:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* Mobile styles */
@media (max-width: 768px) {
    .hamburger {
        display: flex !important;
    }
    
    .nav-links {
        position: fixed;
        left: -100%;
        top: var(--nav-height);
        width: 100%;
        height: calc(100vh - var(--nav-height));
        background: var(--bg-primary);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: left 0.3s ease;
        z-index: 1000;
        margin: 0;
        padding: 0;
    }
    
    .nav-links.active {
        left: 0;
    }
    
    .nav-links li {
        margin: 20px 0;
    }
    
    .nav-links a {
        color: #ffffff !important;
        font-size: 1.2rem;
        height: auto;
        line-height: normal;
    }
    
    .nav-links a::after {
        bottom: -5px;
    }
}

/* --- HERO SECTION (Homepage) --- */
.hero {
    padding-top: calc(var(--nav-height) + 50px);
    padding-bottom: 80px;
    background: radial-gradient(circle at 70% 30%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.hero-text h1 {
    font-size: 3.8rem;
    line-height: 1.2;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-text .highlight {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-stats {
    display: flex;
    gap: 30px;
    margin: 40px 0;
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-primary);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.hero-image {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.hero-image img {
    border-radius: 12px;
    width: 100%;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* --- ADVERTISEMENT STYLES - FIXED --- */

/* Main ad container - remove padding so content fills the border */

/* Main ad container - NO PADDING */
.ad-container {
    background: var(--card-bg);
    border: 2px dashed var(--accent-primary);
    border-radius: 12px;
    margin: 30px 0;
    position: relative;
    overflow: hidden;
    min-height: 90px;
    width: 100%;
    padding: 0; /* CRITICAL - removes inner spacing */
    display: block;
}

/* Advertisement label */
.ad-container::before {
    content: 'Advertisement';
    position: absolute;
    top: 5px;
    left: 10px;
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.7;
    z-index: 10;
    pointer-events: none;
}

/* Ad content - fills container completely */
.ad-leaderboard {
    width: 100%;
    height: 100%;
    min-height: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent; /* Remove gradient */
    margin: 0;
    padding: 0;
}

/* AdSense ins element - fills completely */
.ad-leaderboard ins.adsbygoogle {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 90px;
    background: transparent;
}

/* Grid ads styling */
.ad-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.ad-grid-item {
    min-height: 250px;
    border: 2px dashed var(--accent-primary);
    border-radius: 12px;
    background: var(--card-bg);
    position: relative;
    overflow: hidden;
    padding: 0; /* No padding */
}

.ad-grid-item::before {
    content: 'Advertisement';
    position: absolute;
    top: 5px;
    left: 10px;
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.7;
    z-index: 10;
    pointer-events: none;
}

/* Grid item inner content */
.ad-grid-item .ad-content {
    width: 100%;
    height: 100%;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    padding: 0;
    margin: 0;
}

/* AdSense in grid items */
.ad-grid-item ins.adsbygoogle {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 250px;
    background: transparent;
}

/* Placeholder (only shows if no ad) */
.ad-placeholder {
    width: 100%;
    height: 100%;
    min-height: inherit;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

/* Remove all conflicting styles */
.ad-label {
    display: none;
}

.ad-rectangle,
.ad-sidebar,
.ad-inline {
    background: transparent;
    padding: 0;
    margin: 0;
}

/* Remove all the conflicting styles from your previous CSS */
.ad-rectangle,
.ad-sidebar,
.ad-inline {
    /* Reset these completely */
    background: transparent;
    padding: 0;
    margin: 0;
}

/* Keep only what's necessary */
.ad-rectangle ins.adsbygoogle,
.ad-sidebar ins.adsbygoogle,
.ad-inline ins.adsbygoogle {
    display: block;
    width: 100%;
    height: 100%;
    min-height: inherit;
    background: transparent;
}
/* --- CATEGORY TABS (Homepage) --- */
.category-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0 20px;
    flex-wrap: wrap;
}

.category-tab {
    padding: 12px 28px;
    border-radius: 40px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-tab i {
    font-size: 1.2rem;
}

.category-tab:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.category-tab.active {
    background: var(--gradient-1);
    border-color: transparent;
    color: white;
}

.active-filter {
    text-align: center;
    margin: 20px 0;
    font-size: 1.2rem;
    color: var(--accent-primary);
}

.active-filter span {
    background: var(--card-bg);
    padding: 8px 20px;
    border-radius: 30px;
    border: 1px solid var(--accent-primary);
}

/* --- PROJECTS GRID (Homepage) --- */
.projects-section {
    padding: 40px 0 60px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h2 {
    font-size: 2.2rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    transition: opacity 0.3s ease;
}

.projects-grid.loading {
    opacity: 0.5;
    pointer-events: none;
}

.project-card {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
}

.project-image {
    height: 180px;
    background: var(--bg-secondary);
    position: relative;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-category {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 12px;
    background: var(--gradient-1);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.project-category.hardware { background: var(--accent-hardware); }
.project-category.plc { background: var(--accent-plc); }
.project-category.desktop { background: var(--accent-secondary); }
.project-category.academic { background: #ec4899; }
.project-category.source { background: #8b5cf6; }

.project-content {
    padding: 20px;
}

.project-title {
    font-size: 1.1rem;
    margin-bottom: 8px;
    line-height: 1.4;
}

.project-title a {
    color: var(--text-primary);
    text-decoration: none;
}

.project-title a:hover {
    color: var(--accent-primary);
}

.project-description {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-meta {
    display: flex;
    gap: 15px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 15px;
}

.project-meta i {
    margin-right: 5px;
    color: var(--accent-primary);
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.tech-tag {
    padding: 3px 10px;
    background: var(--bg-secondary);
    border-radius: 20px;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.project-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
    font-size: 0.85rem;
}

.project-link {
    color: var(--accent-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
}

.project-link i {
    transition: var(--transition);
}

.project-link:hover i {
    transform: translateX(5px);
}

.project-source {
    color: var(--text-secondary);
}

.project-source i {
    margin-right: 5px;
    color: var(--accent-secondary);
}

.no-projects {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px;
    color: var(--text-secondary);
    background: var(--card-bg);
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

/* --- TUTORIALS SECTION --- */
.tutorials-section {
    padding: 60px 0;
    background: var(--bg-secondary);
}

.tutorials-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.tutorial-card {
    display: flex;
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.tutorial-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-hardware);
}

.tutorial-icon {
    width: 80px;
    background: var(--gradient-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
}

.tutorial-content {
    padding: 20px;
    flex: 1;
}

.tutorial-title {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.tutorial-meta {
    display: flex;
    gap: 15px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.tutorial-link {
    color: var(--accent-hardware);
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
}

/* --- HARDWARE SECTION --- */
.hardware-section {
    padding: 60px 0;
}

.hardware-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.hardware-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 25px 20px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.hardware-card:hover {
    border-color: var(--accent-hardware);
    transform: translateY(-5px);
}

.hardware-icon {
    font-size: 2.2rem;
    color: var(--accent-hardware);
    margin-bottom: 15px;
}

.hardware-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.hardware-card p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 15px;
}

.hardware-tag {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-hardware);
    border-radius: 20px;
    font-size: 0.75rem;
}

/* --- NEWSLETTER --- */
.newsletter {
    padding: 50px 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.newsletter h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.newsletter-form {
    display: flex;
    max-width: 450px;
    margin: 25px auto 0;
    gap: 10px;
}

.newsletter-input {
    flex: 1;
    padding: 12px 20px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.newsletter-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* --- FOOTER --- */
footer {
    padding: 50px 0 30px;
    background: var(--bg-secondary);
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

.footer-about p {
    color: var(--text-secondary);
    margin: 15px 0;
    font-size: 0.9rem;
}

.footer-links h4 {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links ul li {
    margin: 8px 0;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: var(--transition);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--accent-primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 25px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* --- BUTTONS --- */
.btn {
    display: inline-block;
    padding: 10px 22px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    background: var(--gradient-1);
    color: white;
    text-decoration: none;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.1);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* --- CATEGORY PAGE SPECIFIC STYLES --- */

/* Category Header */
.category-header {
    padding-top: calc(var(--nav-height) + 40px);
    padding-bottom: 30px;
    text-align: center;
    background: radial-gradient(circle at 70% 30%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
}

.category-title {
    font-size: 3rem;
    margin-bottom: 15px;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.category-description {
    color: var(--text-secondary);
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto;
}

.category-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 30px;
}

.category-stat {
    text-align: center;
}

.category-stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-primary);
}

.category-stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb a:hover {
    color: var(--accent-primary);
}

.breadcrumb i {
    font-size: 0.8rem;
    color: var(--accent-primary);
}

/* Subcategory Tabs */
.subcategory-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.subcategory-tab {
    padding: 8px 20px;
    border-radius: 30px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-size: 0.9rem;
}

.subcategory-tab:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.subcategory-tab.active {
    background: var(--gradient-1);
    border-color: transparent;
    color: white;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0;
    flex-wrap: wrap;
    gap: 15px;
}

.results-count {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.results-count span {
    color: var(--accent-primary);
    font-weight: 600;
}

.sort-options {
    display: flex;
    gap: 10px;
    align-items: center;
}

.sort-select {
    padding: 8px 15px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
}

.sort-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.view-options {
    display: flex;
    gap: 10px;
}

.view-btn {
    padding: 8px 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.view-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.view-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* Category Projects Section */
.category-projects-section {
    padding: 20px 0 60px;
}

/* Category page - 3 posts per row */
.category-projects-section .projects-grid {
    grid-template-columns: repeat(3, 1fr) !important;
}

/* Category page responsive */
@media (max-width: 1200px) {
    .category-projects-section .projects-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .category-projects-section .projects-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Content with Sidebar Layout */
.content-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
}

/* Sidebar Widgets */
.sidebar {
    position: relative;
}

.sidebar-widget {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.sidebar-widget h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.category-list {
    list-style: none;
}

.category-list li {
    margin: 12px 0;
}

.category-list a {
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    transition: var(--transition);
}

.category-list a:hover {
    color: var(--accent-primary);
}

.category-list .count {
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
}

.popular-post {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

.popular-post img {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    object-fit: cover;
}

.popular-post-info h4 {
    font-size: 0.95rem;
    margin-bottom: 5px;
}

.popular-post-info h4 a {
    color: var(--text-primary);
    text-decoration: none;
}

.popular-post-info h4 a:hover {
    color: var(--accent-primary);
}

.popular-post-info p {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    padding: 4px 12px;
    background: var(--bg-secondary);
    border-radius: 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    transition: var(--transition);
}

.tag:hover {
    background: var(--accent-primary);
    color: white;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 50px 0 20px;
}

.page-item {
    list-style: none;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

.page-link:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.page-link.active {
    background: var(--gradient-1);
    color: white;
    border-color: transparent;
}

.page-link.next-prev {
    width: auto;
    padding: 0 15px;
}

/* --- RESPONSIVE BREAKPOINTS --- */
@media (max-width: 1200px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .hardware-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ad-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 968px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
    
    .ad-leaderboard {
        min-height: 70px;
    }
    
    .content-with-sidebar {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        order: 2;
        margin-top: 40px;
    }
}

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .tutorials-grid {
        grid-template-columns: 1fr;
    }
    
    .hardware-grid {
        grid-template-columns: 1fr;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .ad-container {
        margin: 20px 0;
    }
    
    .ad-leaderboard {
        min-height: 60px;
    }
    
    .ad-rectangle,
    .ad-sidebar {
        max-width: 100%;
    }
    
    .category-tab {
        width: 100%;
        justify-content: center;
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .category-title {
        font-size: 2.2rem;
    }
}

@media (max-width: 480px) {
    .hero-text h1 {
        font-size: 2.2rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .hero-buttons .btn {
        width: 100%;
        margin: 5px 0 !important;
    }
    
    .project-image {
        height: 160px;
    }
    
    .ad-container {
        padding: 10px;
    }
    
    .tutorial-icon {
        width: 60px;
        font-size: 1.5rem;
    }
    /* Standard Ad Sizes with Responsive Design */
.ad-leaderboard-container {
    min-height: 90px;
}

.ad-inline-container {
    min-height: 250px;
}

.ad-sidebar-container {
    min-height: 250px;
}

/* Responsive Ad Handling */
@media (min-width: 992px) {
    .ad-sidebar {
        min-height: 600px; /* Allows for 300x600 half page ad */
    }
    
    .sticky-sidebar-ad {
        display: block;
        position: sticky;
        top: calc(var(--nav-height) + 20px);
        margin: 20px 0;
        width: 300px;
        float: right;
    }
}

@media (max-width: 991px) {
    .ad-sidebar {
        min-height: 250px; /* Falls back to 300x250 on tablet/mobile */
    }
    
    .sticky-sidebar-ad {
        display: none;
    }
}

@media (max-width: 768px) {
    .ad-leaderboard {
        min-height: 50px; /* For 320x50 mobile leaderboard */
    }
    
    .ad-inline-container {
        min-height: 100px; /* For 320x100 large mobile banner */
    }
    
    .ad-grid {
        grid-template-columns: 1fr; /* Stack ads on mobile */
    }
    
    .ad-grid-item {
        min-height: 250px;
        margin-bottom: 20px;
    }
}

/* AdSense Placeholder Styling */
.adsense-placeholder {
    background: var(--card-bg);
    border: 2px dashed var(--accent-primary);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.ad-placeholder {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}


}