﻿:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --primary-light: #e8f0fe;
    --accent: #00c9a7;
    --accent-dark: #00a88a;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-body: #f1f5f9;
    --text-dark: #0f172a;
    --text-light: #94a3b8;
    --text-white: #f8fafc;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    background: var(--bg-body);
    color: var(--text-dark);
    line-height: 1.6;
}

/* Header */
header {
    background: var(--bg-dark);
    color: var(--text-white);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-white);
}

.logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    color: #fff;
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

    .logo-text span {
        color: var(--accent);
    }

/* Search */
.search-container {
    flex: 0 1 420px;
    position: relative;
}

    .search-container input {
        width: 100%;
        padding: 10px 16px 10px 42px;
        border-radius: 8px;
        border: 1px solid rgba(255,255,255,0.15);
        background: rgba(255,255,255,0.08);
        color: #fff;
        font-size: 14px;
        outline: none;
        transition: all 0.2s;
    }

        .search-container input::placeholder {
            color: var(--text-light);
        }

        .search-container input:focus {
            background: rgba(255,255,255,0.14);
            border-color: var(--primary);
        }

    .search-container .search-icon {
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--text-light);
        font-size: 14px;
    }

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

    .nav-links a {
        color: var(--text-light);
        text-decoration: none;
        font-size: 14px;
        padding: 6px 14px;
        border-radius: 6px;
        transition: all 0.2s;
        font-weight: 500;
    }

        .nav-links a:hover {
            color: #fff;
            background: rgba(255,255,255,0.08);
        }

/* Mobile menu */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    padding: 8px;
}

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--bg-dark) 0%, #1e3a5f 50%, var(--bg-dark) 100%);
    color: #fff;
    text-align: center;
    padding: 60px 24px 50px;
    position: relative;
    overflow: hidden;
}

    .hero::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: radial-gradient(circle at 30% 50%, rgba(26,115,232,0.15), transparent 50%), radial-gradient(circle at 70% 50%, rgba(0,201,167,0.1), transparent 50%);
        pointer-events: none;
    }

    .hero h1 {
        font-size: 42px;
        font-weight: 800;
        letter-spacing: -1px;
        margin-bottom: 14px;
        position: relative;
    }

        .hero h1 span {
            color: var(--accent);
        }

    .hero p {
        font-size: 18px;
        color: #94a3b8;
        max-width: 600px;
        margin: 0 auto 30px;
        position: relative;
    }

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    position: relative;
}

.hero-stat {
    text-align: center;
}

    .hero-stat .num {
        font-size: 28px;
        font-weight: 800;
        color: var(--accent);
    }

    .hero-stat .label {
        font-size: 13px;
        color: #94a3b8;
        text-transform: uppercase;
        letter-spacing: 1px;
    }

/* Ad banner placeholder */
.ad-banner {
    max-width: 1280px;
    margin: 20px auto;
    padding: 0 24px;
}

.ad-placeholder {
    background: #e2e8f0;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

    .ad-placeholder.horizontal {
        height: 90px;
    }

    .ad-placeholder.sidebar {
        height: 250px;
        min-height: 250px;
    }

    .ad-placeholder.in-feed {
        height: 100px;
    }

/* Main Layout */
.main-layout {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    gap: 24px;
}

.content-area {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Category Filter */
.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.filter-btn {
    padding: 8px 18px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-dark);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

    .filter-btn:hover {
        border-color: var(--primary);
        color: var(--primary);
    }

    .filter-btn.active {
        background: var(--primary);
        color: #fff;
        border-color: var(--primary);
    }

/* Section */
.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

    .section-header .icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        color: #fff;
    }

    .section-header h2 {
        font-size: 20px;
        font-weight: 700;
    }

    .section-header .count {
        background: var(--primary-light);
        color: var(--primary);
        font-size: 12px;
        font-weight: 700;
        padding: 2px 10px;
        border-radius: 12px;
        margin-left: auto;
    }

.category-section {
    margin-bottom: 32px;
}

/* Tool Cards */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}

.tool-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.25s;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .tool-card:hover {
        transform: translateY(-3px);
        box-shadow: var(--shadow-lg);
        border-color: var(--primary);
    }

    .tool-card .tool-icon {
        width: 44px;
        height: 44px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
        margin-bottom: 4px;
    }

    .tool-card h3 {
        font-size: 15px;
        font-weight: 700;
    }

    .tool-card p {
        font-size: 13px;
        color: var(--text-light);
        line-height: 1.5;
    }

.tool-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-new {
    background: #dcfce7;
    color: #16a34a;
}

.badge-popular {
    background: #fef3c7;
    color: #d97706;
}

/* Color themes for categories */
.bg-security {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.bg-text {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.bg-converter {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.bg-network {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.bg-dev {
    background: linear-gradient(135deg, #10b981, #059669);
}

.bg-math {
    background: linear-gradient(135deg, #ec4899, #db2777);
}

.bg-image {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.bg-misc {
    background: linear-gradient(135deg, #64748b, #475569);
}

.icon-security {
    background: rgba(239,68,68,0.12);
    color: #ef4444;
}

.icon-text {
    background: rgba(139,92,246,0.12);
    color: #8b5cf6;
}

.icon-converter {
    background: rgba(245,158,11,0.12);
    color: #f59e0b;
}

.icon-network {
    background: rgba(6,182,212,0.12);
    color: #06b6d4;
}

.icon-dev {
    background: rgba(16,185,129,0.12);
    color: #10b981;
}

.icon-math {
    background: rgba(236,72,153,0.12);
    color: #ec4899;
}

.icon-image {
    background: rgba(99,102,241,0.12);
    color: #6366f1;
}

.icon-misc {
    background: rgba(100,116,139,0.12);
    color: #64748b;
}

/* Sidebar widgets */
.sidebar-widget {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

    .sidebar-widget h3 {
        font-size: 15px;
        font-weight: 700;
        margin-bottom: 14px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

.popular-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .popular-list li a {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 10px;
        border-radius: 8px;
        text-decoration: none;
        color: var(--text-dark);
        font-size: 14px;
        font-weight: 500;
        transition: all 0.15s;
    }

        .popular-list li a:hover {
            background: var(--primary-light);
            color: var(--primary);
        }

        .popular-list li a .rank {
            width: 24px;
            height: 24px;
            border-radius: 6px;
            background: var(--bg-body);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            font-weight: 700;
            color: var(--text-light);
            flex-shrink: 0;
        }

/* Footer */
footer {
    background: var(--bg-dark);
    color: var(--text-light);
    margin-top: 40px;
}

.footer-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 48px 24px 24px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
}

.footer-brand p {
    font-size: 14px;
    margin-top: 12px;
    line-height: 1.7;
}

.footer-col h4 {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.footer-col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .footer-col ul li a {
        color: var(--text-light);
        text-decoration: none;
        font-size: 14px;
        transition: color 0.2s;
    }

        .footer-col ul li a:hover {
            color: var(--accent);
        }

.footer-bottom {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px 24px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 28px;
    }

    .hero p {
        font-size: 15px;
    }

    .hero-stats {
        gap: 24px;
    }

    .hero-stat .num {
        font-size: 22px;
    }

    .search-container {
        display: none;
    }

    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .main-layout {
        padding: 16px;
    }

    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 10px;
    }

    .tool-card {
        padding: 14px;
    }

        .tool-card .tool-icon {
            width: 36px;
            height: 36px;
            font-size: 16px;
        }

        .tool-card h3 {
            font-size: 13px;
        }

        .tool-card p {
            display: none;
        }

    .footer-content {
        grid-template-columns: 1fr 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

/* Scroll to top */
.scroll-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 18px;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transition: all 0.2s;
    z-index: 999;
}

    .scroll-top:hover {
        background: var(--primary-dark);
        transform: translateY(-2px);
    }

    .scroll-top.visible {
        display: flex;
    }

/* Schema microdata styling (hidden) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

