﻿/* ============================================================
                   ROOT VARIABLES
                   ============================================================ */
:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --primary-light: #eef2ff;
    --secondary: #06d6a0;
    --secondary-dark: #05b888;
    --accent: #f59e0b;
    --accent-dark: #d97706;
    --danger: #ef4444;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --radius: 16px;
    --radius-lg: 24px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --nav-height: 72px;
}

/* ============================================================
                   DARK MODE
                   ============================================================ */
[data-theme="dark"] {
    --gray-50: #0f172a;
    --gray-100: #1e293b;
    --gray-200: #334155;
    --gray-300: #475569;
    --gray-400: #64748b;
    --gray-500: #94a3b8;
    --gray-600: #cbd5e1;
    --gray-700: #e2e8f0;
    --gray-800: #f1f5f9;
    --gray-900: #f8fafc;
    --primary-light: #1e293b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* ============================================================
                   RESET & BASE
                   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: clip;
}

body {
    font-family: 'Tajawal', sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    min-height: 100vh;
    padding-top: var(--nav-height);
    transition: background 0.3s, color 0.3s;
    line-height: 1.7;
    overflow-x: clip;
    max-width: 100vw;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ============================================================
                   NAVIGATION
                   ============================================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    transition: background 0.3s, border-color 0.3s;
}

[data-theme="dark"] .navbar {
    background: rgba(15, 23, 42, 0.9);
    border-bottom-color: rgba(255, 255, 255, 0.04);
}

.navbar .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--gray-900);
    text-decoration: none;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.site-logo-img {
    width: var(--logo-size, 40px);
    height: var(--logo-size, 40px);
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow:
        0 0 0 1px rgba(59, 130, 246, 0.18),
        0 10px 24px rgba(59, 130, 246, 0.22);
}

.site-logo-text {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: inherit;
    font-weight: inherit;
    line-height: 1.1;
}

.navbar .logo .logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.3rem;
}

.navbar .logo span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar .nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar .nav-links a {
    padding: 8px 18px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gray-600);
    transition: var(--transition);
    position: relative;
}

.navbar .nav-links a:hover,
.navbar .nav-links a.active {
    background: var(--primary-light);
    color: var(--primary);
}

.navbar .nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.navbar .search-box {
    display: flex;
    align-items: center;
    background: var(--gray-100);
    border-radius: 40px;
    padding: 6px 18px;
    gap: 10px;
    transition: var(--transition);
    border: 2px solid transparent;
}

.navbar .search-box:focus-within {
    border-color: var(--primary);
    background: #fff;
}

[data-theme="dark"] .navbar .search-box:focus-within {
    background: var(--gray-800);
}

.navbar .search-box input {
    background: transparent;
    border: none;
    outline: none;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.9rem;
    padding: 6px 0;
    width: 160px;
    color: var(--gray-800);
}

.navbar .search-box input::placeholder {
    color: var(--gray-400);
}

.navbar .search-box i {
    color: var(--gray-400);
    font-size: 0.9rem;
}

.theme-toggle-btn {
    background: var(--gray-100);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--gray-600);
    cursor: pointer;
    transition: var(--transition);
}

.theme-toggle-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
    transform: rotate(20deg);
}

/* ============================================================
                   HERO SECTION
                   ============================================================ */
.hero {
    text-align: center;
    padding: 60px 20px 50px;
    margin: 20px 30px 40px;
    background: linear-gradient(145deg, #ffffff, var(--gray-50));
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
    transition: background 0.3s, border-color 0.3s;
}

[data-theme="dark"] .hero {
    background: linear-gradient(145deg, var(--gray-900), var(--gray-800));
    border-color: rgba(255, 255, 255, 0.03);
}

.hero::before {
    content: '';
    position: absolute;
    top: -60%;
    right: -30%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(67, 97, 238, 0.04) 0%, transparent 70%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(6, 214, 160, 0.03) 0%, transparent 70%);
    pointer-events: none;
}

.hero .badge-top {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    padding: 4px 20px;
    border-radius: 40px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3.8rem;
    font-weight: 900;
    color: var(--gray-900);
    position: relative;
    z-index: 1;
    letter-spacing: -1px;
}

.hero h1 .highlight {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero .sub {
    font-size: 1.2rem;
    color: var(--gray-500);
    margin-top: 12px;
    position: relative;
    z-index: 1;
    font-weight: 400;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero .badge-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
    position: relative;
    z-index: 1;
}

.hero .badge-group .badge {
    padding: 8px 24px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.85rem;
    background: var(--gray-100);
    color: var(--gray-600);
    transition: var(--transition);
}

.hero .badge-group .badge:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.hero .badge-group .badge.primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
}

/* ============================================================
                   STATS
                   ============================================================ */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: -20px auto 50px;
    padding: 0 30px;
    position: relative;
    z-index: 2;
}

.stat-item {
    background: #fff;
    padding: 24px 16px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.02);
    transition: var(--transition);
}

[data-theme="dark"] .stat-item {
    background: var(--gray-800);
    border-color: rgba(255, 255, 255, 0.03);
}

.stat-item:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.stat-item .num {
    font-size: 2.4rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-item .label {
    color: var(--gray-500);
    font-weight: 500;
    margin-top: 4px;
    font-size: 0.9rem;
}

.stat-item .icon {
    font-size: 1.8rem;
    color: var(--primary);
    opacity: 0.85;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-item .icon .lucide-icon,
.hero .badge-top .lucide-icon,
.hero .badge-group .badge .lucide-icon {
    display: inline-block;
    vertical-align: middle;
}

.hero .badge-group .badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.hero .badge-top {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ============================================================
                   TOOLS
                   ============================================================ */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px 40px;
}

.category {
    margin-bottom: 60px;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.category.visible {
    opacity: 1;
    transform: translateY(0);
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--gray-200);
    transition: border-color 0.3s;
}

[data-theme="dark"] .category-header {
    border-bottom-color: var(--gray-700);
}

.category-title {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--gray-900);
}

.category-title .cat-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.4rem;
    box-shadow: 0 8px 16px rgba(67, 97, 238, 0.2), inset 0 2px 4px rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.category-title .cat-icon::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 60%);
    pointer-events: none;
}

.category-title span {
    font-size: 0.85rem;
    background: var(--gray-200);
    color: var(--gray-600);
    padding: 2px 16px;
    border-radius: 40px;
    font-weight: 700;
}

[data-theme="dark"] .category-title span {
    background: var(--gray-700);
    color: var(--gray-400);
}

.category-desc {
    color: var(--gray-500);
    font-size: 0.95rem;
}

/* ============================================================
                   TOOL CARDS
                   ============================================================ */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 11.5rem), 1fr));
    gap: clamp(0.75rem, 1.8vw, 1.25rem);
}

.tool-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: var(--transition);
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 130px;
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .tool-card {
    background: var(--gray-800);
    border-color: rgba(255, 255, 255, 0.03);
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: var(--transition);
}

.tool-card:hover::before {
    opacity: 1;
}

.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.tool-card .tool-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 16px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: rgba(67, 97, 238, 0.08);
    color: var(--primary);
    position: relative;
    z-index: 1;
    border: 1px solid rgba(67, 97, 238, 0.1);
}

[data-theme="dark"] .tool-card .tool-icon {
    background: rgba(67, 97, 238, 0.15);
    border-color: rgba(255, 255, 255, 0.05);
}

.tool-card:hover .tool-icon {
    transform: scale(1.15) translateY(-5px);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    box-shadow: 0 12px 24px rgba(67, 97, 238, 0.3), inset 0 2px 4px rgba(255, 255, 255, 0.3);
    border-color: transparent;
}

.tool-card .tool-icon::before {
    content: "";
    position: absolute;
    inset: 0;
    background: inherit;
    filter: blur(15px);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.4s;
    border-radius: inherit;
}

.tool-card:hover .tool-icon::before {
    opacity: 0.4;
}

/* Lucide icon sizing inside cards */
.tool-icon .lucide-icon,
.cat-icon .lucide-icon {
    flex-shrink: 0;
}

/* Category-specific icon colors */
.tool-card[data-category="images"] .tool-icon {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.14), rgba(99, 102, 241, 0.08));
    color: #7c3aed;
    border-color: rgba(139, 92, 246, 0.2);
}

.tool-card[data-category="images"]:hover .tool-icon {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
}

.tool-card[data-category="pdf"] .tool-icon {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.14), rgba(249, 115, 22, 0.08));
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.2);
}

.tool-card[data-category="pdf"]:hover .tool-icon {
    background: linear-gradient(135deg, #ef4444, #f97316);
}

.tool-card[data-category="text"] .tool-icon {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.14), rgba(6, 182, 212, 0.08));
    color: #2563eb;
    border-color: rgba(59, 130, 246, 0.2);
}

.tool-card[data-category="text"]:hover .tool-icon {
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
}

.tool-card[data-category="calc"] .tool-icon {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(20, 184, 166, 0.08));
    color: #059669;
    border-color: rgba(16, 185, 129, 0.2);
}

.tool-card[data-category="calc"]:hover .tool-icon {
    background: linear-gradient(135deg, #10b981, #14b8a6);
}

.tool-card[data-category="money"] .tool-icon {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(234, 179, 8, 0.08));
    color: #d97706;
    border-color: rgba(245, 158, 11, 0.25);
}

.tool-card[data-category="money"]:hover .tool-icon {
    background: linear-gradient(135deg, #f59e0b, #eab308);
}

.tool-card[data-category="video"] .tool-icon {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.14), rgba(244, 63, 94, 0.08));
    color: #db2777;
    border-color: rgba(236, 72, 153, 0.2);
}

.tool-card[data-category="video"]:hover .tool-icon {
    background: linear-gradient(135deg, #ec4899, #f43f5e);
}

.tool-card[data-category="audio"] .tool-icon {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.14), rgba(139, 92, 246, 0.08));
    color: #4f46e5;
    border-color: rgba(99, 102, 241, 0.2);
}

.tool-card[data-category="audio"]:hover .tool-icon {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.tool-card[data-category="ai"] .tool-icon {
    background: linear-gradient(135deg, rgba(6, 214, 160, 0.14), rgba(67, 97, 238, 0.08));
    color: #0891b2;
    border-color: rgba(6, 214, 160, 0.2);
}

.tool-card[data-category="ai"]:hover .tool-icon {
    background: linear-gradient(135deg, #06d6a0, #4361ee);
}

.tool-card[data-category="dev"] .tool-icon {
    background: linear-gradient(135deg, rgba(100, 116, 139, 0.14), rgba(51, 65, 85, 0.08));
    color: #475569;
    border-color: rgba(100, 116, 139, 0.2);
}

.tool-card[data-category="dev"]:hover .tool-icon {
    background: linear-gradient(135deg, #64748b, #334155);
}

.tool-card[data-category="general"] .tool-icon {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.14), rgba(2, 132, 199, 0.08));
    color: #0284c7;
    border-color: rgba(14, 165, 233, 0.2);
}

.tool-card[data-category="general"]:hover .tool-icon {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
}

/* Category section header icons */
section[data-category="images"] .cat-icon {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: #fff;
}

section[data-category="pdf"] .cat-icon {
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: #fff;
}

section[data-category="text"] .cat-icon {
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    color: #fff;
}

section[data-category="calc"] .cat-icon {
    background: linear-gradient(135deg, #10b981, #14b8a6);
    color: #fff;
}

section[data-category="money"] .cat-icon {
    background: linear-gradient(135deg, #f59e0b, #eab308);
    color: #fff;
}

section[data-category="video"] .cat-icon {
    background: linear-gradient(135deg, #ec4899, #f43f5e);
    color: #fff;
}

section[data-category="audio"] .cat-icon {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
}

section[data-category="ai"] .cat-icon {
    background: linear-gradient(135deg, #06d6a0, #4361ee);
    color: #fff;
}

section[data-category="dev"] .cat-icon {
    background: linear-gradient(135deg, #64748b, #334155);
    color: #fff;
}

section[data-category="general"] .cat-icon {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: #fff;
}

.tool-card .tool-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--gray-800);
}

[data-theme="dark"] .tool-card .tool-name {
    color: var(--gray-200);
}

.tool-card .tool-name small {
    font-weight: 400;
    color: var(--gray-400);
    font-size: 0.7rem;
    display: block;
    margin-top: 2px;
}

.tool-card .tool-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.6rem;
    background: var(--accent);
    color: #fff;
    padding: 2px 10px;
    border-radius: 40px;
    font-weight: 700;
}

/* ============================================================
                   TOP TOOLS
                   ============================================================ */
.top-tools-section {
    background: linear-gradient(145deg, #fffbeb, #fef3c7);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    margin-top: 40px;
    border: 2px solid #fcd34d;
    transition: background 0.3s, border-color 0.3s;
}

[data-theme="dark"] .top-tools-section {
    background: linear-gradient(145deg, #2a2418, #1f1b12);
    border-color: #f59e0b;
}

.top-tools-section .category-title .cat-icon {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.top-tools-section .tool-card {
    border: 2px solid #fcd34d;
    background: rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .top-tools-section .tool-card {
    background: rgba(30, 30, 50, 0.6);
    border-color: #f59e0b;
}

.top-tools-section .tool-card .tool-icon {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
}

.top-tools-section .tool-card:hover .tool-icon {
    background: linear-gradient(135deg, #d97706, #b45309);
}

/* ============================================================
                   FOOTER
                   ============================================================ */
.footer {
    padding: 80px 40px 40px;
    background: #fff;
    border-top: 1px solid var(--gray-200);
    margin-top: 60px;
    transition: background 0.3s, border-color 0.3s;
}

[data-theme="dark"] .footer {
    background: var(--gray-900);
    border-top-color: var(--gray-800);
}

.footer-top {
    max-width: 1400px;
    margin: 0 auto 60px;
    display: grid;
    grid-template-columns: 1.2fr 2fr;
    gap: 60px;
    text-align: right;
}

.footer-brand .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.6rem;
    font-weight: 900;
    margin-bottom: 20px;
}

.footer-brand .site-logo-text {
    background: none;
    -webkit-text-fill-color: #fff;
    color: #fff;
}

.footer-brand .site-logo-img {
    box-shadow:
        0 0 0 1px rgba(34, 211, 238, 0.25),
        0 10px 28px rgba(59, 130, 246, 0.28);
}

.footer-brand p {
    color: var(--gray-500);
    font-size: 1rem;
    max-width: 400px;
    line-height: 1.8;
}

.footer-links-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.footer-column h3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 24px;
    position: relative;
    padding-bottom: 10px;
}

[data-theme="dark"] .footer-column h3 {
    color: #fff;
}

.footer-column h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 30px;
    height: 2px;
    background: var(--primary);
}

.footer-column a {
    display: block;
    color: var(--gray-500);
    margin-bottom: 14px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
}

.footer-column a:hover {
    color: var(--primary);
    transform: translateX(-5px);
}

.footer-bottom {
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 40px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

[data-theme="dark"] .footer-bottom {
    border-top-color: var(--gray-800);
}

.footer .social {
    display: flex;
    gap: 12px;
}

.footer .social a {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--gray-50);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    transition: var(--transition);
}

[data-theme="dark"] .footer .social a {
    background: var(--gray-800);
    color: var(--gray-400);
}

.footer .social a:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-3px);
}

.footer i.heart {
    color: var(--danger);
    animation: heartBeat 1.5s infinite;
}

@keyframes heartBeat {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

/* ============================================================
                   BACK TO TOP
                   ============================================================ */
.back-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
}

.back-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.back-top:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: var(--shadow-xl);
}

/* ============================================================
                   NO RESULT
                   ============================================================ */
.no-result {
    display: none;
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

.no-result i {
    font-size: 3rem;
    display: block;
    margin-bottom: 16px;
    opacity: 0.3;
}

/* ============================================================
                   RESPONSIVE
                   ============================================================ */
@media (max-width: 1024px) {
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0 16px;
    }

    .navbar .nav-links {
        display: none;
    }

    .navbar .search-box input {
        width: clamp(4.5rem, 30vw, 8rem);
    }

    .hero {
        margin: 10px 12px 30px;
        padding: 40px 16px 30px;
    }

    .hero h1 {
        font-size: clamp(1.6rem, 7vw, 2.4rem);
    }

    .container {
        padding: 0 12px 30px;
    }

    .tools-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .tool-card {
        padding: 16px 10px;
        min-height: 110px;
    }

    .tool-card .tool-icon {
        width: 44px;
        height: 44px;
        font-size: 1.4rem;
    }

    .category-title {
        font-size: clamp(1.15rem, 4vw, 1.4rem);
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
        padding: 0 12px;
        margin-top: -10px;
    }

    .stat-item .num {
        font-size: clamp(1.4rem, 5vw, 1.8rem);
    }

    .top-tools-section {
        padding: 24px 16px;
    }

    .footer-top {
        grid-template-columns: 1fr;
    }

    .footer-links-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.8rem;
    }

    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 10px;
    }

    .tool-card {
        min-height: 90px;
        padding: 12px 6px;
    }

    .tool-card .tool-icon {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
        border-radius: 12px;
    }

    .tool-card .tool-name {
        font-size: 0.75rem;
    }

    .navbar .search-box input {
        width: 70px;
        font-size: 0.8rem;
    }

    .stats {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-item {
        padding: 16px 8px;
    }

    .stat-item .num {
        font-size: 1.4rem;
    }

    .hero .badge-group .badge {
        font-size: 0.7rem;
        padding: 4px 14px;
    }
}