/**
 * OnlineToolFree - Enterprise Design System
 * Version: 4.0 - Minimalist Corporate Rebrand
 * Style: Clean, Calm, Trustworthy, Enterprise-grade
 */

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   CSS VARIABLES - ENTERPRISE DESIGN SYSTEM
   Minimalist | Professional | Corporate-grade
   ======================================== */
:root {
    /* Typography - Inter Font (Modern Sans-serif) */
    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;

    /* Font Sizes */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
    --text-6xl: 3.75rem;

    /* Font Weights */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;

    /* ============================================
       ENTERPRISE COLOR PALETTE
       Core: White, Off-white, Black, Blue
       ============================================ */

    /* Subtle Gradients - Clean, Calm, Professional */
    --gradient-hero: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    --gradient-bg: linear-gradient(180deg, #ffffff 0%, #f1f5f9 50%, #f8fafc 100%);
    --gradient-header: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.95) 100%);
    --gradient-primary: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    --gradient-blue-light: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
    --gradient-card: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);

    /* Primary Blue - Professional Tech Blue */
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-300: #93c5fd;
    --primary-400: #60a5fa;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-800: #1e40af;
    --primary-900: #1e3a8a;
    --primary-950: #172554;

    /* Neutral Colors - Clean Grays */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --gray-950: #030712;

    /* Accent - Same as Primary for consistency */
    --accent-50: #eff6ff;
    --accent-100: #dbeafe;
    --accent-200: #bfdbfe;
    --accent-300: #93c5fd;
    --accent-400: #60a5fa;
    --accent-500: #3b82f6;
    --accent-600: #2563eb;
    --accent-700: #1d4ed8;
    --accent-800: #1e40af;
    --accent-900: #1e3a8a;

    /* Semantic Colors */
    --success-50: #f0fdf4;
    --success-100: #dcfce7;
    --success-500: #22c55e;
    --success-600: #16a34a;
    --error-50: #fef2f2;
    --error-100: #fee2e2;
    --error-500: #ef4444;
    --error-600: #dc2626;
    --warning-50: #fffbeb;
    --warning-100: #fef3c7;
    --warning-500: #f59e0b;
    --warning-600: #d97706;
    --info-50: #eff6ff;
    --info-100: #dbeafe;
    --info-500: #3b82f6;
    --info-600: #2563eb;

    /* Background Colors - Clean White & Off-white */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --bg-elevated: #ffffff;
    --bg-overlay: rgba(0, 0, 0, 0.4);
    --bg-subtle: #f8fafc;

    /* Text Colors - High Contrast */
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-tertiary: #6b7280;
    --text-muted: #9ca3af;
    --text-inverse: #ffffff;
    --text-link: #2563eb;

    /* Border Colors - Subtle */
    --border-light: #e5e7eb;
    --border-default: #d1d5db;
    --border-strong: #9ca3af;
    --border-focus: #2563eb;

    /* Shadows - Soft and Subtle */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.06), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.03), 0 4px 12px rgba(0, 0, 0, 0.02);
    --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-button: 0 1px 2px rgba(0, 0, 0, 0.05);

    /* Border Radius - Subtle Rounded Corners */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    --radius-3xl: 24px;
    --radius-full: 9999px;

    /* Spacing Scale */
    --space-0: 0;
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    --space-32: 8rem;

    /* Transitions - Smooth */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Z-Index Scale */
    --z-base: 0;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;
    --z-toast: 800;

    /* Layout */
    --header-height: 64px;
    --sidebar-width: 280px;
    --container-max: 1200px;
}

/* ========================================
   DARK THEME
   ======================================== */
[data-theme="dark"] {
    --gradient-bg: linear-gradient(180deg, #1e1b4b 0%, #312e81 50%, #3730a3 100%);
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #252525;
    --bg-elevated: #1f1f1f;

    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;
    --text-muted: #52525b;

    --border-light: rgba(255, 255, 255, 0.08);
    --border-default: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.2);

    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2);
    --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* ========================================
   BASE STYLES - SELLY GRADIENT BACKGROUND
   ======================================== */
body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--gradient-bg);
    background-attachment: fixed;
    min-height: 100vh;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: var(--font-bold);
    line-height: 1.2;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

h1 {
    font-size: clamp(2.5rem, 6vw, var(--text-6xl));
    font-weight: var(--font-extrabold);
    letter-spacing: -0.03em;
}

h2 {
    font-size: clamp(1.75rem, 4vw, var(--text-4xl));
}

h3 {
    font-size: clamp(1.25rem, 3vw, var(--text-2xl));
}

p {
    color: var(--text-secondary);
    line-height: 1.7;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-600);
}

/* ========================================
   LAYOUT - CONTAINER
   ======================================== */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-4);
    box-sizing: border-box;
}

@media (max-width: 380px) {
    .container {
        padding: 0 var(--space-3);
    }
}


@media (min-width: 640px) {
    .container {
        padding: 0 var(--space-6);
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 var(--space-8);
    }
}

/* ========================================
   HEADER - SELLY STYLE (Clean, Minimal)
   ======================================== */
.header {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
}

[data-theme="dark"] .header {
    background: rgba(15, 15, 15, 0.85);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: var(--space-6);
}

/* Logo - Bold like Selly */
.logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
    flex-shrink: 0;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--primary-900);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.logo-icon svg {
    width: 20px;
    height: 20px;
}

.logo-text {
    font-size: var(--text-xl);
    font-weight: var(--font-extrabold);
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.logo-text span {
    color: var(--accent-600);
}

/* Navigation - Centered like Selly */
.nav-menu {
    display: none;
    align-items: center;
    gap: var(--space-1);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

@media (min-width: 768px) {
    .nav-menu {
        display: flex;
    }
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.05);
}

.nav-link.active {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.08);
}

.nav-link svg {
    width: 16px;
    height: 16px;
    display: none;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* Theme Toggle */
.theme-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

/* ========================================
   MOBILE MENU BUTTON - CRITICAL FIX
   ======================================== */
.mobile-menu-btn {
    display: flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-default);
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

.mobile-menu-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-strong);
}

.mobile-menu-btn:active {
    transform: scale(0.95);
}

.mobile-menu-btn svg {
    width: 22px;
    height: 22px;
    pointer-events: none;
}

@media (min-width: 768px) {
    .mobile-menu-btn {
        display: none;
    }
}

/* ========================================
   MOBILE MENU - SLIDE IN FROM RIGHT
   ======================================== */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    height: 100dvh;
    background: var(--bg-primary);
    z-index: calc(var(--z-modal) + 1);
    padding: var(--space-8) var(--space-6);
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-menu.open {
    right: 0;
}

.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-close {
    position: absolute;
    top: var(--space-6);
    right: var(--space-6);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mobile-menu-close:hover {
    background: var(--bg-secondary);
}

.mobile-menu-close svg {
    width: 20px;
    height: 20px;
}

.mobile-nav-list {
    list-style: none;
    margin-top: var(--space-16);
    padding: 0;
}

.mobile-nav-list li {
    margin-bottom: var(--space-2);
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    border-radius: var(--radius-xl);
    transition: all var(--transition-fast);
}

.mobile-nav-link:hover {
    background: var(--bg-tertiary);
    color: var(--accent-600);
}

.mobile-nav-link svg {
    width: 22px;
    height: 22px;
    color: var(--text-secondary);
}

/* ========================================
   BUTTONS - SELLY STYLE (Black Primary)
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    line-height: 1;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
}

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

/* Primary Button - Blue Gradient (Enterprise) */
.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    box-shadow: var(--shadow-button);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

/* Secondary Button - White with Blue border */
.btn-secondary {
    background: var(--bg-primary);
    color: var(--primary-600);
    border: 1px solid var(--primary-200);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--primary-50);
    border-color: var(--primary-300);
}

/* Ghost Button */
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

/* Button Sizes */
.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-xs);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-base);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-lg);
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

/* ========================================
   HERO SECTION - SELLY STYLE
   ======================================== */
.hero {
    padding: var(--space-24) 0;
    text-align: center;
    position: relative;
}

.hero h1 {
    max-width: 800px;
    margin: 0 auto var(--space-6);
    line-height: 1.1;
}

.hero-subtitle {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto var(--space-10);
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-4);
}

/* ========================================
   CARDS
   ======================================== */
.card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-card);
    transition: all var(--transition-base);
}

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

/* ========================================
   TOOL CARD - PREMIUM DESIGN
   ======================================== */
.tool-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-2xl);
    padding: var(--space-6);
    text-decoration: none;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-card);
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--accent-300);
}

.tool-card-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--accent-100) 0%, var(--gray-100) 100%);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-4);
    color: var(--accent-600);
}

.tool-card-icon svg {
    width: 26px;
    height: 26px;
}

.tool-card-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.tool-card-description {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-4);
}

.tool-card-action {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--accent-600);
    margin-top: auto;
}

.tool-card-action svg {
    width: 16px;
    height: 16px;
    transition: transform var(--transition-fast);
}

.tool-card:hover .tool-card-action svg {
    transform: translateX(4px);
}

/* ========================================
   SIDEBAR - CONTENT-FIRST DESIGN
   Sidebar hidden by default on mobile, visible on desktop
   ======================================== */

/* Default: Hidden on mobile (CONTENT-FIRST) */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    height: 100dvh;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-light);
    overflow-y: auto;
    z-index: var(--z-modal);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-overflow-scrolling: touch;
    padding: var(--space-4);
    padding-top: calc(var(--header-height) + var(--space-4));
    box-shadow: var(--shadow-2xl);
}

/* Sidebar opens when .open class is added */
.sidebar.open {
    transform: translateX(0);
}

/* Desktop: Sidebar visible by default, static positioning */
@media (min-width: 1024px) {
    .sidebar {
        transform: translateX(0);
        position: fixed;
        top: var(--header-height);
        height: calc(100vh - var(--header-height));
        padding-top: var(--space-4);
        box-shadow: none;
        z-index: var(--z-fixed);
    }
}

.sidebar-header {
    padding: var(--space-4) var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--border-light);
    margin-bottom: var(--space-4);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    text-decoration: none;
}

.sidebar-logo svg {
    width: 24px;
    height: 24px;
    color: var(--accent-600);
}

.sidebar-section {
    margin-bottom: var(--space-4);
}

.sidebar-title {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: var(--space-2) var(--space-3);
    margin-bottom: var(--space-1);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-3);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-secondary);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.sidebar-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: var(--accent-50);
    color: var(--accent-600);
}

.sidebar-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.sidebar-divider {
    height: 1px;
    background: var(--border-light);
    margin: var(--space-4) 0;
}

.sidebar-badge {
    margin-left: auto;
    padding: 2px 8px;
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    border-radius: var(--radius-full);
}

/* Sidebar Category */
.sidebar-category {
    margin-bottom: var(--space-2);
}

.sidebar-category-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.sidebar-category-header:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar-category-header svg {
    width: 16px;
    height: 16px;
}

.sidebar-category-header svg:last-child {
    margin-left: auto;
    transition: transform var(--transition-fast);
}

.sidebar-category.expanded .sidebar-category-header svg:last-child {
    transform: rotate(90deg);
}

.sidebar-category-items {
    display: none;
    padding-left: var(--space-6);
    margin-top: var(--space-1);
}

.sidebar-category.expanded .sidebar-category-items {
    display: block;
}

.sidebar-tool-link {
    display: block;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.sidebar-tool-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar-tool-link.active {
    background: var(--accent-50);
    color: var(--accent-600);
    font-weight: var(--font-medium);
}

/* ========================================
   SIDEBAR TOGGLE BUTTON - MOBILE ONLY
   ======================================== */
.sidebar-toggle {
    display: none;
    position: fixed;
    bottom: var(--space-6);
    left: var(--space-4);
    z-index: calc(var(--z-modal) + 10);
    /* Ensure it is above most elements */
    padding: var(--space-3) var(--space-5);
    background: #2563eb;
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    cursor: pointer;
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4), var(--shadow-lg);
    transition: all var(--transition-fast);
    animation: pulse-blue 2s infinite;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

@keyframes pulse-blue {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.6), var(--shadow-lg);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(37, 99, 235, 0), var(--shadow-lg);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0), var(--shadow-lg);
    }
}

.sidebar-toggle:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.sidebar-toggle:active {
    transform: translateY(0);
}

.sidebar-toggle svg {
    width: 20px;
    height: 20px;
    margin-right: var(--space-2);
}

/* Show toggle button ONLY on mobile/tablet */
@media (max-width: 1023px) {
    .sidebar-toggle {
        display: flex;
        align-items: center;
    }
}

/* Hide toggle on desktop */
@media (min-width: 1024px) {
    .sidebar-toggle {
        display: none !important;
    }
}

/* ========================================
   SIDEBAR OVERLAY - MOBILE ONLY
   ======================================== */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    /* Just below sidebar */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Hide overlay on desktop */
@media (min-width: 1024px) {
    .sidebar-overlay {
        display: none !important;
    }
}

/* ========================================
   MAIN CONTENT - CONTENT-FIRST LAYOUT
   Tool content is ALWAYS visible first
   ======================================== */
.main-content {
    min-height: calc(100vh - var(--header-height));
    padding: var(--space-8) 0;
    width: 100%;
}

/* Desktop: Add margin for sidebar */
@media (min-width: 1024px) {

    .has-sidebar .main-content,
    .tool-page-layout .main-content {
        margin-left: var(--sidebar-width);
    }
}

/* ========================================
   TOOL PAGE LAYOUT - CONTENT-FIRST
   Mobile: Full width content, no sidebar
   Desktop: Sidebar + Content side by side
   ======================================== */
.tool-page-layout {
    display: block;
    width: 100%;
}

/* Desktop: Content gets margin for sidebar */
@media (min-width: 1024px) {
    .tool-page-layout {
        padding-left: var(--sidebar-width);
    }
}

/* Tool Page Content */
.tool-page {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-8) var(--space-4);
}

.tool-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.tool-icon-large {
    width: 72px;
    height: 72px;
    background: var(--primary-900);
    border-radius: var(--radius-2xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-5);
    color: white;
    box-shadow: var(--shadow-lg);
}

.tool-icon-large svg {
    width: 32px;
    height: 32px;
}

.tool-title {
    font-size: var(--text-4xl);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-3);
}

.tool-description {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Tool Interface */
.tool-interface {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-2xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-card);
}

/* ========================================
   TOOL-LAYOUT (Used in actual tool pages)
   CONTENT-FIRST: Content visible immediately
   ======================================== */
.tool-layout {
    display: block;
    width: 100%;
    min-height: calc(100vh - var(--header-height));
}

/* Desktop: Add left margin for sidebar */
@media (min-width: 1024px) {
    .tool-layout {
        margin-left: var(--sidebar-width);
    }
}

/* ========================================
   TOOL-SIDEBAR (Aside element in tool pages)
   CONTENT-FIRST: Hidden on mobile by default
   ======================================== */
.tool-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    height: 100dvh;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid var(--border-light);
    overflow-y: auto;
    z-index: 1000;
    /* High z-index to stay above overlay */
    transform: translateX(-100%) translateZ(0);
    /* Force hardware orientation */
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-overflow-scrolling: touch;
    padding: var(--space-4);
    padding-top: calc(var(--header-height) + var(--space-4));
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.1);
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Dark theme glassmorphism */
[data-theme="dark"] .tool-sidebar {
    background: rgba(20, 20, 25, 0.85);
}

/* Sidebar opens when .open class is added */
.tool-sidebar.open {
    transform: translateX(0);
}

/* Desktop: Sidebar visible by default */
@media (min-width: 1024px) {
    .tool-sidebar {
        transform: translateX(0);
        position: fixed;
        top: var(--header-height);
        height: calc(100vh - var(--header-height));
        padding-top: var(--space-4);
        box-shadow: none;
        z-index: var(--z-fixed);
    }
}

/* ========================================
   TOOL-MAIN (Main content area in tool pages)
   CONTENT-FIRST: Always visible immediately
   ======================================== */
.tool-main {
    width: 100%;
    min-height: calc(100vh - var(--header-height));
    padding: var(--space-6) var(--space-4);
}

@media (min-width: 768px) {
    .tool-main {
        padding: var(--space-8) var(--space-6);
    }
}

@media (min-width: 1024px) {
    .tool-main {
        padding: var(--space-8);
    }
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-light);
    padding: var(--space-16) 0 var(--space-8);
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-8);
    margin-bottom: var(--space-12);
}

.footer-brand {
    max-width: 280px;
}

.footer-brand p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-top: var(--space-4);
    line-height: 1.7;
}

.footer-social {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-4);
}

.footer-social a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.footer-social a:hover {
    background: var(--primary-900);
    color: white;
}

.footer-column h4 {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-4);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: var(--space-2);
}

.footer-links a {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--accent-600);
}

.footer-bottom {
    padding-top: var(--space-8);
    border-top: 1px solid var(--border-light);
    text-align: center;
}

.footer-copyright {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
}

/* ========================================
   FORM ELEMENTS
   ======================================== */
.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    transition: all var(--transition-fast);
    /* Prevent iOS zoom */
    font-size: 16px;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent-500);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.form-textarea {
    min-height: 200px;
    resize: vertical;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
}

/* ========================================
   BREADCRUMB
   ======================================== */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    margin-bottom: var(--space-6);
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    list-style: none;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.breadcrumb-item a {
    color: var(--text-tertiary);
}

.breadcrumb-item a:hover {
    color: var(--accent-600);
}

.breadcrumb-sep {
    color: var(--text-muted);
}

.breadcrumb-sep svg {
    width: 14px;
    height: 14px;
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */
.toast-container {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-light);
    animation: slideInRight 0.3s ease;
    max-width: 400px;
}

.toast.success {
    border-left: 4px solid var(--success-500);
}

.toast.error {
    border-left: 4px solid var(--error-500);
}

.toast.warning {
    border-left: 4px solid var(--warning-500);
}

.toast.info {
    border-left: 4px solid var(--info-500);
}

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: var(--success-500);
}

.toast.error .toast-icon {
    color: var(--error-500);
}

.toast-message {
    flex: 1;
    font-size: var(--text-sm);
    color: var(--text-primary);
}

.toast-close {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-md);
}

.toast-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* ========================================
   ICONS
   ======================================== */
.icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.icon-sm {
    width: 16px;
    height: 16px;
}

.icon-lg {
    width: 24px;
    height: 24px;
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease;
}

.animate-slide-up {
    animation: slideUp 0.4s ease;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: var(--space-2);
}

.gap-3 {
    gap: var(--space-3);
}

.gap-4 {
    gap: var(--space-4);
}

.gap-6 {
    gap: var(--space-6);
}

.gap-8 {
    gap: var(--space-8);
}

.text-center {
    text-align: center;
}

.text-sm {
    font-size: var(--text-sm);
}

.text-lg {
    font-size: var(--text-lg);
}

.font-medium {
    font-weight: var(--font-medium);
}

.font-semibold {
    font-weight: var(--font-semibold);
}

.font-bold {
    font-weight: var(--font-bold);
}

.text-muted {
    color: var(--text-muted);
}

.text-secondary {
    color: var(--text-secondary);
}

.hidden {
    display: none;
}

.block {
    display: block;
}

.w-full {
    width: 100%;
}

.mt-4 {
    margin-top: var(--space-4);
}

.mt-6 {
    margin-top: var(--space-6);
}

.mt-8 {
    margin-top: var(--space-8);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mb-6 {
    margin-bottom: var(--space-6);
}

.mb-8 {
    margin-bottom: var(--space-8);
}

.p-4 {
    padding: var(--space-4);
}

.p-6 {
    padding: var(--space-6);
}

.p-8 {
    padding: var(--space-8);
}

/* Grid */
.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, 1fr);
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (min-width: 640px) {
    .sm\:grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .lg\:grid-cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: var(--space-4);
}

@media (min-width: 640px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .tools-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1280px) {
    .tools-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ========================================
   RESPONSIVE OVERRIDES
   ======================================== */
@media (max-width: 1023px) {
    .layout-grid {
        display: block !important;
    }

    .layout-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: var(--sidebar-width) !important;
        height: 100vh !important;
        height: 100dvh !important;
        background: var(--bg-primary) !important;
        z-index: var(--z-modal) !important;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto !important;
        box-shadow: var(--shadow-2xl);
    }

    .layout-sidebar.open {
        transform: translateX(0);
    }
}

/* Touch device optimization */
@media (hover: none) and (pointer: coarse) {

    .btn,
    .mobile-nav-link,
    .nav-link,
    .sidebar-link {
        min-height: 44px;
    }

    .mobile-menu-btn,
    .sidebar-toggle {
        min-width: 44px;
        min-height: 44px;
    }
}

/* iOS zoom prevention */
input,
textarea,
select {
    font-size: 16px !important;
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {

    .header,
    .sidebar,
    .sidebar-toggle,
    .mobile-menu-btn,
    .footer {
        display: none !important;
    }

    body {
        background: white;
    }

    .main-content {
        margin-left: 0 !important;
    }
}

/* ========================================
   CATEGORY-BASED HOMEPAGE LAYOUT
   Matches reference image design
   ======================================== */

/* Category Section */
.category-section {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-2xl);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
    box-shadow: var(--shadow-sm);
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

/* Category Header (Blue bar - Enterprise branding) */
.category-header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    margin: calc(-1 * var(--space-6));
    margin-bottom: var(--space-5);
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
    color: white;
    overflow: hidden;
}

.category-header-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-header-icon svg {
    width: 24px;
    height: 24px;
    stroke: white;
    fill: none;
}

.category-header-content {
    flex: 1;
}

.category-header-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    margin: 0;
    color: white;
}

.category-header-desc {
    font-size: var(--text-sm);
    margin: 0;
    opacity: 0.9;
    color: white;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Category Tools Grid (Matches reference image design) */
.category-tools-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* Default: 1 column */
    gap: var(--space-3);
}

@media (min-width: 480px) {
    .category-tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .category-tools-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 639px) {
    .category-section {
        padding: var(--space-4);
        border-radius: var(--radius-xl);
    }

    .category-header {
        margin: calc(-1 * var(--space-4));
        margin-bottom: var(--space-3);
        padding: var(--space-3) var(--space-4);
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    }
}


/* Category Tool Card (Simple like reference) */
.category-tool-card {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.category-tool-card:hover {
    border-color: var(--accent-300);
    background: var(--bg-tertiary);
    transform: translateY(-1px);
}

.category-tool-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    color: var(--accent-600);
}

.category-tool-icon svg {
    width: 18px;
    height: 18px;
}

.category-tool-name {
    flex: 1;
    min-width: 0;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========================================
   IMPROVED RELATED TOOLS SECTION
   Always at bottom, max 6 tools, same category
   ======================================== */
.related-tools-section {
    margin-top: var(--space-12);
    padding-top: var(--space-8);
    border-top: 1px solid var(--border-light);
}

.related-tools-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-2);
    color: var(--text-primary);
}

.related-tools-description {
    color: var(--text-secondary);
    margin-bottom: var(--space-6);
}

/* Related Tools Grid - Max 6 items, responsive */
.related-tools-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
}

@media (min-width: 640px) {
    .related-tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .related-tools-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Related Tool Card */
.related-tool-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    text-decoration: none;
    transition: all var(--transition-base);
}

.related-tool-card:hover {
    border-color: var(--accent-300);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.related-tool-icon {
    width: 44px;
    height: 44px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-600);
    flex-shrink: 0;
}

.related-tool-icon svg {
    width: 22px;
    height: 22px;
}

.related-tool-content {
    flex: 1;
    min-width: 0;
}

.related-tool-name {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin: 0 0 var(--space-1) 0;
}

.related-tool-desc {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.related-tool-card>svg {
    width: 18px;
    height: 18px;
    color: var(--accent-500);
    flex-shrink: 0;
}

/* Mobile: Stack vertically with large tap targets */
@media (max-width: 639px) {
    .related-tool-card {
        min-height: 70px;
    }

    .related-tool-desc {
        white-space: normal;
        line-height: 1.4;
    }
}

/* ========================================
   HOMEPAGE SEARCH SECTION
   ======================================== */
.homepage-search {
    max-width: 600px;
    margin: 0 auto var(--space-10);
    position: relative;
}

.homepage-search input {
    width: 100%;
    padding: var(--space-4) var(--space-12) var(--space-4) var(--space-5);
    font-size: var(--text-base);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-2xl);
    background: var(--bg-primary);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.homepage-search input:focus {
    border-color: var(--accent-400);
    box-shadow: 0 0 0 4px var(--accent-100);
    outline: none;
}

.homepage-search svg {
    position: absolute;
    right: var(--space-5);
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    pointer-events: none;
}

/* ========================================
   POPULAR TOOLS SIDEBAR (Like reference)
   ======================================== */
.popular-tools-widget {
    background: var(--error-50);
    border: 1px solid var(--error-200);
    border-radius: var(--radius-xl);
    padding: var(--space-4);
}

.popular-tools-header {
    background: var(--error-500);
    color: white;
    padding: var(--space-3) var(--space-4);
    margin: calc(-1 * var(--space-4));
    margin-bottom: var(--space-4);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    font-weight: var(--font-semibold);
}

.popular-tools-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.popular-tools-list li {
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--border-light);
}

.popular-tools-list li:last-child {
    border-bottom: none;
}

.popular-tools-list a {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--text-primary);
    text-decoration: none;
    font-size: var(--text-sm);
}

.popular-tools-list a::before {
    content: "✓";
    color: var(--success-500);
    font-weight: bold;
}

/* ========================================
   COOKIE CONSENT
   ======================================== */
.cookie-consent {
    position: fixed;
    bottom: var(--space-6);
    left: var(--space-6);
    right: var(--space-6);
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: var(--space-6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-6);
    transform: translateY(150%);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 1000px;
    margin: 0 auto;
}

.cookie-consent.show {
    transform: translateY(0);
}

.cookie-content {
    flex: 1;
}

.cookie-title {
    font-weight: var(--font-bold);
    font-size: var(--text-lg);
    margin-bottom: var(--space-1);
    display: block;
}

.cookie-text {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    line-height: 1.5;
}

.cookie-actions {
    display: flex;
    gap: var(--space-3);
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .cookie-consent {
        flex-direction: column;
        align-items: stretch;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        gap: var(--space-4);
    }

    .cookie-actions {
        width: 100%;
    }

    .cookie-actions .btn {
        flex: 1;
    }
}