/* Reset e base */
* {
    box-sizing: border-box;
}

/* Layout principal */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Seção de filtros */
.filters-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.filters-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.filter-group h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: #2C3E50;
    font-weight: 600;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-btn, .region-filter-btn {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #495057;
}

.filter-btn:hover, .region-filter-btn:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

.filter-btn.active, .region-filter-btn.active {
    background: #FF6B35;
    border-color: #FF6B35;
    color: white;
}

.badge {
    background: rgba(255,255,255,0.2);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.filter-btn.active .badge {
    background: rgba(255,255,255,0.3);
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    border-color: #FF6B35;
}

.search-input::placeholder {
    color: #999;
}

/* Header da galeria */
.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.gallery-title {
    font-size: 2rem;
    font-weight: 700;
    color: #2C3E50;
    margin: 0;
}

.view-controls {
    display: flex;
    gap: 0.5rem;
}

.view-btn {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.view-btn:hover {
    background: #e9ecef;
}

.view-btn.active {
    background: #FF6B35;
    border-color: #FF6B35;
    color: white;
}

/* Grid de materiais */
.materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
    align-items: start;
}

/* Cards dos materiais */
.material-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: fit-content;
}

.material-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Container da imagem com proporções específicas */
.material-image-container {
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
    width: 100%;
}

.material-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.material-card:hover .material-image {
    transform: scale(1.05);
}

/* Proporções específicas por formato */
.material-card[data-format="story"] .material-image-container {
    aspect-ratio: 9/16;
    max-height: 400px;
}

.material-card[data-format="post"] .material-image-container {
    aspect-ratio: 1/1;
    max-height: 300px;
}

.material-card[data-format="banner"] .material-image-container {
    aspect-ratio: 16/9;
    max-height: 200px;
}

.material-card[data-format="cartao"] .material-image-container {
    aspect-ratio: 4/3;
    max-height: 220px;
}

.material-card[data-format="template"] .material-image-container {
    aspect-ratio: 3/4;
    max-height: 350px;
}

/* Badge de formato */
.format-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 107, 53, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 2;
    backdrop-filter: blur(4px);
}

/* Informações do material */
.material-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 120px;
}

.material-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.material-description {
    font-size: 0.9rem;
    color: #6c757d;
    margin: 0 0 1rem 0;
    line-height: 1.4;
    flex: 1;
}

/* Informações do criador */
.creator-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-top: 1px solid #e9ecef;
    margin-top: auto;
}

.creator-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.creator-name {
    font-size: 0.85rem;
    color: #6c757d;
    flex: 1;
}

.creator-link {
    color: #ff6b35;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}

.creator-link:hover {
    text-decoration: underline;
}

/* Ações do material */
.material-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0 1.5rem 1.5rem;
}

.action-btn {
    flex: 1;
    padding: 0.6rem 0.75rem;
    border: 1px solid #e9ecef;
    background: white;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-height: 36px;
}

.action-btn:hover {
    background: #f8f9fa;
    border-color: #ff6b35;
    color: #ff6b35;
    transform: translateY(-1px);
}

.download-btn:hover {
    background: #e3f2fd;
    border-color: #2196f3;
    color: #2196f3;
}

.share-btn:hover {
    background: #f3e5f5;
    border-color: #9c27b0;
    color: #9c27b0;
}

.favorite-btn:hover {
    background: #ffebee;
    border-color: #f44336;
    color: #f44336;
}

/* Botão carregar mais */
.load-more-btn {
    display: block;
    margin: 2rem auto;
    padding: 1rem 2rem;
    background: #ff6b35;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.load-more-btn:hover {
    background: #e55a2b;
    transform: translateY(-2px);
}

/* Análise dos materiais */
.analysis-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-top: 3rem;
}

.analysis-section h2 {
    color: #2c3e50;
    margin-bottom: 2rem;
    font-size: 1.8rem;
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.analysis-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #ff6b35;
}

.analysis-card h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.analysis-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.analysis-card li {
    padding: 0.5rem 0;
    color: #495057;
    border-bottom: 1px solid #e9ecef;
}

.analysis-card li:last-child {
    border-bottom: none;
}

/* Responsividade */
@media (max-width: 768px) {
    .filters-row {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .materials-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
        padding: 1.5rem 0;
    }
    
    .gallery-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .material-info {
        padding: 1.25rem;
        min-height: 100px;
    }
    
    .material-actions {
        padding: 0 1.25rem 1.25rem;
    }
    
    .action-btn {
        padding: 0.5rem 0.6rem;
        font-size: 0.75rem;
        min-height: 32px;
    }
}

@media (max-width: 480px) {
    .materials-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem 0;
    }
    
    .material-actions {
        flex-direction: column;
        gap: 0.4rem;
    }
    
    .action-btn {
        padding: 0.7rem;
        font-size: 0.8rem;
        min-height: 40px;
    }
    
    .filters-section {
        padding: 1.5rem;
    }
    
    .analysis-grid {
        grid-template-columns: 1fr;
    }
}

/* Estados especiais */
.materials-grid.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    font-size: 1.1rem;
    color: #7f8c8d;
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.material-card {
    animation: fadeIn 0.3s ease forwards;
}

