/**
 * ============================================================================
 * FERRAMENTAS HUB - DESIGN SYSTEM v3.0 (Refatorado)
 * ============================================================================
 * Sistema de design unificado para todo o tema
 * Paleta profissional azul com accent verde
 *
 * @package FerramentasHub
 * @version 3.0
 *
 * FONTE ÚNICA DE VERDADE para todas as variáveis CSS do tema.
 * Nenhum outro arquivo deve definir :root com variáveis de cor/tema.
 * Outros arquivos (theme-colors.css, marketplace.css, header-new.css)
 * referenciam as variáveis definidas aqui.
 */

:root {
    /* ========================================
       CORES PRIMÁRIAS - Azul Profissional
       ======================================== */
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-300: #93c5fd;
    --primary-400: #60a5fa;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;     /* Principal */
    --primary-700: #1d4ed8;     /* Hover */
    --primary-800: #1e40af;
    --primary-900: #1e3a8a;

    /* ========================================
       CORES ACCENT - Verde Sucesso
       ======================================== */
    --accent-50: #ecfdf5;
    --accent-100: #d1fae5;
    --accent-200: #a7f3d0;
    --accent-300: #6ee7b7;
    --accent-400: #34d399;
    --accent-500: #10b981;      /* Principal */
    --accent-600: #059669;      /* Hover */
    --accent-700: #047857;
    --accent-800: #065f46;
    --accent-900: #064e3b;

    /* ========================================
       CORES NEUTRAS - Cinzas
       ======================================== */
    --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;
    --white: #ffffff;
    --black: #000000;

    /* ========================================
       CORES DE FEEDBACK
       ======================================== */
    --success-50: #ecfdf5;
    --success-500: #10b981;
    --success-600: #059669;

    --warning-50: #fffbeb;
    --warning-100: #fef3c7;
    --warning-500: #f59e0b;
    --warning-600: #d97706;

    --error-50: #fef2f2;
    --error-500: #ef4444;
    --error-600: #dc2626;

    --info-50: #eff6ff;
    --info-500: #3b82f6;
    --info-600: #2563eb;

    /* ========================================
       TIPOGRAFIA
       ======================================== */
    --font-sans: 'Lexend Deca', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

    /* Tamanhos */
    --text-xs: 0.75rem;      /* 12px */
    --text-sm: 0.875rem;     /* 14px */
    --text-base: 1rem;       /* 16px */
    --text-lg: 1.125rem;     /* 18px */
    --text-xl: 1.25rem;      /* 20px */
    --text-2xl: 1.5rem;      /* 24px */
    --text-3xl: 1.875rem;    /* 30px */
    --text-4xl: 2.25rem;     /* 36px */
    --text-5xl: 3rem;        /* 48px */
    --text-6xl: 3.75rem;     /* 60px */

    /* Line Heights */
    --leading-none: 1;
    --leading-tight: 1.15;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 2;

    /* Letter Spacing */
    --tracking-tighter: -0.05em;
    --tracking-tight: -0.025em;
    --tracking-normal: 0;
    --tracking-wide: 0.025em;
    --tracking-wider: 0.05em;

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

    /* ========================================
       ESPAÇAMENTO
       ======================================== */
    --space-0: 0;
    --space-1: 0.25rem;      /* 4px */
    --space-2: 0.5rem;       /* 8px */
    --space-3: 0.75rem;      /* 12px */
    --space-4: 1rem;         /* 16px */
    --space-5: 1.25rem;      /* 20px */
    --space-6: 1.5rem;       /* 24px */
    --space-8: 2rem;         /* 32px */
    --space-10: 2.5rem;      /* 40px */
    --space-12: 3rem;        /* 48px */
    --space-16: 4rem;        /* 64px */
    --space-20: 5rem;        /* 80px */
    --space-24: 6rem;        /* 96px */

    /* Seções */
    --section-spacing: 96px;
    --section-spacing-mobile: 64px;

    /* ========================================
       BORDAS E RAIOS
       ======================================== */
    --radius-none: 0;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    --radius-3xl: 24px;
    --radius-full: 9999px;

    /* Border Width */
    --border-0: 0;
    --border-1: 1px;
    --border-2: 2px;
    --border-4: 4px;

    /* ========================================
       SOMBRAS
       ======================================== */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Sombras coloridas */
    --shadow-primary: 0 4px 16px rgba(37, 99, 235, 0.25);
    --shadow-primary-lg: 0 8px 24px rgba(37, 99, 235, 0.3);
    --shadow-accent: 0 4px 16px rgba(16, 185, 129, 0.25);
    --shadow-accent-lg: 0 8px 24px rgba(16, 185, 129, 0.3);

    /* ========================================
       TRANSIÇÕES
       ======================================== */
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

    --duration-75: 75ms;
    --duration-100: 100ms;
    --duration-150: 150ms;
    --duration-200: 200ms;
    --duration-300: 300ms;
    --duration-500: 500ms;
    --duration-700: 700ms;
    --duration-1000: 1000ms;

    /* Shorthand */
    --transition-fast: all 0.15s var(--ease-out);
    --transition-base: all 0.25s var(--ease-in-out);
    --transition-slow: all 0.35s var(--ease-in-out);

    /* ========================================
       Z-INDEX
       ======================================== */
    --z-0: 0;
    --z-10: 10;
    --z-20: 20;
    --z-30: 30;
    --z-40: 40;
    --z-50: 50;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;

    /* ========================================
       BREAKPOINTS (para referência)
       ======================================== */
    /*
    --breakpoint-sm: 640px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 1024px;
    --breakpoint-xl: 1280px;
    --breakpoint-2xl: 1536px;
    */

    /* ========================================
       CONTAINER
       ======================================== */
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1200px;
    --container-2xl: 1440px;

    /* ========================================
       ALIASES SEMÂNTICOS
       Compatibilidade com theme-colors.css,
       marketplace.css e templates PHP.
       Todos mapeiam para as variáveis canônicas acima.
       ======================================== */

    /* Aliases de cor primária (usados por theme-colors.css e page-*.php) */
    --primary: #2563eb;              /* = --primary-600 */
    --primary-dark: #1e40af;         /* = --primary-800 */
    --primary-light: #60a5fa;        /* = --primary-400 */
    --primary-color: #2563eb;        /* Alias usado por marketplace.css */

    /* Aliases de cor secundária/accent */
    --secondary: #10b981;            /* = --accent-500 */
    --secondary-color: #10b981;      /* Alias usado por marketplace.css */
    --secondary-dark: #047857;       /* = --accent-700 */
    --accent: #10b981;               /* Alias curto para page-como-funciona.php */
    --accent-color: #f59e0b;         /* = --warning-500, usado em CTAs */
    --accent-light: #fbbf24;         /* Laranja claro */

    /* Aliases de texto e fundo (usados por marketplace.css) */
    --text-color: #1f2937;           /* = --gray-800 */
    --text-light: #6b7280;           /* = --gray-500 */
    --bg-color: #f9fafb;             /* = --gray-50 */
    --border-color: #e5e7eb;         /* = --gray-200 */

    /* Aliases de bordas, transições e fonte (usados por marketplace.css) */
    --radius: 12px;                  /* = --radius-lg */
    --transition: all 0.3s ease;
    --font-family: var(--font-sans); /* Alias para marketplace.css */

    /* Sombra com glow (usada por theme-colors.css) */
    --shadow-glow: 0 0 15px rgba(37, 99, 235, 0.3);

    /* Branding / Header (usadas por header-new.css) */
    --fh-orange: #f97316;
    --fh-orange-dark: #ea580c;
    --fh-warm-dark: #292524;
    --fh-warm-light: #fafaf9;
}

/* ============================================================================
   RESET & BASE STYLES
   ============================================================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--gray-800);
    background-color: var(--gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================================
   TIPOGRAFIA
   ============================================================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    font-weight: var(--font-bold);
    color: var(--gray-900);
    line-height: var(--leading-tight);
    margin: 0;
}

h1 { font-size: var(--text-5xl); letter-spacing: var(--tracking-tight); }
h2 { font-size: var(--text-4xl); letter-spacing: var(--tracking-tight); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
    margin: 0 0 var(--space-4);
    color: var(--gray-600);
}

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

a:hover {
    color: var(--primary-700);
}

/* ============================================================================
   COMPONENTES UTILITÁRIOS
   ============================================================================ */

/* Container */
.container {
    width: 100%;
    max-width: var(--container-xl);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-6);
    padding-right: var(--space-6);
}

/* Botões */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 0.625rem 1.5rem;
    font-family: var(--font-sans);
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    line-height: var(--leading-tight);
    text-decoration: none;
    border-radius: 6px;
    border: var(--border-2) solid transparent;
    cursor: pointer;
    transition: var(--transition-base);
}

.btn-primary {
    background-color: var(--primary-600);
    color: var(--white);
    padding: 0.75rem 1.75rem;
    border-radius: 6px;
}

.btn-primary:hover {
    background-color: var(--primary-700);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary);
}

.btn-secondary {
    background-color: var(--white);
    color: var(--gray-700);
    border-color: var(--gray-200);
    padding: 0.75rem 1.75rem;
    border-radius: 6px;
}

.btn-secondary:hover {
    background-color: var(--gray-50);
    border-color: var(--gray-300);
    color: var(--gray-900);
}

.btn-accent {
    background-color: var(--accent-500);
    color: var(--white);
}

.btn-accent:hover {
    background-color: var(--accent-600);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-accent);
}

.btn-lg {
    padding: 0.75rem 1.75rem;
    font-size: var(--text-lg);
    border-radius: 6px;
}

.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    border-radius: 6px;
}


/* ============================================================================
   BOTOES - Variantes e Ajustes (absorvido de buttons-custom.css - Etapa 5)
   ============================================================================ */

/* Fonte Lexend Deca para elementos nativos de formulario */
button,
input[type="submit"],
input[type="button"],
.wp-block-button__link {
    font-family: var(--font-sans);
}

/* Variante CTA */
.btn-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 0.75rem 2rem;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: var(--font-semibold);
    text-decoration: none;
    border-radius: 6px;
    border: var(--border-2) solid transparent;
    cursor: pointer;
    transition: var(--transition-base);
}

/* Variante XL */
.btn-xl {
    padding: 0.875rem 2rem;
    font-size: 1.0625rem;
    border-radius: 6px;
}

/* Variante Large */
.btn-large {
    padding: 0.75rem 1.75rem;
    font-size: 1rem;
    border-radius: 6px;
}

/* Botoes de Acao: Buy, Demo, Details, Marketplace */
.btn-buy,
.btn-demo,
.btn-marketplace {
    padding: 0.75rem 1.75rem;
    border-radius: 6px;
}

.btn-buy-modern,
.btn-demo-modern {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
}

.btn-details {
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
}

/* Botoes de Contexto */
.fhub-newsletter-button,
.sticky-bar-button {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-family: var(--font-sans);
}

/* Formularios WP e Gutenberg */
input[type="submit"],
input[type="button"],
.wp-block-button__link {
    padding: 0.75rem 1.75rem;
    border-radius: 6px;
}

/* Hero/CTA sections */
.hero-buttons .btn-cta,
.cta-buttons .btn-cta,
.hero-actions .btn-cta {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    height: auto;
    min-height: auto;
}

/* Icones dentro de botoes */
.btn i,
.btn-cta i,
.btn-primary i,
.btn-secondary i {
    font-size: 0.875rem;
}

/* Responsivo - Mobile (botoes) */
@media (max-width: 768px) {
    .btn-cta {
        padding: 0.625rem 1.5rem;
        font-size: 0.9375rem;
    }
    .btn-large,
    .btn-xl {
        padding: 0.625rem 1.5rem;
        font-size: 0.9375rem;
    }
}

@media (max-width: 480px) {
    .btn-cta {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
}

/* Cards */
.card {
    background-color: var(--white);
    border: var(--border-1) solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    transition: var(--transition-base);
}

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

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    border-radius: var(--radius-full);
}

.badge-primary {
    background-color: var(--primary-100);
    color: var(--primary-700);
}

.badge-accent {
    background-color: var(--accent-100);
    color: var(--accent-600);
}

.badge-warning {
    background-color: var(--warning-100);
    color: var(--warning-600);
}

/* ============================================================================
   FORMULÁRIOS
   ============================================================================ */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--gray-900);
    background-color: var(--white);
    border: var(--border-2) solid var(--gray-200);
    border-radius: 6px;
    transition: var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input::placeholder,
textarea::placeholder {
    color: var(--gray-400);
}

/* ============================================================================
   UTILITÁRIOS
   ============================================================================ */

/* Texto */
.text-primary { color: var(--primary-600); }
.text-accent { color: var(--accent-500); }
.text-gray-900 { color: var(--gray-900); }
.text-gray-700 { color: var(--gray-700); }
.text-gray-600 { color: var(--gray-600); }
.text-gray-500 { color: var(--gray-500); }
.text-white { color: var(--white); }

/* Background */
.bg-primary { background-color: var(--primary-600); }
.bg-primary-50 { background-color: var(--primary-50); }
.bg-accent { background-color: var(--accent-500); }
.bg-gray-50 { background-color: var(--gray-50); }
.bg-gray-100 { background-color: var(--gray-100); }
.bg-gray-900 { background-color: var(--gray-900); }
.bg-white { background-color: var(--white); }

/* Alinhamento */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Display */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.hidden { display: none; }

/* Flex utilities */
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.flex-col { flex-direction: column; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* ============================================================================
   HERANÇA CONTEXTUAL - Seções com fundo escuro
   ============================================================================
   Adicione a classe .dark-section a qualquer seção com background escuro
   (gradientes azuis, pretos, etc.) para que textos internos herdem cor branca
   automaticamente, SEM precisar de !important.
   ============================================================================ */

.dark-section {
    color: rgba(255, 255, 255, 0.9);
}

.dark-section h1,
.dark-section h2,
.dark-section h3,
.dark-section h4,
.dark-section h5,
.dark-section h6 {
    color: #ffffff;
}

.dark-section p,
.dark-section li,
.dark-section span,
.dark-section label {
    color: rgba(255, 255, 255, 0.9);
}

.dark-section a {
    color: #ffffff;
}

.dark-section a:hover {
    color: rgba(255, 255, 255, 0.8);
}

.dark-section .stat-item,
.dark-section .card {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.dark-section .stat-number,
.dark-section .stat-value {
    color: #ffffff;
}

.dark-section .stat-label {
    color: rgba(255, 255, 255, 0.7);
}

.dark-section .badge {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
}

.dark-section .btn-primary {
    background-color: #ffffff;
    color: var(--primary-600);
}

.dark-section .btn-primary:hover {
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--primary-700);
}

.dark-section .btn-secondary {
    background-color: transparent;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
}

.dark-section .btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}


/* ============================================================================
   THEMING - Cores primárias em elementos globais (absorvido de theme-colors.css - Etapa 6)
   ============================================================================ */

/* Seleção de texto */
::selection {
    background: var(--primary-600);
    color: var(--white);
}

::-moz-selection {
    background: var(--primary-600);
    color: var(--white);
}

/* Scrollbar customizada */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

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

/* Focus de formulários */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    border-color: var(--primary-600);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

/* Paginação */
.pagination .current,
.page-numbers.current {
    background: var(--primary-600);
    color: var(--white);
    border-color: var(--primary-600);
}

.pagination a:hover,
.page-numbers:hover {
    background: var(--primary-50);
    color: var(--primary-600);
    border-color: var(--primary-600);
}

/* Links de conteúdo */
.entry-content a,
.post-content a,
article a:not(.btn):not(.button) {
    color: var(--primary-600);
}

.entry-content a:hover,
.post-content a:hover,
article a:not(.btn):not(.button):hover {
    color: var(--primary-700);
}

/* Spinner / Loading */
.spinner,
.loading {
    border-top-color: var(--primary-600);
}

/* Progress bar */
.progress-bar,
.skill-bar-fill {
    background: linear-gradient(90deg, var(--primary-600) 0%, var(--accent-500) 100%);
}

/* ============================================================================
   MEDIA QUERIES
   ============================================================================ */

@media (max-width: 768px) {
    :root {
        --section-spacing: var(--section-spacing-mobile);
    }

    h1 { font-size: var(--text-4xl); }
    h2 { font-size: var(--text-3xl); }
    h3 { font-size: var(--text-xl); }

    .container {
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }
}

@media (max-width: 480px) {
    h1 { font-size: var(--text-3xl); }
    h2 { font-size: var(--text-2xl); }

    .container {
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }
}

/* ============================================================================
   ACESSIBILIDADE
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Focus visible */
:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
