/* Estilos para a página de Catálogos */

/* Seção de Catálogos */
.catalogs-section {
    padding: 50px 20px 50px;
    max-width: 1400px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 50px;
    position: relative;
}

.section-title:after {
    content: '';
    display: block;
    width: 100px;
    height: 4px;
    background: #e74c3c;
    margin: 15px auto 0;
}

.catalogs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.catalog-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.catalog-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.catalog-image {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    padding: 20px;
}

.catalog-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.catalog-card:hover .catalog-image img {
    transform: scale(1.05);
}

.catalog-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    border-top: 2px solid #eeecec;
}

.catalog-info h3 {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.catalog-info p {
    color: #7f8c8d;
    margin-bottom: 15px;
    flex-grow: 1;
}

.catalog-meta {
    display: flex;
    justify-content: space-between;
    color: #95a5a6;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.catalog-actions {
    display: flex;
    gap: 10px;
}

.view-btn, .download-btn {
    padding: 10px 15px;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
    flex: 1;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.view-btn {
    background: #3498db;
    color: white;
    border: 2px solid #3498db;
}

.view-btn:hover {
    background: #2980b9;
    border-color: #2980b9;
}

.download-btn {
    background: transparent;
    color: #3498db;
    border: 2px solid #3498db;
}

.download-btn:hover {
    background: #3498db;
    color: white;
}

/* Modal de Visualização */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    overflow: auto;
}

.modal-content {
    background: white;
    margin: 2% auto;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.modal-title {
    font-size: 1.5rem;
    color: #2c3e50;
    margin: 0;
    flex-grow: 1;
}

.close-modal {
    background: #e74c3c;
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    padding: 0;
    margin-left: 10px;
}

.close-modal:hover {
    background: #c0392b;
}

.pdf-container {
    flex: 1;
    overflow: auto;
    border: 1px solid #eee;
    background: white;
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    max-height: calc(80vh - 100px);
}

#pdf-viewer {
    max-width: 100%;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    margin: 10px 0;
    transition: transform 0.3s ease;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 15px;
}

.zoom-btn {
    background: #e0e0e0;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.zoom-btn:hover {
    background: #3498db;
    color: white;
}

.zoom-level {
    font-size: 0.9rem;
    min-width: 50px;
    text-align: center;
    font-weight: bold;
}

.pdf-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
    gap: 10px;
}

.page-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pdf-control-btn {
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: bold;
    white-space: nowrap;
}

#prev-page, #next-page {
    background: #3498db;
    color: white;
}

#prev-page:hover, #next-page:hover {
    background: #2980b9;
}

#download-pdf {
    background: #2ecc71;
    color: white;
}

#download-pdf:hover {
    background: #27ae60;
}

.pdf-control-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

.page-info {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.pdf-fallback {
    text-align: center;
    padding: 40px 20px;
}

.pdf-fallback a {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    background: #e74c3c;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.3s;
}

.pdf-fallback a:hover {
    background: #c0392b;
}

/* Responsividade */
@media (max-width: 768px) {
 
    .section-title {
        font-size: 2rem;
    }
    
    .catalogs-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .modal-content {
        width: 95%;
        margin: 10px auto;
        padding: 15px;
    }
    
    .modal-header {
        flex-wrap: wrap;
    }
    
    .zoom-controls {
        order: 1;
        width: 100%;
        justify-content: center;
        margin: 10px 0 0 0;
    }
    
    .pdf-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .page-controls {
        justify-content: center;
    }
    
    .pdf-controls > div:last-child {
        display: flex;
        justify-content: center;
    }
    
    #download-pdf {
        width: auto;
        padding: 8px 20px;
    }
}

@media (max-width: 480px) {
    .catalog-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .view-btn {
        width: 100%;
        padding: 12px 15px;
        flex: none;
    }
    
    .download-btn {
        width: 90%;
        padding: 12px 15px;
        flex: none;
    }
    
    .pdf-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .page-controls {
        order: 1;
        width: 100%;
        justify-content: center;
    }
    
    .page-info {
        text-align: center;
        width: 100%;
    }
    
    .pdf-controls > div:last-child {
        order: 2;
        width: 100%;
        display: flex;
        justify-content: center;
    }
    
    .close-modal {
        margin-left: 0;
    }
    
    #download-pdf {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}