/* Estilos específicos para as páginas de Catálogo de Produtos e Ferramentas */

/* Filtros de Preço e Tipo */
#price-filter .price-btn.active, #type-filter .price-btn.active { 
    background: linear-gradient(135deg, var(--primary-accent), #059669);
    color: white;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}
#price-filter .price-btn:not(.active):hover, #type-filter .price-btn:not(.active):hover { 
    background-color: rgba(255,255,255,0.05); 
    color: white;
}

/* --- NOVO PRE-LOADER MÁGICO (PORTAL) --- */
.catalog-preloader { 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    min-height: 60vh; 
    position: relative;
}

.magic-loader-portal {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
}

.magic-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--primary-accent);
    box-shadow: 0 0 15px rgba(0, 255, 140, 0.1);
}

.magic-ring.ring-1 {
    width: 100%;
    height: 100%;
    animation: spin-right 2s linear infinite;
    border-top-color: #0ea5e9; /* Sky Blue */
}

.magic-ring.ring-2 {
    width: 70%;
    height: 70%;
    animation: spin-left 3s linear infinite;
    border-top-color: #d946ef; /* Fuchsia */
    border-bottom-color: #d946ef;
}

.magic-ring.ring-3 {
    width: 40%;
    height: 40%;
    animation: spin-right 1.5s linear infinite;
    border-left-color: #fbbf24; /* Amber */
    border-right-color: #fbbf24;
}

.magic-core {
    font-size: 1.5rem;
    color: white;
    animation: pulse-glow 1.5s ease-in-out infinite;
    z-index: 10;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.5));
}

.preloader-branding {
    font-size: 1.5rem;
    font-weight: 900;
    color: white;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
    opacity: 0;
    animation: fade-in-up 0.5s ease forwards 0.2s;
}
.preloader-branding .gpl-text { 
    color: var(--primary-accent); 
    text-shadow: 0 0 10px rgba(0, 255, 140, 0.4);
}

.preloader-text { 
    color: var(--text-dark); 
    font-weight: 500; 
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    opacity: 0;
    animation: fade-in-up 0.5s ease forwards 0.4s;
}

@keyframes spin-right { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes spin-left { 0% { transform: rotate(0deg); } 100% { transform: rotate(-360deg); } }
@keyframes pulse-glow { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.2); opacity: 0.8; } }
@keyframes fade-in-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- CABEÇALHO MÁGICO --- */
.magic-header-title .icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(6, 182, 212, 0.1));
    border: 1px solid rgba(14, 165, 233, 0.3);
    border-radius: 12px;
    color: #22d3ee;
    font-size: 1.25rem;
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.15);
}

.text-gradient-aurora {
    background: linear-gradient(to right, #ffffff, #e0f2fe, #bae6fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 10px rgba(56, 189, 248, 0.3));
}

/* TEXTO MÁGICO DO SUBTÍTULO */
.magic-text-flow {
    background: linear-gradient(90deg, #94a3b8, #e2e8f0, #94a3b8);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine-flow 4s linear infinite;
    text-shadow: 0 0 15px rgba(255,255,255,0.1);
}

@keyframes shine-flow {
    to { background-position: 200% center; }
}

/* --- GRID E CARDS --- */
#product-grid, #tool-grid { 
    transition: opacity 0.4s ease-in-out; 
}

/* Badge de Versão com Efeito Zoom */
.version-badge-style {
    font-size: 0.85rem !important; /* Fonte um pouco maior */
    font-weight: 700 !important;
    letter-spacing: 0.05em;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    border: 1px solid rgba(75, 85, 99, 0.5);
}
.version-badge-style:hover {
    transform: scale(1.1) translateY(-2px);
    background-color: rgba(31, 41, 55, 0.95) !important;
    border-color: var(--primary-accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    color: var(--primary-accent);
}
.version-badge-style i {
    transition: color 0.3s;
}
.version-badge-style:hover i {
    color: var(--primary-accent);
}

/* Botões de Filtro Customizados */
.custom-filter-trigger {
    display: inline-flex; 
    align-items: center; 
    gap: 0.6rem; 
    background-color: var(--sidebar-bg); 
    border: 1px solid var(--border-color); 
    color: var(--text-light); 
    padding: 0.6rem 1.2rem; 
    border-radius: 0.75rem; 
    font-weight: 600; 
    font-size: 0.9rem;
    transition: all 0.2s ease; 
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.custom-filter-trigger:hover { 
    background-color: #334155; 
    border-color: #64748b; 
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.custom-filter-trigger > span { 
    max-width: 150px; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}

/* Modal de Filtros */
.filter-modal-container { 
    position: fixed; 
    inset: 0; 
    z-index: 50; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    padding: 1rem; 
    transition: opacity 0.3s ease; 
}
.filter-modal-container.hidden { 
    opacity: 0; 
    pointer-events: none; 
}
.filter-modal-overlay { 
    position: absolute; 
    inset: 0; 
    background-color: rgba(5, 10, 20, 0.85); 
    backdrop-filter: blur(10px); 
}
.filter-modal-content {
    position: relative; 
    width: 100%; 
    max-width: 450px; 
    background: linear-gradient(145deg, rgba(30, 41, 59, 1), rgba(15, 23, 42, 1)); 
    border-radius: 1rem; 
    padding: 2px; /* Borda gradiente fina */
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 30px rgba(14, 165, 233, 0.1); 
    transform: scale(0.95); 
    transition: transform 0.3s ease;
    overflow: hidden;
}
.filter-modal-content::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, var(--primary-accent), #0ea5e9, #d946ef);
    z-index: -1;
    opacity: 0.5;
}

.filter-modal-inner {
    background: #111827;
    border-radius: 0.9rem; 
    padding: 1.5rem;
    height: 100%;
}
.filter-modal-container:not(.hidden) .filter-modal-content { 
    transform: scale(1); 
}

/* Estilo da Barra de Busca no Modal */
.filter-modal-search {
    width: 100%;
    background-color: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    font-size: 0.95rem;
    transition: all 0.3s;
}
.filter-modal-search:focus {
    outline: none;
    border-color: var(--primary-accent);
    background-color: rgba(30, 41, 59, 0.8);
    box-shadow: 0 0 0 3px rgba(0, 255, 140, 0.15);
}

.filter-modal-list {
    max-height: 60vh; 
    overflow-y: auto; 
    padding-right: 0.5rem;
}
.filter-modal-list::-webkit-scrollbar { 
    width: 6px; 
}
.filter-modal-list::-webkit-scrollbar-track { 
    background: transparent; 
}
.filter-modal-list::-webkit-scrollbar-thumb { 
    background-color: #475569; 
    border-radius: 10px; 
}
.filter-modal-list li {
    padding: 0.85rem 1rem; 
    border-radius: 0.75rem; 
    font-weight: 500; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border: 1px solid transparent; 
    margin-bottom: 0.5rem;
    background-color: rgba(255,255,255,0.02);
}
.filter-modal-list li:hover { 
    background-color: rgba(14, 165, 233, 0.1); 
    border-color: rgba(14, 165, 233, 0.3); 
    transform: translateX(4px); 
    color: white;
}

/* ATUALIZAÇÃO MÁGICA PARA ITEM SELECIONADO */
.filter-modal-list li.selected { 
    color: #064e3b; /* Texto Escuro (Verde Floresta) para Contraste */
    font-weight: 800; 
    background: linear-gradient(90deg, #34d399, #00ff8c); /* Fundo Verde Vivo */
    border: none;
    box-shadow: 0 0 20px rgba(0, 255, 140, 0.4);
}

/* Badge do Contador dentro do item selecionado */
.filter-modal-list li.selected .filter-count-badge {
    background-color: rgba(255, 255, 255, 0.4) !important; /* Fundo Cristal Branco */
    color: #022c22 !important; /* Número Escuro */
    border-color: rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    backdrop-filter: blur(4px);
    font-weight: 900;
}

/* Texto do nome (para garantir cor escura) */
.filter-modal-list li.selected .option-text {
    color: #064e3b !important;
}

/* Ícone de Check no item selecionado */
.filter-modal-list li.selected .check-icon { 
    color: #064e3b !important; 
    opacity: 1; 
}

/* Outros ícones (não check) */
.check-icon { 
    color: #111827; 
    opacity: 0; 
    transition: opacity 0.2s; 
}

/* --- ESTILOS DOS CARDS DE PRODUTO --- */

/* Base para botões de ação (Adquirir e Baixar) com ANIMAÇÃO */
.product-card-action-btn {
    position: absolute;
    bottom: 0.75rem;
    left: 0.75rem;
    width: 44px; /* Ligeiramente maior */
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); /* Efeito Bouncy */
    opacity: 0;
    transform: scale(0.5) rotate(-45deg);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.2);
    z-index: 20;
    overflow: hidden; /* Para o efeito de brilho */
}

/* Efeito de brilho que passa pelo botão */
.product-card-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    transform: skewX(-20deg);
    transition: none;
}

.group:hover .product-card-action-btn {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.group:hover .product-card-action-btn::before {
    left: 150%;
    transition: left 0.7s ease-in-out 0.2s; /* Brilho passa logo após aparecer */
}

.product-card-action-btn:hover {
    transform: scale(1.15) translateY(-2px) !important;
}

/* --- BOTÃO DE COMPRA MÁGICO (PAGO) --- */
.product-card-action-btn.btn-acquire {
    /* Gradiente Sunset Vibrante */
    background: linear-gradient(135deg, #f59e0b, #ea580c); 
    color: white;
    box-shadow: 0 4px 15px rgba(234, 88, 12, 0.4), inset 0 1px 0 rgba(255,255,255,0.3);
    border-color: rgba(251, 191, 36, 0.5);
}
.product-card-action-btn.btn-acquire:hover {
    background: linear-gradient(135deg, #fbbf24, #f97316); /* Mais brilhante no hover */
    box-shadow: 0 0 25px rgba(234, 88, 12, 0.7), 0 0 10px rgba(251, 191, 36, 0.5);
    border-color: #fcd34d;
}

/* --- BOTÃO DE DOWNLOAD MÁGICO (GRÁTIS/ASSINANTE) --- */
.product-card-action-btn.btn-download {
    /* Gradiente Esmeralda Neon */
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4), inset 0 1px 0 rgba(255,255,255,0.3);
    border-color: rgba(52, 211, 153, 0.5);
}
.product-card-action-btn.btn-download:hover {
    background: linear-gradient(135deg, #34d399, #10b981); /* Mais brilhante no hover */
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.7), 0 0 10px rgba(52, 211, 153, 0.5);
    border-color: #6ee7b7;
}

/* Título e Descrição do Card de Produto */
.product-card-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.product-card-description {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: #94a3b8;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Botão de Categoria no Card de Produto */
.product-card-category-btn {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background-color: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    padding: 0.35rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(-10px);
    z-index: 20;
}
.group:hover .product-card-category-btn {
    opacity: 1;
    transform: translateY(0);
}
.product-card-category-btn:hover {
    background-color: var(--primary-accent);
    color: #111827;
    border-color: var(--primary-accent);
    box-shadow: 0 0 15px rgba(0, 255, 140, 0.4);
}