/*
     portfolio-modern.css — Estilos modernos para seção de portfólio/áreas de atuação.
     Referência: app/Views/layouts/header.php
*/
/* ==========================================
    PORTFOLIO SECTION - DESIGN MODERNO
    ========================================== */

:root {
    --construction-gradient: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    --infrastructure-gradient: linear-gradient(135deg, #059669 0%, #047857 100%);
    --card-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 30px 60px rgba(0, 0, 0, 0.12);
}

/* ===== SECTION ===== */
.portfolio-section {
    padding: 80px 20px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    overflow: hidden;
}

.portfolio-section .container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ===== HEADER ===== */
.portfolio-header {
    text-align: center;
    margin-bottom: 60px;
    animation: fadeInDown 0.6s ease;
}

.portfolio-header .section-title {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.portfolio-header .section-subtitle {
    font-size: 18px;
    color: #64748b;
    font-weight: 500;
    max-width: 500px;
    margin: 0 auto;
}

/* ===== GRID ===== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 32px;
    margin-top: 40px;
}

@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* ===== CARD BASE ===== */
.category-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 380px;
    padding: 48px 40px;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: var(--card-shadow);
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.320, 1);
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

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

/* ===== GRADIENT BACKGROUND ===== */
.card-bg-gradient {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.category-card.construction .card-bg-gradient {
    background: var(--construction-gradient);
}

.category-card.infrastructure .card-bg-gradient {
    background: var(--infrastructure-gradient);
}

.category-card:hover .card-bg-gradient {
    opacity: 1;
}

/* ===== ICON WRAPPER ===== */
.card-icon-wrapper {
    position: relative;
    z-index: 2;
    margin-bottom: 32px;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.4s ease;
}

.category-card.construction .card-icon-wrapper {
    background: rgba(30, 64, 175, 0.1);
}

.category-card.infrastructure .card-icon-wrapper {
    background: rgba(5, 150, 105, 0.1);
}

.category-card:hover .card-icon-wrapper {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1) rotate(5deg);
}

.category-icon {
    width: 48px;
    height: 48px;
    transition: all 0.4s ease;
}

.category-card.construction .category-icon {
    color: #1e40af;
}

.category-card.infrastructure .category-icon {
    color: #059669;
}

.category-card:hover .category-icon {
    color: #ffffff;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

/* ===== CONTENT ===== */
.category-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.category-content h3 {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    transition: color 0.4s ease;
    letter-spacing: -0.01em;
}

.category-content h3 span {
    display: block;
    font-weight: 800;
    margin-top: 4px;
}

.category-card.construction .category-content h3 span {
    color: #1e40af;
}

.category-card.infrastructure .category-content h3 span {
    color: #059669;
}

.category-card:hover .category-content h3 {
    color: #ffffff;
}

.category-content p {
    font-size: 16px;
    color: #64748b;
    margin: 0;
    line-height: 1.6;
    transition: color 0.4s ease;
}

.category-card:hover .category-content p {
    color: rgba(255, 255, 255, 0.9);
}

/* ===== ARROW ===== */
.card-arrow {
    display: inline-block;
    font-size: 20px;
    font-weight: 600;
    margin-top: 16px;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.320, 1);
    width: fit-content;
}

.category-card.construction .card-arrow {
    color: #1e40af;
}

.category-card.infrastructure .card-arrow {
    color: #059669;
}

.category-card:hover .card-arrow {
    color: #ffffff;
    transform: translateX(8px);
}

/* ===== DECORATIVE ELEMENTS ===== */
.category-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.category-card.construction::before {
    background: radial-gradient(circle, rgba(30, 64, 175, 0.2) 0%, transparent 70%);
}

.category-card.infrastructure::before {
    background: radial-gradient(circle, rgba(5, 150, 105, 0.2) 0%, transparent 70%);
}

.category-card:hover::before {
    opacity: 1;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

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

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

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

.category-grid .category-card:nth-child(1) {
    animation: slideInUp 0.6s ease 0.1s both;
}

.category-grid .category-card:nth-child(2) {
    animation: slideInUp 0.6s ease 0.2s both;
}

/* ===== ACCESSIBILITY ===== */
.category-card:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 4px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    .portfolio-section {
        padding: 60px 16px;
    }

    .category-card {
        padding: 32px 24px;
        min-height: 340px;
    }

    .card-icon-wrapper {
        width: 64px;
        height: 64px;
    }

    .category-icon {
        width: 36px;
        height: 36px;
    }

    .category-content h3 {
        font-size: 20px;
    }

    .portfolio-header .section-title {
        margin-bottom: 12px;
    }
}

/* ===== HOVER STATE REFINEMENT ===== */
@media (hover: hover) {
    .category-card {
        cursor: pointer;
    }

    .category-card:hover {
        background: transparent;
    }
}

/* ===== DARK MODE SUPPORT (OPCIONAL) ===== */
@media (prefers-color-scheme: dark) {
    .portfolio-section {
        background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    }

    .category-card {
        background: #1e293b;
        border-color: rgba(255, 255, 255, 0.1);
    }

    .portfolio-header .section-title {
        color: #f1f5f9;
    }

    .portfolio-header .section-subtitle {
        color: #cbd5e1;
    }

    .category-content h3 {
        color: #f1f5f9;
    }

    .category-content p {
        color: #cbd5e1;
    }
}