/**
 * CSS para Atuação e Projetos
 * Estilos do modal, cards e layout
 */

/* Container principal */
.ap-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Barra de busca */
.ap-search-bar {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.ap-search-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 15px !important;
    align-items: center !important;
    justify-content: center !important;
}

.ap-filter-select,
.ap-filter-ano,
.ap-filter-categoria,
.ap-filter-autor {
    flex: 1 1 200px !important;
    min-width: 150px !important;
    max-width: 220px !important;
    padding: 12px 15px !important;
    border: 2px solid #e1e5e9 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    background: white !important;
    transition: all 0.3s ease !important;
}

.ap-search-input {
    flex: 2 1 250px !important;
    min-width: 200px !important;
    padding: 12px 15px !important;
    border: 2px solid #e1e5e9 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    transition: all 0.3s ease !important;
}

.ap-search-btn {
    flex: 0 0 auto !important;
    padding: 12px 25px !important;
    background: linear-gradient(135deg, #d63080 0%, #e6007d 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-transform: uppercase !important;
}

.ap-search-btn:hover {
    background: linear-gradient(135deg, #b8266b 0%, #c7006a 100%) !important;
    transform: translateY(-2px) !important;
}

/* Grid de projetos */
.ap-projetos-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 30px !important;
    margin-bottom: 30px !important;
    row-gap: 40px !important;
}

@media (max-width: 1024px) {
    .ap-projetos-grid { grid-template-columns: repeat(3, 1fr) !important; }
}

@media (max-width: 768px) {
    .ap-projetos-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .ap-search-row { 
        flex-direction: column !important;
        gap: 10px !important;
    }
    .ap-filter-select, .ap-filter-ano, .ap-filter-categoria, .ap-filter-autor, .ap-search-input { 
        width: 100% !important; 
        max-width: none !important;
        padding: 8px 10px !important;
        font-size: 12px !important;
        min-height: 38px !important;
        height: 38px !important;
    }
    
    .ap-search-bar {
        padding: 15px;
    }
    
    .ap-search-btn {
        padding: 8px 18px !important;
        font-size: 12px !important;
        min-height: 38px !important;
    }
}

@media (max-width: 480px) {
    .ap-projetos-grid { grid-template-columns: 1fr !important; }
    
    .ap-box-title {
        font-size: 0.95em;
    }
    
    .ap-box-info {
        padding: 14px 16px;
    }
    
    .ap-info-item {
        padding: 8px 10px;
    }
}

/* Box do projeto */
.ap-projeto-box {
    background: white;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 320px;
    overflow: hidden;
    border: 1px solid #f0f0f0;
}

.ap-projeto-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(214, 48, 128, 0.2);
    border-color: #d63080;
}

/* Header com Título e Ícone */
.ap-box-header {
    padding: 0;
    margin: 0;
}

.ap-box-title-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    background: linear-gradient(135deg, #d63080 0%, #e6007d 100%);
    box-shadow: 0 2px 8px rgba(214, 48, 128, 0.2);
}

.ap-box-title-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    backdrop-filter: blur(10px);
}

.ap-box-title-icon svg {
    width: 18px;
    height: 18px;
    color: white;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

.ap-box-title {
    margin: 0;
    padding: 0;
    color: white;
    font-size: 1.05em;
    font-weight: 700;
    line-height: 1.3;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    flex: 1;
}

/* Info Section */
.ap-box-info {
    padding: 16px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: linear-gradient(to bottom, #fafbfc 0%, #ffffff 100%);
}

.ap-info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.ap-info-item:hover {
    border-color: #d63080;
    box-shadow: 0 2px 6px rgba(214, 48, 128, 0.12);
}

.ap-info-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #d63080 0%, #e6007d 100%);
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(214, 48, 128, 0.25);
}

.ap-info-icon svg {
    width: 14px;
    height: 14px;
    color: white;
}

.ap-info-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    overflow: hidden;
}

.ap-info-label {
    font-size: 9px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.ap-info-value {
    font-size: 13px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

.ap-label {
    font-weight: 600;
    color: #666;
}

.ap-value {
    color: #333;
    font-weight: 500;
}

.ap-box-footer {
    text-align: center;
    padding: 15px 18px 18px;
    border-top: 1px solid #f0f0f0;
    background: white;
}

/* Botão LEIA MAIS */
.btn-leia-mais {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    background: linear-gradient(135deg, #d63080 0%, #e6007d 100%) !important;
    color: white !important;
    padding: 10px 24px !important;
    border-radius: 25px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    cursor: pointer !important;
    border: none !important;
    box-shadow: 0 3px 8px rgba(214, 48, 128, 0.3) !important;
    width: 100%;
}

.btn-leia-mais:hover {
    background: linear-gradient(135deg, #b8266b 0%, #c7006a 100%) !important;
    transform: translateY(-2px) !important;
    color: white !important;
    text-decoration: none !important;
    box-shadow: 0 5px 12px rgba(214, 48, 128, 0.4) !important;
}

.btn-leia-mais svg {
    width: 14px;
    height: 14px;
}

/* Modal Overlay - Fundo escuro */
#ap-modal-overlay {
    display: none;
    position: fixed !important;
    z-index: 9999 !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0,0,0,0.7) !important;
    backdrop-filter: blur(3px) !important;
    overflow-y: auto !important;
    padding: 20px 0 !important;
}

/* Caixa do modal */
#ap-modal-content {
    background: #fff !important;
    padding: 0 !important;
    width: 90% !important;
    max-width: 650px !important;
    max-height: 85vh !important;
    border-radius: 10px !important;
    position: relative !important;
    animation: apAparecer .3s ease !important;
    overflow-y: auto !important;
    margin: 50px auto !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
}

/* Animação de entrada */
@keyframes apAparecer {
    from { transform: translateY(-50%) scale(0.8); opacity: 0; }
    to   { transform: translateY(-50%) scale(1); opacity: 1; }
}

/* Botão X de fechar */
.ap-modal-close {
    position: absolute !important;
    right: 15px !important;
    top: 15px !important;
    font-size: 32px !important;
    cursor: pointer !important;
    background: none !important;
    border: none !important;
    color: rgba(255, 255, 255, 0.9) !important;
    padding: 0 !important;
    z-index: 10 !important;
    line-height: 1 !important;
    transition: all 0.3s ease !important;
}

.ap-modal-close:hover {
    color: white !important;
    transform: scale(1.1) !important;
}

/* Header do modal */
.ap-modal-header {
    padding: 0;
    border-bottom: none;
    background: white;
    border-radius: 10px 10px 0 0;
    position: relative;
    overflow: hidden;
}

/* Title Box com Ícone */
.ap-modal-title-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 60px 20px 25px;
    background: linear-gradient(135deg, #d63080 0%, #e6007d 100%) !important;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 4px 12px rgba(214, 48, 128, 0.3);
    position: relative;
}

.ap-modal-title-box::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.ap-title-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.ap-title-icon svg {
    width: 20px;
    height: 20px;
    color: white;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

.ap-modal-title {
    margin: 0;
    padding: 0;
    color: white !important;
    font-size: 1.25em;
    font-weight: 700;
    line-height: 1.4;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    letter-spacing: -0.2px;
    position: relative;
    z-index: 1;
}

/* Meta Section */
.ap-modal-meta {
    margin-top: 0;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
}

/* Grid de Cards com Ícones */
.ap-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.ap-meta-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border: 2px solid #f0f0f0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.ap-meta-card:hover {
    border-color: #d63080;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(214, 48, 128, 0.15);
}

.ap-meta-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #d63080 0%, #e6007d 100%);
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(214, 48, 128, 0.25);
}

.ap-meta-icon svg {
    width: 16px;
    height: 16px;
    color: white;
}

.ap-meta-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ap-meta-label {
    font-size: 10px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ap-meta-value {
    font-size: 14px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.2;
}

/* Autoria Box */
.ap-autoria-box {
    display: flex;
    gap: 15px;
    padding: 18px;
    background: linear-gradient(135deg, #fff5f9 0%, #ffffff 100%);
    border-left: 4px solid #d63080;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(214, 48, 128, 0.1);
}

.ap-autoria-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #d63080 0%, #e6007d 100%);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(214, 48, 128, 0.25);
}

.ap-autoria-icon svg {
    width: 14px;
    height: 14px;
    color: white;
}

.ap-autoria-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ap-autoria-label {
    font-size: 11px;
    font-weight: 700;
    color: #d63080;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ap-autoria-text {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: #555;
    font-style: italic;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Responsivo */
@media (max-width: 600px) {
    .ap-meta-grid {
        grid-template-columns: 1fr;
    }
    
    .ap-modal-title {
        font-size: 1.1em;
    }
    
    .ap-title-icon {
        width: 32px;
        height: 32px;
    }
    
    .ap-title-icon svg {
        width: 18px;
        height: 18px;
    }
}

/* Body do modal */
.ap-modal-body {
    padding: 20px 25px;
}

/* Informações do projeto */
.ap-modal-info {
    display: flex;
    flex-wrap: wrap;
    gap: 15px 30px;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 6px;
    justify-content: space-between;
}

.ap-modal-info-item {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
}

.ap-modal-info-label {
    display: block;
    font-weight: 600;
    color: #666;
    font-size: 10px;
    text-transform: uppercase;
    margin-bottom: 3px;
    letter-spacing: 0.5px;
}

.ap-modal-info-value {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    line-height: 1.2;
}

/* Texto do projeto */
.ap-modal-text h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #2c3e50;
    margin: 0 0 15px 0;
    font-size: 1.05em;
    font-weight: 700;
    padding: 12px 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 8px;
    border-left: 4px solid #d63080;
}

.ap-text-content {
    line-height: 1.7;
    color: #555;
    font-size: 14px;
    max-height: 280px;
    overflow-y: auto;
    padding: 18px 20px;
    background: #fafbfc;
    border-radius: 8px;
    border: 1px solid #e8eaed;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ap-text-content::-webkit-scrollbar {
    width: 8px;
}

.ap-text-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.ap-text-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #d63080 0%, #e6007d 100%);
    border-radius: 4px;
}

.ap-text-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #b8266b 0%, #c7006a 100%);
}

/* Loading */
.ap-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.ap-error {
    text-align: center;
    padding: 40px;
    color: #d63031;
}

/* No results */
.ap-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-style: italic;
}

/* ========================================
   RESUMO ESTATÍSTICO
======================================== */

.ap-resumo-estatistico {
    margin-bottom: 40px;
    background: linear-gradient(135deg, #ff00a8 0%, #ff1493 100%);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(255, 0, 168, 0.3);
}

.ap-stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
}

.ap-stat-box {
    background: white;
    border-radius: 10px;
    padding: 25px 15px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.ap-stat-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.ap-stat-number {
    font-size: 2.5em;
    font-weight: 700;
    color: #ff00a8;
    line-height: 1;
    margin-bottom: 10px;
}

.ap-stat-label {
    font-size: 0.85em;
    color: #666;
    font-weight: 500;
    line-height: 1.3;
}

.ap-stat-total {
    background: linear-gradient(135deg, #333 0%, #555 100%);
}

.ap-stat-total .ap-stat-number {
    color: white;
}

.ap-stat-total .ap-stat-label {
    color: #ddd;
    font-weight: 600;
}

/* Responsivo - Tablet */
@media (max-width: 1024px) {
    .ap-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Responsivo - Mobile */
@media (max-width: 768px) {
    .ap-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .ap-resumo-estatistico {
        padding: 20px;
    }
    
    .ap-stat-box {
        padding: 20px 10px;
    }
    
    .ap-stat-number {
        font-size: 2em;
    }
    
    .ap-stat-label {
        font-size: 0.75em;
    }
}

/* ========================================
   PAGINAÇÃO
======================================== */

.ap-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 40px 0 20px;
    flex-wrap: wrap;
}

.ap-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: white;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
    font-style: normal !important;
    text-decoration: none !important;
    transition: all 0.3s ease;
}

.ap-page-link:hover:not(.disabled):not(.ap-current) {
    background: #f8f9fa;
    border-color: #ff00a8;
    color: #ff00a8;
    transform: translateY(-2px);
    text-decoration: none !important;
}

.ap-page-link.ap-current {
    background: linear-gradient(135deg, #ff00a8 0%, #ff1493 100%);
    border-color: #ff00a8;
    color: white;
    cursor: default;
}

.ap-page-link.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.ap-page-link.ap-dots {
    border: none;
    background: transparent;
    cursor: default;
    min-width: 30px;
}

.ap-page-link.ap-prev,
.ap-page-link.ap-next {
    padding: 0 16px;
    font-weight: 600;
    color: #555 !important;
}

.ap-page-link.ap-prev:hover:not(.disabled),
.ap-page-link.ap-next:hover:not(.disabled) {
    color: #d63080 !important;
}

@media (max-width: 768px) {
    .ap-pagination {
        gap: 5px;
    }
    
    .ap-page-link {
        min-width: 35px;
        height: 35px;
        font-size: 13px;
    }
}
