/*
 Theme Name:   CodeReplica Child
 Theme URI:    http://codereplica.local/
 Description:  GeneratePress Child Theme
 Author:       Nitesh
 Author URI:   http://codereplica.local
 Template:     generatepress
 Version:      1.0.0
 Text Domain:  generatepress-child
*/

/* CSS Variables for Theme - Custom Tech Palette */
:root {
    /* Brand Colors */
    --primary-base: #0A1F44;   /* Deep Navy - Trust, Tech Professionalism */
    --accent-color: #00A8E8;   /* Vibrant Blue - Innovation, Clarity */
    --highlight-color: #FF8C42; /* Bright Orange - Energy, Call-to-Action */
    
    /* Neutral/Surface Colors */
    --bg-color: #F6F8FA;       /* Soft Off-white - Clean Backgrounds */
    --surface-color: #ffffff;
    --border-color: #e1e4e8;   /* Light Grey for borders */
    
    /* Text Colors */
    --text-primary: #0A1F44;   /* Deep Navy for primary text/headings */
    --text-secondary: #2E3440; /* Slate Gray - Text, UI Contrast */
    --text-muted: #586069;     /* Muted text */
    
    /* Shadows & Effects */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-md: 0 4px 6px rgba(10, 31, 68, 0.08); /* Tinted shadow */
    --shadow-lg: 0 10px 15px -3px rgba(10, 31, 68, 0.1), 0 4px 6px -2px rgba(10, 31, 68, 0.05);
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Typography */
    --font-heading: 'Inter', sans-serif;
    --font-body: 'Source Sans Pro', sans-serif;
    --font-mono: 'Fira Code', monospace;
    
    /* Dimensions */
    --container-width: 1280px;
    --header-height: 72px;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --bg-color: #050e1f;        /* Very dark navy */
    --surface-color: #0A1F44;   /* Primary Base becomes surface */
    --border-color: #1a365d;    /* Lighter navy for borders */
    
    --text-primary: #ffffff;
    --text-secondary: #e2e8f0;
    --text-muted: #94a3b8;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.5);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
    
     /* Adjust accent slightly for dark mode visibility if needed */
    --primary-base: #0A1F44; /* Keep base for consistency but surface uses it */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-secondary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s, color 0.3s;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-weight: 700;
}

code, pre {
    font-family: var(--font-mono);
}

/* --- Search Page Styles --- */

.search-hero {
    background: var(--surface-color);
    padding: 60px 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 40px;
}

.search-hero h1 {
    font-size: 36px;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.search-hero .big-search-box {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
}

.search-hero input {
    width: 100%;
    padding: 16px 24px;
    padding-right: 60px;
    font-size: 18px;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    outline: none;
    transition: var(--transition-fast);
    font-family: var(--font-body);
    background: var(--bg-color);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.search-hero input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(0, 168, 232, 0.1);
}

.search-hero .search-btn-large {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--accent-color);
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.search-hero .search-btn-large:hover {
    background: var(--highlight-color);
}

/* Search Results Layout */
.search-container {
    max-width: 1000px; /* Slightly narrower than full container for readability */
    margin: 0 auto;
    padding: 0 24px;
    min-height: 60vh;
}

.search-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1px;
    overflow-x: auto;
}

.search-tab {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: var(--transition-fast);
    font-family: var(--font-heading);
    white-space: nowrap;
}

.search-tab:hover {
    color: var(--text-primary);
}

.search-tab.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.results-stats {
    margin-bottom: 24px;
    color: var(--text-muted);
    font-size: 14px;
}

/* Reusing grid styles but maybe specific adjustments if needed */
.results-grid {
    display: grid;
    gap: 24px;
}

/* List view for mixed results if needed, or just use grid */
.search-result-row {
    display: flex;
    gap: 20px;
    padding: 24px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: var(--transition-fast);
    margin-bottom: 20px;
}

.search-result-row:hover {
    border-color: var(--accent-color);
    box-shadow: var(--shadow-md);
}

.result-icon {
    width: 60px;
    height: 60px;
    background: var(--bg-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-primary);
    flex-shrink: 0;
}

.result-content h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.result-content h3 a {
    color: var(--text-primary);
}

.result-content h3 a:hover {
    color: var(--accent-color);
}

.result-content p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
}

.result-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.result-tag {
    background: var(--bg-color);
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}


a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

ul {
    list-style: none;
    margin-left: 0;
}

/* Container */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.site-header {
    background-color: var(--primary-base); /* Deep Navy Header */
    color: white;
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo a {
    display: flex;
    align-items: center;
    transition: opacity 0.2s;
}

.logo a:hover {
    opacity: 0.9;
}

.main-nav ul {
    display: flex;
    gap: 32px;
    margin: 0;
}

.main-nav a {
    font-family: var(--font-heading);
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    font-size: 15px;
    padding: 24px 0;
    border-bottom: 3px solid transparent; 
    transition: all var(--transition-fast);
}

.main-nav a:hover,
.main-nav a.active {
    color: white;
    border-bottom-color: var(--accent-color); /* Vibrant Blue active state */
}

/* Header Actions & Theme Toggle */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.theme-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    font-size: 16px;
}

.theme-btn:hover {
    background: rgba(255,255,255,0.2);
    color: var(--highlight-color);
    transform: rotate(15deg);
}

.header-actions .search-bar {
    display: flex;
    background: rgba(255, 255, 255, 0.1); /* Semi-transparent on dark bg */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px; /* slightly more squared for tech feel */
    padding: 8px 16px;
    transition: var(--transition-fast);
}

.header-actions .search-bar:focus-within {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-color);
}

.search-bar input {
    background: transparent;
    border: none;
    color: white;
    outline: none;
    width: 220px;
    font-size: 14px;
    font-family: var(--font-body);
}

.search-bar input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-bar button {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.search-bar button:hover {
    color: var(--highlight-color);
}

/* Sub Header */
.sub-header {
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 0;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-heading);
    transition: background-color 0.3s;
}

.sub-header .container {
    display: flex;
    flex-wrap: wrap; 
    align-items: center;
    gap: 16px;
}

.sub-header span {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.sub-header span i {
    color: var(--highlight-color);
}

.sub-header a {
    color: var(--text-secondary);
    background: var(--bg-color); /* Adaptive bg */
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

[data-theme="dark"] .sub-header a {
    border-color: var(--border-color);
}

.sub-header a:hover {
    color: white;
    background: var(--accent-color);
    border-color: var(--accent-color);
}

/* Main Layout */
.main-layout {
    display: grid;
    /* Sidebar Left | Content | Sidebar Right */
    grid-template-columns: 240px 1fr 300px;
    gap: 30px;
    margin-top: 30px;
    margin-bottom: 60px;
}

/* Sidebar Styling */
.sidebar-widget {
    margin-bottom: 30px;
}

.sidebar-widget h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 16px;
    font-weight: 800;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
}

/* Mobile Category Filter Styles (New) */
.mobile-filter-btn {
    display: none; /* Hidden on Desktop */
    width: 100%;
    padding: 12px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0px;
    transition: background 0.2s;
}

.mobile-filter-btn:hover {
    background: var(--bg-color);
}

.mobile-filter-btn i.rotate {
    transform: rotate(180deg);
    transition: transform 0.3s;
}

.category-content-wrapper {
    display: block; /* Visible on Desktop */
}

/* End Mobile Filter Styles */

.category-list li {
    margin-bottom: 6px;
}

.category-list a {
    display: flex;
    align-items: center;
    font-size: 15px;
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: 6px;
    transition: var(--transition-fast);
    font-weight: 500;
}

.category-list a i {
    width: 24px;
    color: var(--text-muted); 
    transition: var(--transition-fast);
    font-size: 14px;
}

.category-list a:hover {
    background-color: var(--surface-color);
    color: var(--accent-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); 
    transform: translateX(4px);
}

[data-theme="dark"] .category-list a:hover {
    background-color: var(--bg-color); /* Slightly cleaner hover in dark mode */
}

.category-list a:hover i {
    color: var(--highlight-color);
}

/* Apps Promo Mini */
.app-mini-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px; 
    margin-bottom: 16px;
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.app-mini-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent-color);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.app-mini-card:hover {
    border-color: var(--border-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.app-mini-card:hover::before {
    opacity: 1;
}

.app-mini-card .app-icon {
    width: 44px;
    height: 44px;
    background: var(--bg-color);
    color: var(--primary-base);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

[data-theme="dark"] .app-mini-card .app-icon {
    background: rgba(255,255,255,0.05);
    color: var(--accent-color);
}

.app-mini-card .app-info h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.app-mini-card .app-info a {
    font-size: 12px;
    color: var(--accent-color);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.app-mini-card .app-info a:hover {
    color: var(--highlight-color);
}

/* Hero Section */
.hero-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 40px;
}

.hero-card {
    border-radius: 12px;
    padding: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.hero-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.hero-card.primary {
    /* Gradient using Deep Navy and Vibrant Blue */
    background: linear-gradient(135deg, var(--primary-base) 0%, #16325B 100%);
    color: white;
    border: 1px solid rgba(255,255,255,0.1);
}

.hero-card.secondary {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
}

.hero-content {
    z-index: 10;
    max-width: 70%;
}

.hero-image-placeholder {
    opacity: 0.1;
    transform: rotate(0deg) scale(1);
    position: absolute;
    right: 20px;
    bottom: 20px;
    color: inherit;
    transition: var(--transition-smooth);
}

.hero-card:hover .hero-image-placeholder {
    transform: scale(1.1);
    opacity: 0.15;
}

.badge {
    background: var(--highlight-color);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 16px;
    display: inline-block;
    letter-spacing: 0.05em;
}

.hero-card.secondary .badge {
    background: var(--bg-color);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.hero-card h2 {
    font-size: 26px;
    margin-bottom: 12px;
    line-height: 1.2;
    color: inherit;
}

.hero-card p {
    font-size: 16px;
    margin-bottom: 24px;
    opacity: 0.9;
    line-height: 1.5;
    font-weight: 400;
}

.hero-card.primary p {
    color: #cbd5e1;
}

.btn-primary, .btn-outline {
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition-fast);
    font-family: var(--font-heading);
}

/* Call to Action Button - Uses Highlight Color */
.btn-primary {
    background: var(--highlight-color);
    color: white;
    border: none;
    box-shadow: 0 4px 10px rgba(255, 140, 66, 0.3);
}

.btn-primary:hover {
    background: #ff7b29;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(255, 140, 66, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--primary-base);
    border: 2px solid var(--primary-base);
}

[data-theme="dark"] .btn-outline {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.btn-outline:hover {
    background: var(--primary-base);
    color: white;
    border-color: var(--primary-base);
}

[data-theme="dark"] .btn-outline:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
}


/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

.section-header h2 {
    font-size: 22px;
    color: var(--text-primary);
    position: relative;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -14px;
    left: 0;
    width: 40px;
    height: 4px;
    background: var(--accent-color);
    border-radius: 2px;
}

.view-all {
    font-size: 14px;
    color: var(--accent-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-fast);
}

.view-all:hover {
    color: var(--highlight-color);
    text-decoration: underline;
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 50px;
}

.tool-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px; /* Sharper */
    padding: 24px;
    transition: var(--transition-smooth);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    height: 100%;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-color);
}

.tool-icon {
    background: var(--bg-color);
    color: var(--text-primary);
    width: 54px;
    height: 54px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 24px;
    transition: var(--transition-fast);
}

.tool-card:hover .tool-icon {
    background: var(--accent-color);
    color: white;
}

.tool-details h3 {
    font-size: 17px;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 700;
}

.tool-details p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* News Feed */
.news-feed {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.news-item {
    display: flex;
    gap: 15px;
    background: var(--surface-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: var(--transition-smooth); 
}

/* Mobile responsive fix for news item handled below */

.news-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-color);
    transform: translateX(4px);
}

.news-image {
    width: 180px;
    background: var(--bg-color);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 28px;
}

.news-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.news-category {
    font-size: 11px;
    color: var(--highlight-color);
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-family: var(--font-heading);
}

.news-content h3 {
    font-size: 19px;
    margin: 0 0 10px;
    line-height: 1.4;
    font-weight: 700;
}

.news-content h3 a:hover {
    color: var(--accent-color);
}

.news-excerpt {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
}

.news-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: auto;
    font-family: var(--font-mono); /* Monospace date for tech feel */
}

/* Right Sidebar Items */
.trending-widget {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    box-shadow: none;
}

.trending-list {
    counter-reset: trend-counter;
}

.trending-list li {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    transition: transform var(--transition-fast);
}

.trending-list li:hover {
    transform: translateX(5px);
}

.trending-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.trending-list li .rank {
    counter-increment: trend-counter;
    content: counter(trend-counter, decimal-leading-zero);
    font-size: 32px;
    font-weight: 900;
    color: var(--border-color); /* Subtle rank */
    line-height: 1;
    font-family: var(--font-mono);
    min-width: 40px;
    text-align: center;
}

[data-theme="dark"] .trending-list li .rank {
    color: rgba(255,255,255,0.1);
}

.trending-list li:hover .rank {
    color: var(--accent-color);
}

.trending-list .info a {
    font-weight: 600;
    font-size: 15px;
    display: block;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.trending-list .info a:hover {
    color: var(--accent-color);
}

.trending-list .info .meta {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    background: var(--bg-color);
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.newsletter-widget {
    background: var(--primary-base); /* Deep Navy */
    color: white;
    border: none;
    border-radius: 8px;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

/* Abstract shape decoration on newsletter */
.newsletter-widget::after {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--accent-color);
    opacity: 0.1;
}

.newsletter-widget h3 {
    color: white;
    font-size: 18px;
    margin-bottom: 10px;
    font-weight: 800;
}

.newsletter-widget p {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    margin-bottom: 20px;
}

.newsletter-widget input {
    width: 100%;
    padding: 12px;
    margin: 0 0 12px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    color: white;
    font-family: var(--font-body);
}

.newsletter-widget button {
    width: 100%;
    padding: 12px;
    background: var(--highlight-color); /* Orange CTA */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 700;
    transition: var(--transition-fast);
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.newsletter-widget button:hover {
    background: #ff7b29;
    box-shadow: 0 4px 12px rgba(255, 140, 66, 0.3);
}

/* Footer */
.site-footer {
    background: var(--primary-base); /* Navy */
    color: #8b9bb4;
    padding: 60px 0 30px;
    margin-top: 60px;
    border-top: 4px solid var(--accent-color);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    color: white;
    margin-bottom: 24px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul li a {
    transition: var(--transition-fast);
    font-size: 14px;
}

.footer-col ul li a:hover {
    color: var(--highlight-color);
    padding-left: 5px;
}

.social-icons {
    display: flex;
    gap: 16px;
}

.social-icons a {
    color: #8b9bb4;
    font-size: 20px;
    transition: var(--transition-fast);
    background: rgba(255,255,255,0.05);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.social-icons a:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-3px);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
    margin-bottom: 40px;
}

.pagination button {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 600;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination button:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.pagination button.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.copyright {
    text-align: center;
    font-size: 13px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 30px;
    color: #5d6d88;
}

/* =========================================
   RESPONSIVE STYLES
   ========================================= */

/* Tablet & Smaller Laptops (Max Width: 1024px) */
@media (max-width: 1024px) {
    :root {
        --container-width: 100%;
    }
    
    .main-layout {
        grid-template-columns: 200px 1fr; 
    }

    .sidebar-right {
        display: none; 
    }
    
    .hero-section {
        grid-template-columns: 1fr; 
    }
    
    .hero-content {
        max-width: 100%;
    }
    
    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
}

/* Mobile Devices (Max Width: 768px) */
@media (max-width: 768px) {
    .site-header {
        height: auto;
        padding: 15px 0;
        position: relative;
    }

    .header-container {
        flex-direction: column; 
        gap: 15px;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between; /* Spread toggle and search */
    }
    
    .logo a svg {
        height: 32px; /* Smaller logo on mobile */
    }

    .main-nav {
        width: 100%;
        overflow-x: auto; 
        padding-bottom: 5px;
    }

    .main-nav ul {
        gap: 20px;
    }

    .main-nav a {
        padding: 10px 0;
        white-space: nowrap;
        font-size: 14px;
    }

    .search-bar {
        width: 100%;
        flex: 1; /* Take remaining space */
    }
    
    .search-bar input {
        width: 100%;
    }

    /* Stack main layout */
    .main-layout {
        display: flex;
        flex-direction: column;
        gap: 20px;
        margin-top: 20px;
    }

    /* ---------------------------------
       MOBILE CATEGORY ACCORDION LOGIC
    --------------------------------- */
    
    .sidebar-left {
        order: -1; /* Move Categories to TOP */
        width: 100%;
        position: static !important; /* Remove sticky on mobile */
    }

    .content-center {
        order: 1;
    }
    
    /* Reveal Filter Button */
    .mobile-filter-btn {
        display: flex;
    }

    /* Collapse Content by Default */
    .category-content-wrapper {
        display: none; 
        margin-top: 10px;
        background: var(--surface-color);
        padding: 15px;
        border-radius: 8px;
        border: 1px solid var(--border-color);
        box-shadow: var(--shadow-sm);
    }
    
    .category-content-wrapper.show {
        display: block; /* Show when toggled */
        animation: slideDown 0.3s ease-out;
    }
    
    .category-content-wrapper h3 {
        display: none; /* Hide duplicate header */
    }
    
    /* --------------------------------- */
    
    .tools-grid {
        grid-template-columns: 1fr; 
    }

    .news-item {
        flex-direction: column;
    }

    .news-image {
        width: 100%;
        height: 180px;
    }
    
    .hero-card {
        padding: 24px;
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    
    .hero-content {
        max-width: 100%;
    }
    
    .hero-image-placeholder {
        position: relative;
        right: auto;
        bottom: auto;
        margin-top: 20px;
        align-self: center;
        opacity: 0.2;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    
    .social-icons {
        justify-content: center;
    }
    
    .footer-col ul li a:hover {
        padding-left: 0; 
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1024px) {
    :root {
        --container-width: 100%;
    }
    
    .main-layout {
        grid-template-columns: 200px 1fr; 
    }

    .sidebar-right {
        display: none; 
    }
    
    .hero-section {
        grid-template-columns: 1fr; 
    }
    
    .hero-content {
        max-width: 100%;
    }
    
    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
}

/* Mobile Devices (Max Width: 768px) */
@media (max-width: 768px) {
    .site-header {
        height: auto;
        padding: 15px 0;
        position: relative;
    }

    .header-container {
        flex-direction: column; 
        gap: 15px;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between; /* Spread toggle and search */
    }
    
    .logo a svg {
        height: 32px; /* Smaller logo on mobile */
    }

    .main-nav {
        width: 100%;
        overflow-x: auto; 
        padding-bottom: 5px;
    }

    .main-nav ul {
        gap: 20px;
    }

    .main-nav a {
        padding: 10px 0;
        white-space: nowrap;
        font-size: 14px;
    }

    .search-bar {
        width: 100%;
        flex: 1; /* Take remaining space */
    }
    
    .search-bar input {
        width: 100%;
    }

    /* Stack main layout */
    .main-layout {
        display: flex;
        flex-direction: column;
        gap: 20px;
        margin-top: 20px;
    }

    /* ---------------------------------
       MOBILE CATEGORY ACCORDION LOGIC
    --------------------------------- */
    
    .sidebar-left {
        order: -1; /* Move Categories to TOP */
        width: 100%;
        position: static !important; /* Remove sticky on mobile */
    }

    .content-center {
        order: 1;
    }
    
    /* Reveal Filter Button */
    .mobile-filter-btn {
        display: flex;
    }

    /* Collapse Content by Default */
    .category-content-wrapper {
        display: none; 
        margin-top: 10px;
        background: var(--surface-color);
        padding: 15px;
        border-radius: 8px;
        border: 1px solid var(--border-color);
        box-shadow: var(--shadow-sm);
    }
    
    .category-content-wrapper.show {
        display: block; /* Show when toggled */
        animation: slideDown 0.3s ease-out;
    }
    
    .category-content-wrapper h3 {
        display: none; /* Hide duplicate header */
    }
    
    /* --------------------------------- */
    
    .tools-grid {
        grid-template-columns: 1fr; 
    }

    .news-item {
        flex-direction: column;
    }

    .news-image {
        width: 100%;
        height: 180px;
    }
    
    .hero-card {
        padding: 24px;
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    
    .hero-content {
        max-width: 100%;
    }
    
    .hero-image-placeholder {
        position: relative;
        right: auto;
        bottom: auto;
        margin-top: 20px;
        align-self: center;
        opacity: 0.2;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    
    .social-icons {
        justify-content: center;
    }
    
    .footer-col ul li a:hover {
        padding-left: 0; 
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Header Updates & Search Bar --- */
.site-header {
    position: relative;
    z-index: 999;
}

.site-header .search-bar {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 300px;
    height: 40px; /* Reduced height to match redesign */
}

.site-header .search-bar input {
    height: 100%;
    width: 100%;
    padding: 8px 16px;
    padding-right: 40px;
    background-color: transparent !important; /* Not stark white */
    color: #ffffff !important;
    font-size: 14px;
    outline: none;
    transition: var(--transition-fast);
}

.site-header .search-bar input::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
}

.site-header .search-bar input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(0, 168, 232, 0.1);
    background-color: rgba(0, 0, 0, 0.2) !important;
}

.site-header .search-bar button {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8) !important;
    cursor: pointer;
    font-size: 14px;
    transition: color 0.2s;
}

.site-header .search-bar button:hover {
    color: #ffffff !important;
}

/* --- Mobile Menu (1024px break) --- */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: #ffffff; /* Header is dark */
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    margin-left: 12px;
}

.no-list-style{
    list-style: none !important;
}

@media (max-width: 1024px) {
    .site-header {
        position: relative;
        z-index: 9999 !important;
    }

    .site-header .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--surface-color) !important;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-md);
        padding: 20px 0;
        z-index: 99999 !important;
    }

    .site-header.mobile-open .main-nav {
        display: block !important;
    }

    .site-header .main-nav ul {
        flex-direction: column;
        align-items: flex-start;
        padding: 0 24px;
        list-style: none; /* Just in case */
        margin: 0;
    }
    
    .site-header .main-nav ul li {
        width: 100%;
        margin-bottom: 0;
        display: block;
    }
    
    .site-header .main-nav ul li a {
        color: var(--text-primary) !important;
        font-size: 16px !important;
        font-weight: 600;
        display: block !important;
        padding: 8px 0;
        text-decoration: none;
        opacity: 1 !important;
        visibility: visible !important;
        border-bottom: 1px solid #ddd;
    }
    
    .site-header .main-nav ul li a:hover {
        color: var(--accent-color) !important;
    }
.site-header .main-nav a.active {
    border-bottom-color: var(--accent-color);
}
    .mobile-menu-toggle {
        display: block !important;
        color: #ffffff !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .site-header .header-actions {
        gap: 8px; /* Compact gap */
    }
}
