/* ============================================================
   PROJETOS.CSS - Lista de Projetos
   ============================================================ */

.projetos-section {
    padding: 2rem 1.5rem;
    min-height: 80vh;
    background: var(--color-forest-deep);
    position: relative;
    overflow: hidden;
}

/* Imagem de fundo */
.projetos-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://images.unsplash.com/photo-1542601906990-b4d3fb778b09?auto=format&fit=crop&q=80&w=2000') no-repeat center center/cover;
    opacity: 0.15;
    z-index: 0;
}

/* Overlay escuro */
.projetos-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(6, 44, 33, 0.7);
    z-index: 1;
}

.projetos-section .container {
    max-width: var(--container-width);
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* Flash messages no container */
.projetos-section .flash-sucesso,
.projetos-section .flash-erro,
.projetos-section .flash-aviso {
    position: relative;
    z-index: 2;
    max-width: var(--container-width);
    margin: 0 auto 1rem auto;
}

/* Cabeçalho */
.projetos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.projetos-header h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-white);
}

.projetos-header h1::before {
    display: none;
}

.projetos-actions {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

/* Filtros */
.projetos-filtros {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: end;
}

.projetos-filtros .form-group {
    margin-bottom: 0;
}

.projetos-filtros .form-group label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-main);
    display: block;
    margin-bottom: 0.3rem;
}

.projetos-filtros .form-control {
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-slate-200);
    border-radius: 6px;
    font-size: 0.85rem;
    min-width: 150px;
    background: var(--color-white);
}

.projetos-filtros .btn {
    padding: 0.5rem 1.5rem;
    font-size: 0.85rem;
}

/* Grid de Projetos */
.projetos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Card de Projeto */
.projeto-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition-smooth);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.projeto-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.projeto-card-img {
    height: 180px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.projeto-card-img .projeto-status {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.projeto-status-ativo {
    background: #10b981;
    color: white;
}

.projeto-status-planejamento {
    background: #f59e0b;
    color: white;
}

.projeto-status-finalizado {
    background: #6c757d;
    color: white;
}

.projeto-card-body {
    padding: 1.5rem;
}

.projeto-card-body h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--color-text-headings);
}

.projeto-card-body h3 a {
    color: var(--color-text-headings);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.projeto-card-body h3 a:hover {
    color: var(--color-impact-green);
}

.projeto-card-body p {
    font-size: 0.9rem;
    color: var(--color-text-main);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.projeto-card-body .projeto-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--color-text-main);
    margin-bottom: 1rem;
}

.projeto-card-body .projeto-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.projeto-card-body .projeto-meta i {
    color: var(--color-impact-green);
}

/* Progress Bar no card */
.projeto-card-body .progress-bar {
    background: var(--color-slate-200);
    height: 6px;
    border-radius: 10px;
    margin: 0.5rem 0;
    overflow: hidden;
}

.projeto-card-body .progress-fill {
    background: linear-gradient(90deg, var(--color-impact-green), #34d399);
    height: 100%;
    border-radius: 10px;
    transition: width 1s ease;
}

.projeto-card-body .progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 600;
}

.projeto-card-body .progress-info .percent {
    color: var(--color-impact-green);
}

.projeto-card-body .projeto-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.projeto-card-body .projeto-actions .btn {
    font-size: 0.75rem;
    padding: 0.4rem 1rem;
}

/* Botão Participar */
.btn-participar {
    background: var(--color-impact-green);
    color: white !important;
}

.btn-participar:hover {
    background: var(--color-forest-accent);
}

.btn-participar:disabled {
    background: var(--color-slate-200);
    color: #999 !important;
    cursor: not-allowed;
}

.badge-participando {
    background: #d4edda;
    color: #155724;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.badge-pendente {
    background: #fff3cd;
    color: #856404;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

/* Sem projetos */
.sem-projetos {
    text-align: center;
    padding: 4rem 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sem-projetos i {
    font-size: 3rem;
    color: var(--color-slate-200);
    margin-bottom: 1rem;
}

.sem-projetos h3 {
    font-family: 'Montserrat', sans-serif;
    color: var(--color-text-headings);
    margin-bottom: 0.5rem;
}

.sem-projetos p {
    color: var(--color-text-main);
}

/* ============================================================
   RESPONSIVIDADE
   ============================================================ */

@media (max-width: 768px) {
    .projetos-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .projetos-actions {
        width: 100%;
    }
    
    .projetos-actions .btn {
        flex: 1;
        justify-content: center;
    }
    
    .projetos-grid {
        grid-template-columns: 1fr;
    }
    
    .projetos-filtros {
        flex-direction: column;
    }
    
    .projetos-filtros .form-group {
        width: 100%;
    }
    
    .projetos-filtros .form-control {
        min-width: auto;
        width: 100%;
    }
    
    .projetos-filtros .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .projetos-section {
        padding: 1rem 0.8rem;
    }
    
    .projeto-card-img {
        height: 140px;
    }
}
/* ============================================================
   PROJETOS.CSS - Participantes
   ============================================================ */

/* Badge Você */
.badge-participando {
    background: #d4edda;
    color: #155724;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 600;
    display: inline-block;
    margin-left: 0.3rem;
}

/* Fundo do título do projeto */
.projetos-section .projeto-titulo-box {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.projetos-section .projeto-titulo-box h2 {
    color: white;
    font-size: 1.2rem;
    margin: 0;
}

.projetos-section .projeto-titulo-box h2::before {
    display: none;
}

.projetos-section .projeto-titulo-box i {
    color: var(--color-impact-green);
    margin-right: 0.5rem;
}
/* ---------------------------------------------------------------------------
   Seções "Em andamento" / "Encerrados" e cards alinhados
   ------------------------------------------------------------------------ */
.projetos-filtros--compacto { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem 1.5rem; }
.projetos-filtros--compacto .form-group { margin: 0; min-width: 160px; }
.filtro-check { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; cursor: pointer; padding: .55rem 0; }
.filtro-check input { width: 1.1rem; height: 1.1rem; accent-color: var(--rw-verde, #059669); }
.projetos-secao { margin-top: 2rem; }
.projetos-secao__titulo { display: flex; align-items: baseline; flex-wrap: wrap; gap: .4rem .75rem; font-size: 1.3rem; margin: 0 0 1rem; color: var(--rw-titulo, #0f172a); }
.projetos-secao__titulo small { font-size: .85rem; font-weight: 400; color: var(--rw-texto-suave, #64748b); }
.projetos-vazio { padding: 1.25rem; border: 1px dashed var(--rw-borda, #e2e8f0); border-radius: 10px; color: var(--rw-texto-suave, #64748b); background: var(--rw-superficie, #fff); }

.projetos-grid { align-items: stretch; }
.projeto-card { display: flex; flex-direction: column; height: 100%; }
.projeto-card-img { display: block; }
.projeto-card-body { display: flex; flex-direction: column; flex: 1; }
.projeto-card-resumo {
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
    min-height: calc(1.5em * 3); line-height: 1.5;
}
.projeto-card-info { display: grid; gap: .3rem; margin: .5rem 0 0; padding: .6rem 0 0; border-top: 1px dashed var(--rw-borda, #e5e7eb); font-size: .82rem; color: var(--rw-texto-suave, #6b7280); }
.projeto-card-info div { display: grid; grid-template-columns: 1.1rem 1fr; gap: .4rem; align-items: start; }
.projeto-card-info dt { color: var(--color-impact-green, #10b981); }
.projeto-card-info dd { margin: 0; overflow-wrap: anywhere; }
/* A área de metas tem altura fixa: os botões ficam sempre na mesma linha */
.projeto-card-metas { min-height: 3.6rem; margin-top: .75rem; display: flex; flex-direction: column; justify-content: center; }
.projeto-card-metas .progress-bar { margin: 0; }
.projeto-card-valor { margin: .1rem 0; font-size: .88rem; }
.rw-sem-dados { margin: 0; font-size: .85rem; font-style: italic; color: var(--rw-texto-suave, #64748b); }
.projeto-card .projeto-actions { margin-top: auto; padding-top: .9rem; }
.projeto-status-antigo { background: #475569; color: #fff; }
.badge-info { background: #dbeafe; color: #1e40af; padding: .3rem .8rem; border-radius: 20px; font-size: .75rem; font-weight: 600; display: inline-flex; align-items: center; gap: .3rem; }
.ranking-turma { white-space: nowrap; }

/* ---------------------------------------------------------------------------
   Card de projeto v2: chips de informação + destaque de meta / arrecadado
   ------------------------------------------------------------------------ */
.projeto-card { background: var(--rw-superficie, #fff); border: 1px solid var(--rw-borda, #e2e8f0); box-shadow: 0 1px 2px rgba(15,23,42,.05), 0 8px 24px rgba(15,23,42,.08); }
.projeto-card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(15,23,42,.06), 0 14px 32px rgba(15,23,42,.12); }
.projeto-card-img { height: 168px; }
.projeto-card-img--padrao { display: flex; align-items: flex-end; }
.projeto-card-img__ano {
    margin: 0 0 .9rem 1.1rem; font: 800 2.6rem/1 'Space Grotesk', 'Inter', sans-serif; letter-spacing: -.02em;
    color: rgba(255,255,255,.92); text-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.projeto-card-img .projeto-status { top: .85rem; right: .85rem; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.projeto-card-body { padding: 1.15rem 1.25rem 1.25rem; gap: .7rem; }
.projeto-card-body h3 { margin: 0; font-size: 1.15rem; line-height: 1.3; }
.projeto-card-body p.projeto-card-resumo { margin: 0; font-size: .88rem; color: var(--rw-texto-suave, #64748b); -webkit-line-clamp: 2; min-height: calc(1.5em * 2); }

.projeto-card-chips { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; padding: 0; }
.projeto-card-chips li {
    display: inline-flex; align-items: center; gap: .35rem; padding: .22rem .6rem; border-radius: 999px;
    background: var(--rw-superficie-2, #f1f5f3); color: var(--rw-texto, #334155); font-size: .76rem; font-weight: 500; line-height: 1.4;
}
.projeto-card-chips i { color: var(--rw-verde, #059669); font-size: .72rem; }

.projeto-card-numeros {
    margin-top: auto; padding: .85rem; border-radius: 12px; min-height: 6.4rem;
    background: var(--rw-verde-fundo, #ecfdf5); border: 1px solid rgba(5,150,105,.12);
    display: flex; flex-direction: column; justify-content: center; gap: .65rem;
}
.projeto-card-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: .6rem; }
.projeto-stat { display: grid; gap: .15rem; padding: .5rem .65rem; border-radius: 9px; background: var(--rw-superficie, #fff); }
.projeto-stat__rotulo { font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--rw-texto-suave, #64748b); }
.projeto-stat__valor { font: 700 1.2rem/1.15 'Space Grotesk', 'Inter', sans-serif; color: var(--rw-titulo, #0f172a); font-variant-numeric: tabular-nums; white-space: nowrap; }
.projeto-stat--destaque .projeto-stat__valor { color: var(--rw-verde, #059669); }
.projeto-card-progresso { display: flex; align-items: center; gap: .6rem; }
.projeto-card-progresso .progress-bar { flex: 1; height: 8px !important; margin: 0 !important; background: rgba(5,150,105,.15) !important; }
.projeto-card-percent { font: 700 .9rem/1 'Space Grotesk', 'Inter', sans-serif; color: var(--rw-verde, #059669); min-width: 2.8rem; text-align: right; }
.projeto-card-numeros .rw-sem-dados { text-align: center; display: flex; align-items: center; justify-content: center; gap: .4rem; }
.projeto-card-body p.projeto-card-inst { margin: 0; font-size: .78rem; color: var(--rw-texto-suave, #64748b); -webkit-line-clamp: 1; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.projeto-card-inst i { color: var(--rw-verde, #059669); margin-right: .25rem; }
.projeto-card .projeto-actions { padding-top: .2rem; border-top: 0; }
.projeto-card--antigo .projeto-card-numeros { background: #f1f5f4; border-color: var(--rw-borda, #e2e8f0); }
html[data-tema="escuro"] .projeto-card--antigo .projeto-card-numeros { background: var(--rw-superficie-2); }
html[data-tema="escuro"] .projeto-card-numeros { border-color: var(--rw-borda); }
/* Etiquetas numa linha só: a caixa de números fica na mesma altura em todos os cards */
.projeto-card-chips { flex-wrap: nowrap; overflow: hidden; mask-image: linear-gradient(90deg, #000 85%, transparent); }
.projeto-card-chips li { white-space: nowrap; flex-shrink: 0; }
/* Seções de projetos dentro da página inicial */
.lp-projetos-lista .projetos-secao:first-child { margin-top: 0; }
.lp-projetos-lista .projetos-secao__titulo { font-size: 1.15rem; }
.projetos-ver-todos { margin: 1.25rem 0 0; text-align: center; }
/* Na página /projetos os títulos podem cair em cima da faixa escura ou do fundo
   claro (depende da altura da tela). Ganham uma etiqueta com fundo próprio, então
   o contraste é o mesmo nos dois casos. */
.projetos-section .projetos-secao__titulo {
    display: inline-flex; padding: .45rem .95rem; border-radius: 10px;
    background: var(--rw-superficie, #fff); color: var(--rw-titulo, #0f172a);
    border: 1px solid var(--rw-borda, #e2e8f0); box-shadow: 0 2px 8px rgba(6, 44, 33, .12);
}
.projetos-section .projetos-secao__titulo i { color: var(--rw-verde, #059669); }
.projetos-section .projetos-secao__titulo small { color: var(--rw-texto-suave, #64748b); }
