/* Contém estilos para componentes de UI reutilizáveis como botões, badges, cards, etc. */

/* ATUALIZADO: EFEITO DE BORDA ANIMADA "SWEEP" */
@keyframes border-sweep-animation {
    0%, 100% {
        clip-path: polygon(0% 0%, 0% 0%, 0% 2px, 0% 2px, 0% 100%, 0% 100%);
    }
    25% {
        clip-path: polygon(0% 0%, 100% 0%, 100% 2px, 2px 2px, 2px 100%, 0% 100%);
    }
    50% {
        clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 100% 100%, 2px 100%, 0 100%);
    }
    75% {
        clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0 100%, 0 98%, 98% 98%);
    }
}


/* --- Botões --- */

/* ATUALIZADO: Estilo Principal para Botão de Aquisição com borda animada */
.btn-action-primary {
    position: relative;
    z-index: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.5rem 1.75rem;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 0.5rem;
    background: transparent; /* Fundo do container principal é transparente */
    box-shadow: 0 4px 15px rgba(109, 40, 217, 0.25);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    overflow: hidden;
}

/* Camada da borda animada (atrás de tudo) */
.btn-action-primary::before {
    content: '';
    position: absolute;
    z-index: -2;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: conic-gradient(from 90deg at 50% 50%, #fef08a, #facc15 50%, #fef08a); /* Gradiente Amarelo Claro > Ouro */
    border-radius: inherit;
    animation: border-sweep-animation 3s linear infinite;
}

/* Camada do fundo do botão (na frente da borda, atrás do texto) */
.btn-action-primary::after {
    content: '';
    position: absolute;
    z-index: -1;
    top: 2px; /* Espessura da borda */
    left: 2px;
    right: 2px;
    bottom: 2px;
    background-image: linear-gradient(to right, #86198f, #6d28d9, #86198f);
    background-size: 200% auto;
    border-radius: calc(0.5rem - 2px); /* Raio interno */
    transition: background-position 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}


.btn-action-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(109, 40, 217, 0.4);
}
/* Efeito de hover agora mira o fundo interno */
.btn-action-primary:hover::after {
    background-position: right center;
}

.btn-action-primary:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 4px 15px rgba(109, 40, 217, 0.25);
}

.btn-action-primary .icon {
    transition: transform 0.3s ease-in-out;
}

.btn-action-primary:hover .icon {
    transform: scale(1.15) rotate(-12deg);
}

/* ATUALIZADO: Estilo Secundário para Botão de Ação com borda animada */
.btn-action-secondary {
    position: relative;
    z-index: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.75rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    background: transparent; /* Fundo do container principal é transparente */
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2);
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    overflow: hidden;
}

/* Camada da borda animada (atrás de tudo) */
.btn-action-secondary::before {
    content: '';
    position: absolute;
    z-index: -2;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: conic-gradient(from 90deg at 50% 50%, #6ee7b7, #10b981 50%, #6ee7b7); /* Gradiente Verde */
    border-radius: inherit;
    animation: border-sweep-animation 3s linear infinite;
    animation-delay: -1.5s; /* Começa na metade do ciclo para diferenciar */
}

/* Camada do fundo do botão (na frente da borda, atrás do texto) */
.btn-action-secondary::after {
    content: '';
    position: absolute;
    z-index: -1;
    top: 2px; /* Espessura da borda */
    left: 2px;
    right: 2px;
    bottom: 2px;
    background-image: linear-gradient(to right, #3b82f6, #1e3a8a, #3b82f6);
    background-size: 200% auto;
    border-radius: calc(0.5rem - 2px); /* Raio interno */
    transition: background-position 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn-action-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
}
/* Efeitos de hover e active agora miram o fundo interno */
.btn-action-secondary:hover::after {
    background-position: right center;
}

.btn-action-secondary:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.2);
}


.font-size-btn.active {
    background-color: var(--primary-accent);
    color: #111827;
    font-weight: bold;
}
.font-size-btn.active:hover {
    background-color: #ff4d4d;
}

/* --- Favoritos --- */
@keyframes heart-glow {
    0%, 100% { text-shadow: 0 0 8px rgba(239, 68, 68, 0.7); }
    50% { text-shadow: 0 0 16px rgba(239, 68, 68, 1), 0 0 24px rgba(239, 68, 68, 0.5); }
}

.favorite-btn-detail {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
}
.favorite-btn-detail i {
    font-size: 18px;
    color: var(--text-dark);
    transition: all 0.3s ease;
}
.favorite-btn-detail:hover {
    background-color: #334155;
    border-color: #475569;
}
.favorite-btn-detail:hover i { color: var(--favorite-red); }
.favorite-btn-detail.active {
    background-color: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
}
.favorite-btn-detail.active i {
    color: var(--favorite-red);
    animation: heart-glow 1.5s ease-in-out infinite;
}

.favorite-card.card-removing {
    transition: opacity 0.4s ease, transform 0.4s ease;
    transform: scale(0.95);
    opacity: 0;
}

.fav-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    padding: 0.25rem 0.65rem;
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.fav-card-action-icon {
    position: absolute;
    width: 36px;
    height: 36px;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    opacity: 0;
    transform: scale(0.8);
    color: var(--text-light);
}
.favorite-card:hover .fav-card-action-icon {
    opacity: 1;
    transform: scale(1);
}
.fav-card-action-icon:hover {
    background-color: var(--primary-accent);
    color: #111827;
    transform: scale(1.1) !important;
    box-shadow: 0 0 10px var(--primary-accent);
}
.fav-card-action-icon.favorite-card-btn { color: var(--text-dark); }
.fav-card-action-icon.favorite-card-btn:hover {
    background-color: var(--favorite-red);
    color: white; 
    box-shadow: 0 0 10px var(--favorite-red);
}
.fav-card-action-icon.favorite-card-btn i.fa-heart {
    color: var(--favorite-red);
}


/* --- Badges --- */
.badge-assinatura-ativa {
    display: inline-flex;
    position: relative;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.125rem; /* text-lg */
    font-weight: 700;
    color: #c4b5fd; /* violet-300 */
    background: none;
    border: none;
    padding: 0;
    box-shadow: none;
    text-shadow: none;
    cursor: default;
    transition: none;
}

.badge-assinatura-ativa::before {
    content: '';
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    bottom: -0.5rem;
    left: -0.5rem;
    background-color: rgba(167, 139, 250, 0.25); /* violet-400 com 25% de opacidade */
    filter: blur(16px); /* blur-lg */
    z-index: -1;
    border-radius: 0.5rem;
}

.badge-assinatura-ativa .fa-crown {
    color: #facc15; /* yellow-400 */
    font-size: 1.2rem;
    filter: drop-shadow(0 0 5px rgba(250, 204, 21, 0.7));
    transition: none;
}
.badge-assinatura-ativa:hover {
    transform: none;
    box-shadow: none;
}
.badge-assinatura-ativa:hover .fa-crown {
    transform: none;
}

.badge-status-trocado {
    background-color: rgba(220, 38, 38, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.badge-status-pendente {
    background-color: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
    border: 1px solid rgba(251, 191, 36, 0.3);
}
.badge-status-rejeitada {
    background-color: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

.badge-tempo-restante {
    background-color: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border: 1px solid rgba(96, 165, 250, 0.3);
}
.badge-tempo-expirando {
    background-color: rgba(249, 115, 22, 0.2);
    color: #fdba74;
    border: 1px solid rgba(251, 146, 60, 0.3);
}
.badge-tempo-expirado {
    background-color: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

.category-button {
    display: inline-block;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.category-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.category-parent {
    background-color: var(--primary-accent);
    color: #111827;
}
.category-child {
    background-color: #3b82f6; /* blue-500 */
    color: var(--text-light);
}


/* --- Notificações --- */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    color: white;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    backdrop-filter: blur(8px);
}
.toast-notification.show {
    opacity: 1;
    transform: translateX(0);
}
.toast-notification i {
    font-size: 1.5rem;
}
.toast-success {
    background-color: rgba(16, 185, 129, 0.3); /* green-600 com alpha */
    border-color: rgba(5, 150, 105, 0.5);   /* green-700 com alpha */
}
.toast-success i { color: #34d399; /* green-400 */ }

.toast-error {
    background-color: rgba(220, 38, 38, 0.3); /* red-600 com alpha */
    border-color: rgba(185, 28, 28, 0.5);   /* red-700 com alpha */
}
.toast-error i { color: #f87171; /* red-400 */ }


/* --- Componentes Interativos --- */
#product-stars .rating-star.hover,
#product-stars .rating-star.active,
#tool-stars .rating-star.hover,
#tool-stars .rating-star.active {
    color: #f59e0b;
    transform: scale(1.15);
    transition: color 0.2s, transform 0.2s;
}

.speed-slider::-webkit-slider-thumb, .pitch-slider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 16px; height: 16px;
    background: #00ff8c; border-radius: 50%; cursor: pointer;
    margin-top: -7px;
}
.speed-slider::-moz-range-thumb, .pitch-slider::-moz-range-thumb {
    width: 16px; height: 16px;
    background: #00ff8c; border-radius: 50%; cursor: pointer;
}

@keyframes button-glow {
    0% { filter: drop-shadow(0 0 3px var(--primary-accent)); }
    50% { filter: drop-shadow(0 0 8px var(--primary-accent)); }
    100% { filter: drop-shadow(0 0 3px var(--primary-accent)); }
}

#scroll-progress-button {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 60px;
    height: 60px;
    z-index: 1000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: scale(0.9);
    opacity: 0;
}
#scroll-progress-button.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}
#scroll-progress-button:not(.hidden) {
    opacity: 1;
    transform: scale(1);
}
#scroll-progress-button .progress-ring {
    position: absolute;
    top: 0;
    left: 0;
    transform: rotate(-90deg);
}
#scroll-progress-button .progress-ring__circle-bg {
    stroke: var(--border-color);
}
#scroll-progress-button .progress-ring__circle {
    stroke: var(--primary-accent);
    stroke-linecap: round;
    transition: stroke-dashoffset 0.1s linear;
}
#scroll-progress-button .button-content {
    width: 48px;
    height: 48px;
    background-color: var(--sidebar-bg);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition: all 0.2s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}
#scroll-progress-button:hover .button-content {
    background-color: #334155; 
}
#scroll-progress-button .button-icon {
    font-size: 16px;
    transition: transform 0.3s ease;
}
#scroll-progress-button .progress-text {
    font-size: 10px;
    font-weight: 700;
    margin-top: 2px;
}
#scroll-progress-button:hover {
    animation: button-glow 2s infinite ease-in-out;
}

.day-selector-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: #334155; /* slate-700 */
    border-radius: 5px;
    outline: none;
    transition: background 0.3s;
}

.day-selector-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--primary-accent);
    cursor: pointer;
    border-radius: 50%;
    border: 3px solid var(--sidebar-bg);
    box-shadow: 0 0 10px rgba(0, 255, 140, 0.5);
    transition: transform 0.2s ease-in-out;
}
.day-selector-slider:hover::-webkit-slider-thumb {
    transform: scale(1.1);
}

.day-selector-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary-accent);
    cursor: pointer;
    border-radius: 50%;
    border: 3px solid var(--sidebar-bg);
    box-shadow: 0 0 10px rgba(0, 255, 140, 0.5);
}

.day-selector-slider::-moz-range-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: #334155;
    border-radius: 5px;
}

/* --- NOVO: Card de Autor do Produto --- */

.author-card-magic {
    position: relative;
    padding: 1.5rem;
    border-radius: 0.75rem;
    background: linear-gradient(145deg, #1f2937, #111827); /* Fundo escuro */
    border: 1px solid #374151;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Efeito de brilho "mágico" */
.author-card-magic::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 140, 0.2), transparent);
    transform: skewX(-25deg);
    transition: left 0.8s ease-in-out;
}

.author-card-magic:hover::before {
    left: 150%;
}

/* Borda com gradiente no hover */
.author-card-magic::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 0.75rem;
    padding: 2px; /* Espessura da borda */
    background: linear-gradient(145deg, var(--primary-accent), #4f46e5);
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.author-card-magic:hover::after {
    opacity: 1;
}

.author-card-magic:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 255, 140, 0.15);
}

.author-card-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

/* Estilo para avatar de letra */
.author-card-avatar-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    background-image: linear-gradient(to top right, var(--primary-accent), #34d399);
}