/* Estilos específicos para o catálogo de texturas */

/* Cards expandíveis */
.expandable-card {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.expandable-card:hover {
    transform: translateY(-5px);
}

.texture-image-centered {
    width: 100%;
    height: 250px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px 8px 0 0;
    background-color: var(--card-bg);
}

.texture-image-centered img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.texture-image-centered img:hover {
    transform: scale(1.05);
}

/* Modal de imagem expandida */
.expanded-image-modal {
    display: none;
    position: fixed;
    z-index: 9999; /* Valor muito alto para garantir que fique acima de qualquer outro elemento */
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.expanded-image-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    object-fit: contain; /* Garante que a imagem seja exibida inteira sem distorção */
}

#expanded-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 50px;
    font-size: 1.2rem;
}

.expanded-image-content, #expanded-caption {
    animation-name: zoom;
    animation-duration: 0.6s;
}

@keyframes zoom {
    from {transform: scale(0)}
    to {transform: scale(1)}
}

.close-expanded {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    z-index: 10000; /* Valor maior que o modal para garantir que fique sempre visível */
}

.close-expanded:hover,
.close-expanded:focus {
    color: var(--accent-color);
    text-decoration: none;
    cursor: pointer;
}

.texture-catalog {
    padding: 40px 0;
}

.catalog-header {
    margin-bottom: 40px;
    text-align: center;
}

.catalog-header h2 {
    font-size: 2.2rem;
    margin-bottom: 15px;
    color: #ffffff;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
}

.catalog-header p {
    color: var(--text-light);
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Estilos de filtros removidos */

/* Indicadores de carregamento */
.loading-spinner,
.loading-more {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    width: 100%;
    color: var(--text-color);
}

.loading-spinner i,
.loading-more i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.loading-more {
    grid-column: 1 / -1;
    margin-top: 20px;
}

/* Botão de voltar ao topo */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
}

.texture-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 25px;
    margin-top: 30px;
}

.texture-card {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(139, 92, 246, 0.1);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.texture-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
    border-color: rgba(139, 92, 246, 0.3);
}

.texture-image {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.texture-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.texture-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.texture-name {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #ffffff;
    font-weight: 600;
}

.texture-details {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 15px;
    flex-grow: 1;
}

.texture-details p {
    margin: 5px 0;
    display: flex;
    align-items: center;
}

.texture-details i {
    color: var(--primary-color);
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

.texture-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.btn-texture {
    padding: 8px 15px;
    font-size: 0.9rem;
    flex: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.texture-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--gradient-primary);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.texture-badge.new {
    background: var(--gradient-secondary);
}

.pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
    gap: 5px;
}

.pagination-item {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(139, 92, 246, 0.2);
    color: var(--text-color);
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.pagination-item:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.4);
}

.pagination-item.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-item i {
    font-size: 0.9rem;
}

.texture-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
    background: rgba(15, 23, 42, 0.95);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(139, 92, 246, 0.3);
    overflow: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    padding-bottom: 15px;
}

.modal-title {
    font-size: 1.8rem;
    color: #ffffff;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close:hover {
    color: var(--danger-color);
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.modal-image {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.modal-image img {
    width: 100%;
    height: auto;
    display: block;
}

.modal-info {
    color: var(--text-color);
}

.modal-info h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: #ffffff;
}

.modal-info p {
    margin-bottom: 10px;
    line-height: 1.6;
}

.modal-info-list {
    margin: 20px 0;
}

.modal-info-item {
    display: flex;
    margin-bottom: 10px;
    align-items: center;
}

.modal-info-item i {
    color: var(--primary-color);
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.texture-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.texture-preview-item {
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.texture-preview-item:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.texture-preview-item.active {
    border-color: var(--accent-color);
}

.texture-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Responsividade */
@media (max-width: 992px) {
    .modal-body {
        grid-template-columns: 1fr;
    }
    
    .texture-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .catalog-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group, .search-group {
        width: 100%;
    }
    
    .texture-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .texture-image {
        height: 180px;
    }
}

@media (max-width: 480px) {
    .texture-grid {
        grid-template-columns: 1fr;
    }
    
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .texture-actions {
        flex-direction: column;
    }
}
