/* ============================================
   FERRAMENTAS PAGE — O Novo Algoritmo
   ============================================ */

/* SECTION */
.tools-section {
    padding: 40px 0 60px;
}

.tools-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
}

.tools-subtitle {
    text-align: center;
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 550px;
    margin: 0 auto 48px;
}

/* GRID — pirâmide: 4 no topo, 2 por linha embaixo */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

/* Primeiros 4 cards: 1 por coluna */
.tools-grid .tool-card:nth-child(1),
.tools-grid .tool-card:nth-child(2),
.tools-grid .tool-card:nth-child(3),
.tools-grid .tool-card:nth-child(4) {
    grid-column: span 1;
}

/* Cards 5 em diante: 2 por linha */
.tools-grid .tool-card:nth-child(n+5) {
    grid-column: span 2;
}

/* Se sobrar 1 card sozinho na última linha, centraliza */
.tools-grid .tool-card:nth-child(n+5):last-child:nth-child(odd) {
    grid-column: 2 / 4;
}

/* CARD */
.tool-card {
    background: var(--dark-2);
    border: 1px solid var(--neon-border);
    border-radius: 20px;
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0, 212, 255, 0.15);
}

/* Featured card (destaque) */
.tool-featured {
    border-color: var(--cyan);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.12);
    background: linear-gradient(180deg, rgba(0, 212, 255, 0.06) 0%, var(--dark-2) 100%);
}

.tool-featured:hover {
    box-shadow: 0 12px 40px rgba(0, 212, 255, 0.25), 0 0 30px rgba(0, 212, 255, 0.12);
}

/* ICON */
.tool-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.tool-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
}

.tool-letter {
    font-size: 2rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* INFO */
.tool-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.tool-info h3 {
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
}

.tool-info p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.65;
    max-width: 320px;
}

/* BADGES */
.tool-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-download {
    background: rgba(46, 125, 50, 0.15);
    color: #4caf50;
    border: 1px solid rgba(46, 125, 50, 0.3);
}

.badge-access {
    background: rgba(33, 150, 243, 0.15);
    color: #42a5f5;
    border: 1px solid rgba(33, 150, 243, 0.3);
}

.badge-subscribe {
    background: rgba(255, 152, 0, 0.15);
    color: #ffa726;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

/* BUTTON */
.tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: 8px;
}

/* BACK LINK */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: var(--cyan);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .tools-grid .tool-card {
        grid-column: span 1 !important;
    }

    .tools-title {
        font-size: 1.6rem;
    }

    .tools-subtitle {
        font-size: 0.9rem;
        margin-bottom: 32px;
    }

    .tool-card {
        padding: 28px 22px;
    }
}

@media (max-width: 480px) {
    .tool-icon {
        width: 64px;
        height: 64px;
        border-radius: 16px;
    }

    .tool-letter {
        font-size: 1.6rem;
    }

    .tool-info h3 {
        font-size: 1.15rem;
    }
}
