/* --- Variáveis Globais e Reset --- */
:root {
    --primary-color: #5a67d8;
    --secondary-color: #4c51bf;
    --background-color: #f7fafc;
    --surface-color: #ffffff;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --border-color: #e2e8f0;
    --success-color: #38a169;
    --error-color: #e53e3e;
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-code: 'Roboto Mono', monospace;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 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);
    --border-radius: 8px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    background-color: var(--background-color);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Cabeçalho com Logo --- */
.site-header {
    background-color: var(--surface-color);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    height: 36px;
    width: auto;
}

.logo-link {
    display: flex;
    align-items: center;
}

.header-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    display: none; /* Escondido em telas menores */
}

.main-nav {
    display: flex;
    gap: 1.5rem;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.2s;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
}

.main-nav a:hover {
    color: var(--text-primary);
}

.main-nav a.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* --- Banner de Anúncio --- */
#ad-banner-container {
    background-color: #edf2f7;
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ad-banner {
    width: 100%;
    max-width: 728px;
    height: 90px;
    background-color: #e2e8f0;
    border: 1px solid #cbd5e0;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    border-radius: var(--border-radius);
}

.ad-banner p {
    color: var(--text-secondary);
    font-weight: 500;
}

/* --- Estrutura Principal --- */
main {
    padding: 2rem;
    max-width: 1280px;
    margin: 0 auto;
}

section {
    background-color: transparent;
    margin-bottom: 3rem;
    padding: 0;
    border: none;
    box-shadow: none;
}

h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    padding-bottom: 0.5rem;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* --- Seções de Conteúdo --- */
#intro p, .category-description p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 80ch;
}

.category-description {
    margin-bottom: 1.5rem;
}

.workflow {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--surface-color);
}

/* --- Cabeçalho da Seção de Ferramentas --- */
.tools-header {
    text-align: center;
    margin-bottom: 2rem;
}

.tools-header h2 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    border-bottom: none;
    display: block;
}

.tools-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* --- Filtros --- */
.filters {
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    background-color: var(--surface-color);
    padding: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    position: sticky;
    top: 69px; /* Altura do header */
    z-index: 90;
    box-shadow: var(--shadow-sm);
}

#search-input, #category-filter {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    flex-grow: 1;
    background-color: #f7fafc;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#search-input:focus, #category-filter:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(90, 103, 216, 0.3);
    background-color: var(--surface-color);
}

/* --- Grid de Ferramentas --- */
#tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

/* --- Card da Ferramenta (Redesenhado) --- */
.tool-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeIn 0.4s ease-out forwards;
}

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

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

.tool-card h3 {
    margin: 0 0 0.25rem;
}

.tool-card .category {
    font-family: var(--font-code);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.tool-card > p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.tool-card .pros-cons {
    margin-top: 1rem;
    font-size: 0.9rem;
}

.tool-card .pros ul, .tool-card .cons ul {
    list-style-type: none;
    padding-left: 0;
    margin: 0.5rem 0 1rem;
}

.tool-card .pros li, .tool-card .cons li {
    margin-bottom: 0.5rem;
    padding-left: 1.75rem;
    position: relative;
}

.tool-card .pros li::before {
    content: '✓';
    color: var(--success-color);
    position: absolute;
    left: 0.25rem;
    font-size: 1.2em;
}

.tool-card .cons li::before {
    content: '✗';
    color: var(--error-color);
    position: absolute;
    left: 0.25rem;
    font-size: 1.2em;
}

.tool-card .details {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tool-card .pricing, .tool-card .ideal-for {
    color: var(--text-secondary);
    display: block;
}

.tool-card a {
    display: inline-block;
    margin-left: 1rem;
    text-decoration: none;
    background-color: var(--primary-color);
    color: #fff;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    text-align: center;
    font-weight: 500;
    white-space: nowrap;
    transition: background-color 0.2s;
}

.tool-card a:hover {
    background-color: var(--secondary-color);
}

/* --- Rodapé --- */
footer {
    text-align: center;
    padding: 3rem 1rem;
    margin-top: 3rem;
    background-color: #e2e8f0;
    border-top: 1px solid #cbd5e0;
    color: var(--text-secondary);
}

/* --- Media Queries para Responsividade --- */
@media (min-width: 768px) {
    .header-subtitle {
        display: block;
    }
}

@media (max-width: 768px) {
    .site-header {
        padding: 1rem;
    }
    .header-content {
        justify-content: space-between;
    }
    .header-subtitle {
        display: none;
    }
    .main-nav {
        gap: 1rem;
    }
    main {
        padding: 1rem;
    }
    .filters {
        top: 69px; /* Altura do header mobile */
    }
}

@media (max-width: 480px) {
    #tools-grid {
        grid-template-columns: 1fr;
    }
    .tool-card .details {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .tool-card a {
        width: 100%;
        margin-left: 0;
    }
}
