/**
 * LOUD MASTERY STYLE - Estilos para Sistema de Masterização
 */

/* ── ESTADO DE CAPÍTULO ── */
[data-chapter] {
    transition: all 0.3s ease;
    border: 2px solid rgba(107, 107, 122, 0.3);
    position: relative;
}

[data-chapter].unread-chapter {
    opacity: 0.6;
    border-color: rgba(107, 107, 122, 0.2);
}

[data-chapter].read-chapter {
    border-color: rgba(34, 197, 94, 0.3);
}

[data-chapter].mastered-chapter {
    border: 2px solid rgba(218, 165, 32, 0.6) !important;
    background: linear-gradient(135deg, rgba(218, 165, 32, 0.08), rgba(218, 165, 32, 0.04)) !important;
    box-shadow: 0 0 30px rgba(218, 165, 32, 0.3), inset 0 0 20px rgba(218, 165, 32, 0.1) !important;
}

[data-chapter].mastered-chapter::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(218, 165, 32, 0.8), transparent);
    animation: gold-shimmer 2s ease-in-out infinite;
}

@keyframes gold-shimmer {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* ── SELO DE MASTERIZAÇÃO ── */
.mastery-seal {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 80px;
    height: 80px;
    background: conic-gradient(from 0deg, rgba(218, 165, 32, 0.3), rgba(218, 165, 32, 0.1), rgba(218, 165, 32, 0.3));
    border: 2px solid rgba(218, 165, 32, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    animation: mastery-seal-pulse 2s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(218, 165, 32, 0.4);
}

@keyframes mastery-seal-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(218, 165, 32, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 30px rgba(218, 165, 32, 0.6);
    }
}

.mastery-seal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
}

.mastery-icon {
    font-size: 2rem;
    animation: mastery-icon-bounce 1s ease-in-out infinite;
}

@keyframes mastery-icon-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.mastery-text {
    font-size: 0.5rem;
    font-weight: 900;
    letter-spacing: 1px;
    color: rgba(218, 165, 32, 0.8);
    text-transform: uppercase;
    line-height: 1.2;
}

/* ── PARTÍCULAS DE CELEBRAÇÃO ── */
.mastery-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.mastery-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, rgba(218, 165, 32, 0.8), transparent);
    border-radius: 50%;
    bottom: 0;
    animation: mastery-particle-float 2s ease-out forwards;
}

@keyframes mastery-particle-float {
    0% {
        opacity: 1;
        transform: translateY(0) translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) translateX(var(--tx, 0px));
    }
}

.mastery-particle:nth-child(1) { --tx: -30px; }
.mastery-particle:nth-child(2) { --tx: 30px; }
.mastery-particle:nth-child(3) { --tx: -50px; }
.mastery-particle:nth-child(4) { --tx: 50px; }
.mastery-particle:nth-child(5) { --tx: -20px; }
.mastery-particle:nth-child(6) { --tx: 20px; }
.mastery-particle:nth-child(7) { --tx: -40px; }
.mastery-particle:nth-child(8) { --tx: 40px; }

/* ── NOTIFICAÇÃO DE MASTERIZAÇÃO ── */
.mastery-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, rgba(218, 165, 32, 0.2), rgba(218, 165, 32, 0.1));
    border: 2px solid rgba(218, 165, 32, 0.5);
    border-radius: 16px;
    padding: 20px 24px;
    z-index: 1000;
    animation: mastery-notification-slide-in 0.5s ease;
    box-shadow: 0 20px 60px rgba(218, 165, 32, 0.2);
    backdrop-filter: blur(10px);
}

@keyframes mastery-notification-slide-in {
    from {
        opacity: 0;
        transform: translateX(100px) translateY(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0) translateY(0);
    }
}

.mastery-notification-hide {
    animation: mastery-notification-slide-out 0.3s ease forwards;
}

@keyframes mastery-notification-slide-out {
    from {
        opacity: 1;
        transform: translateX(0) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px) translateY(100px);
    }
}

.mastery-notification-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mastery-notification-icon {
    font-size: 2.5rem;
    animation: mastery-notification-bounce 0.6s ease;
}

@keyframes mastery-notification-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.mastery-notification-text h3 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.2rem;
    color: rgba(218, 165, 32, 0.9);
    margin: 0 0 4px 0;
    letter-spacing: 1px;
}

.mastery-notification-text p {
    font-size: 0.85rem;
    color: #d4eaf7;
    margin: 0;
    line-height: 1.4;
}

/* ── BARRA DE PROGRESSO DE MASTERIZAÇÃO ── */
.mastery-progress-bar {
    position: relative;
    width: 100%;
    height: 8px;
    background: rgba(218, 165, 32, 0.1);
    border: 1px solid rgba(218, 165, 32, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin: 16px 0;
}

.mastery-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, rgba(218, 165, 32, 0.4), rgba(218, 165, 32, 0.8));
    transition: width 0.5s ease;
    position: relative;
}

.mastery-progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: mastery-progress-shimmer 2s ease-in-out infinite;
}

@keyframes mastery-progress-shimmer {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

.mastery-progress-text {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    font-weight: 900;
    color: rgba(218, 165, 32, 0.8);
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 2;
}

/* ── RESPONSIVIDADE ── */
@media (max-width: 768px) {
    .mastery-seal {
        width: 60px;
        height: 60px;
        top: 8px;
        right: 8px;
    }

    .mastery-seal-content {
        gap: 2px;
    }

    .mastery-icon {
        font-size: 1.5rem;
    }

    .mastery-text {
        font-size: 0.4rem;
    }

    .mastery-notification {
        bottom: 20px;
        right: 20px;
        padding: 16px 20px;
    }

    .mastery-notification-icon {
        font-size: 2rem;
    }

    .mastery-notification-text h3 {
        font-size: 1rem;
    }

    .mastery-notification-text p {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .mastery-seal {
        width: 50px;
        height: 50px;
        top: 6px;
        right: 6px;
    }

    .mastery-icon {
        font-size: 1.2rem;
    }

    .mastery-notification {
        bottom: 10px;
        right: 10px;
        left: 10px;
        padding: 14px 16px;
    }

    .mastery-notification-content {
        gap: 12px;
    }

    .mastery-notification-icon {
        font-size: 1.8rem;
    }

    .mastery-notification-text h3 {
        font-size: 0.95rem;
    }
}
