/* Import Tailwind directives */
@tailwind base;
@tailwind components;
@tailwind utilities;

/* CSS Variables for Aurora Tech Design System */
:root {
    /* Color palette */
    --color-primary: #2563EB;
    /* Accessible Blue (Tailwind Blue 600) */
    --color-primary-hover: #1D4ED8;
    /* Darker shade for hover (Tailwind Blue 700) */
    --color-primary-soft: rgba(37, 99, 235, 0.12);
    --color-secondary-soft: rgba(80, 227, 194, 0.16);
    --color-accent-soft: rgba(155, 89, 182, 0.14);
    --color-secondary: #50E3C2;
    --color-secondary-hover: #40D3B2;
    --color-secondary-text: #0D9488;
    /* Darker teal for text (Tailwind Teal 600) - WCAG AA compliant */
    --color-accent: #9B59B6;
    --color-accent-text: #7C3AED;
    /* Darker purple for text (Tailwind Violet 600) - WCAG AA compliant */
    --color-accent-hover: #8B49A6;

    /* Neutral colors */
    --color-bg: #F5F7FA;
    --color-surface: #FFFFFF;
    --color-border: #E1E8ED;
    --color-text-dark: #2C3E50;
    --color-text-medium: #475569;
    --color-text-light: #6B7280;

    /* Semantic colors */
    --color-success: #50E3C2;
    --color-warning: #F39C12;
    --color-error: #E74C3C;
    --color-info: #4A90E2;

    /* Surface hierarchy */
    --surface-base: var(--color-bg);
    --surface-raised: var(--color-surface);
    --surface-higher: #FFFFFF;

    /* Text semantics */
    --text-strong: var(--color-text-dark);
    --text-default: var(--color-text-medium);
    --text-subtle: var(--color-text-light);

    /* Border semantics */
    --border-subtle: var(--color-border);
    --border-strong: #C3D0DD;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 24px 40px rgba(15, 23, 42, 0.18);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 450ms ease;

    /* Button-specific gradients */
    --btn-primary-from: var(--color-primary);
    --btn-primary-to: var(--color-secondary);
    --btn-outline-from: #4A90E2;
    --btn-outline-to: #50E3C2;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
}

/* Dark mode color scheme */
.dark {
    --color-bg: #1A202C;
    --color-surface: #2D3748;
    --color-border: #4A5568;
    --color-text-dark: #F7FAFC;
    --color-text-medium: #E2E8F0;
    --color-text-light: #CBD5E0;
    --color-primary-soft: rgba(96, 165, 250, 0.18);
    --color-secondary-soft: rgba(45, 212, 191, 0.18);
    --color-accent-soft: rgba(196, 181, 253, 0.18);
}

/* Base styles */
@layer base {
    body {
        @apply font-sans bg-[var(--color-bg)] text-[var(--color-text-dark)] transition-colors duration-300;
        font-family: "Inter", "Segoe UI Variable Text", "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    }

    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        @apply font-bold text-[var(--color-text-dark)];
    }

    h1 {
        @apply text-4xl md:text-5xl;
    }

    /* Ensure sectioned headings use explicit sizes so we never rely on deprecated UA defaults (H1UserAgentFontSizeInSection). */
    section h1,
    article h1,
    nav h1,
    aside h1,
    header h1,
    footer h1,
    main h1 {
        font-size: 2.25rem;
        line-height: 2.5rem;
    }

    @media (min-width: 768px) {

        section h1,
        article h1,
        nav h1,
        aside h1,
        header h1,
        footer h1,
        main h1 {
            font-size: 3rem;
            line-height: 1.2;
        }
    }

    h2 {
        @apply text-3xl md:text-4xl;
    }

    h3 {
        @apply text-2xl md:text-3xl;
    }

    h4 {
        @apply text-xl md:text-2xl;
    }

    h5 {
        @apply text-lg md:text-xl;
    }

    h6 {
        @apply text-base md:text-lg;
    }

    a {
        @apply text-[var(--color-primary)] hover:text-[var(--color-primary-hover)] transition-colors;
    }
}

/* Component styles */
@layer components {

    /* Buttons */
    .btn {
        @apply relative px-5 py-2.5 md:px-6 md:py-3 rounded-xl font-medium inline-flex items-center justify-center gap-2;
        @apply text-sm md:text-base;
        @apply transition-all duration-200 border border-transparent;
        @apply focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--color-primary)];
    }

    .btn-primary {
        @apply text-white;
        position: relative;
        z-index: 0;
        background-image: linear-gradient(120deg, var(--btn-primary-from), var(--btn-primary-to));
        box-shadow: 0 10px 20px rgba(15, 23, 42, 0.25);
    }

    .btn-primary:hover {
        transform: translateY(-1px);
        box-shadow: 0 14px 28px rgba(15, 23, 42, 0.35);
    }

    .btn-primary:active {
        transform: translateY(0);
        box-shadow: 0 6px 12px rgba(15, 23, 42, 0.25);
    }

    .btn-primary::before {
        content: "";
        position: absolute;
        inset: -2px;
        border-radius: inherit;
        background: radial-gradient(circle at top left, var(--btn-primary-to), transparent 55%),
            radial-gradient(circle at bottom right, var(--btn-primary-from), transparent 55%);
        opacity: 0;
        z-index: -1;
        transition: opacity var(--transition-normal);
    }

    .btn-primary:hover::before,
    .btn-primary:focus-visible::before,
    .btn-primary-enhanced:hover::before,
    .btn-premium:hover::before {
        opacity: 1;
    }

    .btn-soft {
        @apply text-[var(--color-primary)] border border-transparent;
        background: linear-gradient(120deg, var(--color-primary-soft), transparent 60%), var(--color-surface);
        box-shadow: 0 10px 18px rgba(37, 99, 235, 0.12);
    }

    .btn-soft:hover {
        transform: translateY(-1px);
        box-shadow: 0 14px 26px rgba(37, 99, 235, 0.18);
    }

    .btn-ghost {
        @apply text-[var(--color-text-medium)] border border-[var(--color-border)];
        background: transparent;
    }

    .btn-ghost:hover {
        color: var(--color-primary);
        background: var(--color-primary-soft);
        transform: translateY(-1px);
    }

    .btn-sm {
        @apply px-3 py-1.5 text-xs rounded-lg;
    }

    .btn-lg {
        @apply px-7 py-3.5 text-base rounded-2xl;
    }

    .btn-icon {
        @apply inline-flex items-center justify-center gap-2;
    }

    .btn-icon-only {
        @apply inline-flex items-center justify-center;
        width: 2.5rem;
        height: 2.5rem;
        padding: 0;
        border-radius: 999px;
    }

    .btn-secondary {
        @apply text-white;
        background-image: linear-gradient(120deg, var(--color-secondary), #34D399);
        box-shadow: 0 8px 18px rgba(16, 185, 129, 0.35);
    }

    .btn-secondary:hover {
        transform: translateY(-1px);
        box-shadow: 0 12px 24px rgba(16, 185, 129, 0.4);
    }

    .btn-secondary:active {
        transform: translateY(0);
        box-shadow: 0 6px 14px rgba(16, 185, 129, 0.3);
    }

    .btn-accent {
        @apply text-white;
        background-image: linear-gradient(120deg, var(--color-accent), #F97316);
        box-shadow: 0 8px 18px rgba(124, 58, 237, 0.35);
    }

    .btn-accent:hover {
        transform: translateY(-1px);
        box-shadow: 0 12px 24px rgba(124, 58, 237, 0.4);
    }

    .btn-accent:active {
        transform: translateY(0);
        box-shadow: 0 6px 14px rgba(124, 58, 237, 0.3);
    }

    .btn-danger {
        @apply bg-red-50 text-red-600 border-red-200 hover:bg-red-100 hover:text-red-700 hover:border-red-300 shadow-sm hover:shadow-md;
    }

    .btn-outline {
        @apply text-[var(--color-primary)];
        position: relative;
        background-image: linear-gradient(var(--surface-raised), var(--surface-raised)),
            linear-gradient(120deg, var(--btn-outline-from), var(--btn-outline-to));
        background-origin: border-box;
        background-clip: padding-box, border-box;
        border: 1px solid transparent;
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    }

    .btn-outline:hover {
        color: var(--color-primary-hover);
        transform: translateY(-1px);
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
    }

    .btn-outline:active {
        transform: translateY(0);
        box-shadow: 0 4px 10px rgba(15, 23, 42, 0.16);
    }

    .pill-button {
        @apply inline-flex items-center justify-center px-4 py-2 rounded-full text-sm font-medium;
        position: relative;
        background-image: linear-gradient(var(--surface-raised), var(--surface-raised)),
            linear-gradient(120deg, var(--btn-outline-from), var(--btn-outline-to));
        background-origin: border-box;
        background-clip: padding-box, border-box;
        border: 1px solid transparent;
        color: var(--text-default);
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
        transition: color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast), background var(--transition-fast);
        @apply focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--color-primary)];
    }

    .pill-button:hover {
        color: var(--color-primary);
        transform: translateY(-1px);
        box-shadow: 0 6px 14px rgba(15, 23, 42, 0.18);
    }

    .pill-button.is-active {
        background-image: linear-gradient(120deg, var(--btn-primary-from), var(--btn-primary-to));
        color: #ffffff;
        box-shadow: 0 10px 20px rgba(15, 23, 42, 0.25);
        border-color: transparent;
    }

    /* Cards */
    .card {
        @apply bg-[var(--color-surface)] rounded-xl shadow-[var(--shadow-md)] p-6 border border-[var(--color-border)] transition-shadow hover:shadow-[var(--shadow-lg)];
    }

    .card-hover {
        @apply cursor-pointer transform hover:-translate-y-1 transition-transform duration-200;
    }

    .card-subtle {
        @apply bg-[var(--color-surface)] border border-[var(--color-border)] rounded-xl p-6;
        box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
    }

    .card-elevated {
        @apply bg-[var(--color-surface)] border border-[var(--color-border)] rounded-2xl p-7;
        box-shadow: var(--shadow-xl);
    }

    .card-border-accent {
        background-image: linear-gradient(var(--surface-raised), var(--surface-raised)),
            linear-gradient(120deg, var(--btn-primary-from), var(--btn-primary-to));
        background-origin: border-box;
        background-clip: padding-box, border-box;
        border: 1px solid transparent;
    }

    .surface-glass {
        background: rgba(255, 255, 255, 0.75);
        border: 1px solid rgba(255, 255, 255, 0.4);
        backdrop-filter: blur(14px);
    }

    /* Forms */
    .form-input {
        @apply w-full px-4 py-3 rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] text-[var(--color-text-dark)] focus:ring-2 focus:ring-[var(--color-primary)] focus:border-transparent transition-all;
    }

    .form-label {
        @apply block text-sm font-medium text-[var(--color-text-medium)] mb-2;
    }

    .form-error {
        @apply text-[var(--color-error)] text-sm mt-1;
    }

    .input-group,
    .tool-input-group {
        @apply space-y-2;
    }

    .input-invalid {
        border-color: var(--color-error);
        box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.18);
    }

    .input-success {
        border-color: var(--color-success);
        box-shadow: 0 0 0 3px rgba(80, 227, 194, 0.2);
    }

    /* Navigation */
    .nav-link {
        @apply px-4 py-3 text-[var(--color-text-dark)] hover:text-[var(--color-primary)] transition-colors;
        min-height: 44px;
    }

    .nav-link-active {
        @apply text-[var(--color-primary)] font-medium;
    }

    /* Touch targets: desktop search + command palette trigger */
    #global-search-input,
    #command-palette-trigger {
        min-height: 44px;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    /* Touch targets: mobile search */
    #global-search-input-mobile {
        min-height: 48px;
        padding-top: 0.85rem;
        padding-bottom: 0.85rem;
    }

    /* Container */
    .container-custom {
        @apply max-w-7xl mx-auto px-4 sm:px-6 lg:px-8;
    }

    /* Tool card specific */
    .tool-card {
        @apply card card-hover;
    }

    .tool-icon {
        @apply w-12 h-12 flex items-center justify-center rounded-lg bg-gradient-to-br from-[var(--color-primary)] to-[var(--color-secondary)] text-white text-2xl mb-4 transition-transform;
    }

    .group:hover .tool-icon {
        @apply scale-110;
    }

    .validation-summary {
        @apply bg-red-50 border border-red-200 rounded-2xl p-4 text-sm text-red-800 shadow-sm;
    }

    .lead {
        @apply text-lg md:text-xl text-[var(--color-text-medium)] leading-relaxed;
    }

    .eyebrow {
        @apply text-xs uppercase tracking-[0.3em] text-[var(--color-text-light)] font-semibold;
    }

    .section-title {
        @apply text-2xl md:text-3xl font-semibold text-[var(--color-text-dark)];
    }

    .section-subtitle {
        @apply text-sm md:text-base text-[var(--color-text-medium)];
    }

    .badge-coming-soon {
        @apply inline-flex items-center gap-2 px-3 py-1 text-xs font-semibold uppercase tracking-wide rounded-full bg-[var(--color-warning)] bg-opacity-10 text-[var(--color-warning)] border border-[var(--color-warning)] shadow-sm;
    }

    .recipe-generator-page .card,
    .rate-comparison-page .card {
        @apply cursor-auto shadow-[var(--shadow-md)];
    }

    .recipe-generator-page .card:hover,
    .rate-comparison-page .card:hover {
        @apply shadow-[var(--shadow-md)];
    }

    .meme-generator-page .tool-card,
    .ai-writing-assistant-page .tool-card,
    .encryption-tool-page .tool-card,
    .poll-builder-page .tool-card {
        @apply cursor-auto shadow-[var(--shadow-md)];
        transform: none;
    }

    .meme-generator-page .tool-card:hover,
    .ai-writing-assistant-page .tool-card:hover,
    .encryption-tool-page .tool-card:hover,
    .poll-builder-page .tool-card:hover {
        @apply shadow-[var(--shadow-md)];
        transform: none;
    }

    .tool-ticker {
        @apply relative overflow-hidden;
    }

    .tool-ticker-track {
        @apply inline-flex items-center;
        gap: 2.5rem;
        white-space: nowrap;
        animation: toolTickerScroll 40s linear infinite;
    }

    /* ===== Premium Tool Components ===== */

    /* Tool Section Cards */
    .tool-section-card {
        @apply bg-[var(--color-surface)] rounded-2xl p-6 md:p-7;
        border: 1px solid var(--color-border);
        box-shadow: var(--shadow-md);
        transition: box-shadow 0.2s ease;
    }

    .tool-section-card:hover {
        box-shadow: var(--shadow-lg);
    }

    .tool-section-header {
        @apply mb-5;
    }

    .tool-section-title {
        @apply text-xl font-semibold text-[var(--color-text-dark)] mb-1;
    }

    .tool-section-subtitle,
    .result-placeholder-text {
        @apply text-sm text-[var(--color-text-medium)];
    }

    /* Enhanced Primary Button (Option A: Refined theme colors) */
    .btn-primary-enhanced {
        @apply px-6 py-3 rounded-xl font-semibold text-white;
        position: relative;
        z-index: 0;
        background-image: linear-gradient(135deg, var(--btn-primary-from), var(--btn-primary-to));
        box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25), 0 2px 8px rgba(80, 227, 194, 0.15);
        transition: all 0.2s ease;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .btn-primary-enhanced:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 28px rgba(37, 99, 235, 0.35), 0 4px 12px rgba(80, 227, 194, 0.25);
    }

    .btn-primary-enhanced:active {
        transform: translateY(0);
        box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
    }

    .btn-primary-enhanced::before {
        content: "";
        position: absolute;
        inset: -1px;
        border-radius: inherit;
        background: linear-gradient(135deg, rgba(80, 227, 194, 0.3), rgba(37, 99, 235, 0.3));
        opacity: 0;
        z-index: -1;
        transition: opacity var(--transition-normal);
    }


    /* Premium Button Variant (Option C: Modern premium alternative) */
    .btn-premium {
        @apply px-6 py-3 rounded-xl font-semibold text-white;
        position: relative;
        z-index: 0;
        background: linear-gradient(135deg, #0D9488 0%, #10B981 50%, #14B8A6 100%);
        box-shadow: 0 10px 24px rgba(13, 148, 136, 0.35), 0 4px 12px rgba(16, 185, 129, 0.2);
        transition: all 0.2s ease;
        border: 1px solid rgba(255, 255, 255, 0.15);
    }

    .btn-premium:hover {
        transform: translateY(-2px);
        box-shadow: 0 14px 32px rgba(13, 148, 136, 0.45), 0 6px 16px rgba(16, 185, 129, 0.3);
        background: linear-gradient(135deg, #0F766E 0%, #059669 50%, #0D9488 100%);
    }

    .btn-premium:active {
        transform: translateY(0);
        box-shadow: 0 6px 16px rgba(13, 148, 136, 0.35);
    }

    .btn-premium::before {
        content: "";
        position: absolute;
        inset: -1px;
        border-radius: inherit;
        background: radial-gradient(circle at top left, rgba(52, 211, 153, 0.4), transparent 60%),
            radial-gradient(circle at bottom right, rgba(13, 148, 136, 0.4), transparent 60%);
        opacity: 0;
        z-index: -1;
        transition: opacity var(--transition-normal);
    }


    /* Tool Toggle Buttons */
    .btn-toggle-active {
        @apply px-5 py-3 rounded-xl font-semibold text-white;
        background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
        box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
        transition: all 0.2s ease;
        border: 1px solid transparent;
    }

    .btn-toggle-inactive {
        @apply px-5 py-3 rounded-xl font-medium;
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        color: var(--color-text-medium);
        transition: all 0.2s ease;
    }

    .btn-toggle-inactive:hover {
        border-color: var(--color-primary);
        color: var(--color-primary);
        background: var(--color-primary-soft);
    }

    /* Tool Secondary Button */
    .btn-tool-secondary {
        @apply px-5 py-2.5 rounded-xl font-medium;
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        color: var(--color-text-medium);
        transition: all 0.2s ease;
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    }

    .btn-tool-secondary:hover {
        border-color: var(--color-primary);
        color: var(--color-primary);
        transform: translateY(-1px);
        box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
    }

    /* Result Display */
    .tool-result-box {
        @apply rounded-xl p-4 md:p-5 text-sm leading-relaxed;
        background: var(--color-bg);
        border: 1px solid var(--color-border);
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .tool-result-value {
        @apply text-3xl md:text-4xl font-bold;
        background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .tool-result-label {
        @apply text-sm font-semibold text-[var(--color-text-medium)] mb-2;
    }

    /* Chips */
    .tool-chip {
        @apply inline-flex items-center gap-1.5 px-3 py-1 rounded-full text-xs font-semibold;
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        color: var(--color-text-medium);
        transition: all 0.15s ease;
    }

    .tool-quick-chip {
        @apply inline-flex items-center px-3 py-1.5 rounded-full text-xs font-semibold cursor-pointer;
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        color: var(--color-text-medium);
        transition: all 0.15s ease;
    }

    .tool-quick-chip:hover {
        border-color: var(--color-primary);
        color: var(--color-primary);
        background: var(--color-primary-soft);
        transform: translateY(-1px);
    }

    /* Help & Error Text */
    .tool-help-text {
        @apply text-xs mt-1.5;
        color: var(--color-text-light);
    }

    .tool-error-text {
        @apply text-sm px-4 py-3 rounded-xl;
        background: rgba(231, 76, 60, 0.08);
        border: 1px solid rgba(231, 76, 60, 0.2);
        color: var(--color-error);
        font-weight: 500;
    }

    /* Result Panel */
    .result-panel {
        @apply sticky top-24;
    }

    .result-badge {
        @apply inline-flex px-3 py-1 rounded-full text-xs font-semibold;
        background: var(--color-primary-soft);
        color: var(--color-primary);
    }

    .result-placeholder {
        @apply rounded-xl p-6 text-center;
        background: var(--color-bg);
        border: 1px dashed var(--color-border);
    }

    .result-placeholder-title {
        @apply text-lg font-semibold text-[var(--color-text-dark)] mb-2;
    }

    /* Tool Input Enhancements */
    .tool-input,
    .tool-select {
        @apply w-full px-4 py-3 rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] text-[var(--color-text-dark)];
        transition: all 0.2s ease;
    }

    .tool-input:focus,
    .tool-select:focus {
        @apply ring-2 ring-[var(--color-primary)] border-transparent;
        box-shadow: 0 0 0 3px var(--color-primary-soft);
    }
}

/* ═══════════════════════════════════════════════════════════
   HERO SECTION – Light Gradient
   ═══════════════════════════════════════════════════════════ */

/* Hero title – word-by-word slide-in */
@keyframes heroTitleSlideIn {
    0%   { opacity: 0; transform: translateY(24px); }
    100% { opacity: 1; transform: translateY(0); }
}

.hero-title-word {
    opacity: 0;
    color: #ffffff;
    animation: heroTitleSlideIn 0.7s ease-out forwards;
    will-change: transform, opacity;
}

.hero-title-gradient {
    opacity: 0;
    display: inline-block;
    background: linear-gradient(135deg, #ffffff 0%, #a5f3fc 40%, #c4b5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: heroTitleSlideIn 0.7s ease-out forwards;
    will-change: transform, opacity;
}

/* Staggered delays — first line words, then second line words */
.hero-title-word:nth-child(1) { animation-delay: 0ms; }
.hero-title-word:nth-child(2) { animation-delay: 100ms; }
.hero-title-word:nth-child(3) { animation-delay: 200ms; }
.hero-title-gradient:nth-child(5) { animation-delay: 350ms; }
.hero-title-gradient:nth-child(6) { animation-delay: 450ms; }
.hero-title-gradient:nth-child(7) { animation-delay: 550ms; }

@media (prefers-reduced-motion: reduce) {
    .hero-title-word,
    .hero-title-gradient {
        opacity: 1;
        animation: none !important;
        -webkit-text-fill-color: #ffffff;
        background: none;
    }
}

/* Hero search bar */
.hero-search-bar {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}
.hero-search-bar:hover {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15), 0 8px 30px rgba(0, 0, 0, 0.15);
}

/* Hero info cards */
.hero-info-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.hero-info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

@keyframes toolTickerScroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@keyframes gradientXY {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes gradient-xy-transform {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(-10%, -10%);
        /* Subtle movement to simulate gradient shift */
    }
}

.animate-gradient-xy {
    background-size: 200% 200%;
    animation: gradientXY 15s ease infinite;
}

.animate-gradient-xy-transform {
    animation: gradient-xy-transform 15s ease infinite;
}

@media (prefers-reduced-motion: reduce) {

    .tool-ticker-track {
        animation: none !important;
        transform: none !important;
    }
}

@layer utilities {
    .text-gradient {
        @apply bg-gradient-to-r from-[var(--color-primary)] via-[var(--color-secondary)] to-[var(--color-accent)] bg-clip-text text-transparent;
    }

    .bg-gradient-primary {
        @apply bg-gradient-to-r from-[var(--color-primary)] to-[var(--color-secondary)];
    }

    .section-padding {
        @apply py-12 md:py-20;
    }

    .motion-fast {
        transition: all var(--transition-fast);
    }

    .motion-normal {
        transition: all var(--transition-normal);
    }

    .motion-none {
        transition: none !important;
    }

    .hover-lift {
        @apply transition-transform duration-200;
    }

    .hover-lift:hover {
        transform: translateY(-3px);
    }

    .hover-glow {
        @apply transition-shadow duration-200;
    }

    .hover-glow:hover {
        box-shadow: 0 18px 32px rgba(37, 99, 235, 0.18);
    }

    .fade-up {
        animation: fadeUp 0.6s ease both;
    }
}

/* Stats Counter Section */
.stats-item {
    transition: transform 0.3s ease;
}

.stats-item:hover {
    transform: translateY(-2px);
}

.stats-counter.counted {
    transition: none;
}

/* How It Works Section */
.how-it-works-step {
    transition: transform 0.3s ease;
}

.how-it-works-step:hover {
    transform: translateY(-4px);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary-hover);
}

/* Loading animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading {
    animation: spin 1s linear infinite;
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

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

.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

.dark .surface-glass {
    background: rgba(45, 55, 72, 0.72);
    border-color: rgba(148, 163, 184, 0.2);
}


/* ===== Tools Hero Section Premium Styles ===== */

/* Floating Background Orbs */
.tools-hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.tools-hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: toolsOrbFloat 20s ease-in-out infinite;
}

.tools-hero-orb-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.tools-hero-orb-2 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, var(--color-accent), var(--color-primary));
    top: 50%;
    right: -80px;
    animation-delay: -7s;
    animation-duration: 25s;
}

.tools-hero-orb-3 {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, var(--color-secondary), var(--color-accent));
    bottom: -50px;
    left: 30%;
    animation-delay: -14s;
    animation-duration: 22s;
}

@keyframes toolsOrbFloat {

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

    25% {
        transform: translate(30px, -20px) scale(1.05);
    }

    50% {
        transform: translate(-20px, 30px) scale(0.95);
    }

    75% {
        transform: translate(-30px, -10px) scale(1.02);
    }
}

/* Enhanced Badge with Glow */
.tools-hero-badge-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.tools-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 1rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(80, 227, 194, 0.1));
    border: 1px solid rgba(37, 99, 235, 0.2);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.15), 0 0 40px rgba(80, 227, 194, 0.1);
    backdrop-filter: blur(8px);
    animation: toolsBadgePulse 3s ease-in-out infinite;
}

@keyframes toolsBadgePulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(37, 99, 235, 0.15), 0 0 40px rgba(80, 227, 194, 0.1);
    }

    50% {
        box-shadow: 0 0 30px rgba(37, 99, 235, 0.25), 0 0 60px rgba(80, 227, 194, 0.15);
    }
}

/* Animated Title */
.tools-hero-title {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--color-text-dark);
}

.tools-hero-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px) blur(4px);
    animation: toolsWordSlideIn 0.6s ease-out forwards;
    animation-delay: var(--word-delay, 0ms);
}

@keyframes toolsWordSlideIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
        filter: blur(4px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* Gradient Text Animation */
.tools-hero-gradient {
    background: linear-gradient(90deg,
            var(--color-primary) 0%,
            var(--color-secondary) 25%,
            var(--color-accent) 50%,
            var(--color-secondary) 75%,
            var(--color-primary) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: toolsWordSlideIn 0.6s ease-out forwards, toolsGradientShift 4s linear infinite;
    animation-delay: var(--word-delay, 0ms), 0.9s;
}

@keyframes toolsGradientShift {
    0% {
        background-position: 0% center;
    }

    100% {
        background-position: 200% center;
    }
}

@keyframes toolsHeroFadeUp {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Premium Stats Bar */
.tools-hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    max-width: 56rem;
    margin: 3rem auto 0;
    background: var(--color-surface);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06), 0 0 0 1px var(--color-border);
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: toolsHeroFadeUp 0.6s ease-out 0.7s forwards;
}

.tools-hero-stats::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.03), rgba(80, 227, 194, 0.03));
    pointer-events: none;
}

.tools-hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.tools-hero-stat:hover {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(80, 227, 194, 0.05));
    transform: translateY(-2px);
}

.tools-hero-stat-icon {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(37, 99, 235, 0.05));
    color: var(--color-primary);
    transition: all 0.3s ease;
}

.tools-hero-stat-icon-teal {
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.1), rgba(13, 148, 136, 0.05));
    color: #0D9488;
}

.tools-hero-stat-icon-purple {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(124, 58, 237, 0.05));
    color: #7C3AED;
}

.tools-hero-stat-icon-emerald {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
    color: #10B981;
}

.tools-hero-stat:hover .tools-hero-stat-icon {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.tools-hero-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
}

.tools-hero-stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-medium);
}

.tools-hero-stat-divider {
    display: none;
}

@media (max-width: 768px) {
    .tools-hero-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .tools-hero-stat-icon {
        width: 2rem;
        height: 2rem;
    }

    .tools-hero-stat-icon svg {
        width: 1rem;
        height: 1rem;
    }

    .tools-hero-stat-value {
        font-size: 1.5rem;
    }
}

/* ===== Coming Soon Section Premium Styles ===== */

.coming-soon-section {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    color: white;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Floating Background Orbs */
.coming-soon-orbs {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.coming-soon-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    animation: comingSoonOrbFloat 25s ease-in-out infinite;
}

.coming-soon-orb-1 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    top: -100px;
    left: -50px;
    animation-delay: 0s;
}

.coming-soon-orb-2 {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, #10b981, #06b6d4);
    bottom: -80px;
    right: 10%;
    animation-delay: -10s;
    animation-duration: 30s;
}

.coming-soon-orb-3 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    top: 50%;
    right: -60px;
    animation-delay: -5s;
    animation-duration: 22s;
}

@keyframes comingSoonOrbFloat {

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

    33% {
        transform: translate(40px, -30px) scale(1.1);
    }

    66% {
        transform: translate(-30px, 40px) scale(0.9);
    }
}

/* Icon Wrapper */
.coming-soon-icon-wrapper {
    width: 3.5rem;
    height: 3.5rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(12px);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .coming-soon-icon-wrapper {
        width: 4rem;
        height: 4rem;
    }
}

/* Badge */
.coming-soon-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    font-size: 0.75rem;
    font-weight: 600;
    color: #34d399;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Animated Title */
.coming-soon-title {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.coming-soon-word {
    display: inline-block;
    opacity: 0;
    color: #ffffff;
    animation: comingSoonWordSlide 0.5s ease-out forwards;
    animation-delay: var(--word-delay, 0ms);
}

@keyframes comingSoonWordSlide {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.coming-soon-gradient {
    background: linear-gradient(90deg, #60a5fa, #34d399, #a78bfa, #34d399, #60a5fa);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: comingSoonWordSlide 0.5s ease-out forwards, comingSoonGradientShift 5s linear infinite;
    animation-delay: var(--word-delay, 0ms), 0.7s;
}

@keyframes comingSoonGradientShift {
    0% {
        background-position: 0% center;
    }

    100% {
        background-position: 200% center;
    }
}

/* Tool Cards */
.coming-soon-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    opacity: 0;
    animation: comingSoonCardSlide 0.5s ease-out forwards;
    animation-delay: calc(0.4s + var(--card-delay, 0ms));
}

@keyframes comingSoonCardSlide {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.coming-soon-card:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.coming-soon-card-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.coming-soon-card-icon-blue {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(59, 130, 246, 0.1));
}

.coming-soon-card-icon-emerald {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(16, 185, 129, 0.1));
}

.coming-soon-card-icon-purple {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(139, 92, 246, 0.1));
}

.coming-soon-card-icon-amber {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(245, 158, 11, 0.1));
}

.coming-soon-card:hover .coming-soon-card-icon {
    transform: scale(1.1);
}

.coming-soon-card-content {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    flex: 1;
    min-width: 0;
}

.coming-soon-card-arrow {
    width: 1.25rem;
    height: 1.25rem;
    color: rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateX(-5px);
}

.coming-soon-card:hover .coming-soon-card-arrow {
    opacity: 1;
    transform: translateX(0);
    color: rgba(255, 255, 255, 0.6);
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .fade-in {
        animation: none !important;
    }

    .card-hover,
    .tool-card,
    .btn,
    .btn-primary,
    .btn-secondary,
    .btn-accent,
    .btn-outline,
    .pill-button {
        transition: none !important;
        transform: none !important;
    }

    .tools-hero-orb,
    .tools-hero-word,
    .tools-hero-gradient,
    .tools-hero-badge,
    .coming-soon-orb,
    .coming-soon-word,
    .coming-soon-gradient,
    .coming-soon-card {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
}

/* Bento: first featured tool card spans 2 cols */
@media (min-width: 1024px) {
    #featured-grid > a:first-child {
        grid-column: span 2;
    }
}
