/* module.css - New premium design for module detail pages */
.module-page-hero {
    padding: 20px 0 40px;
    background: transparent;
    color: var(--text-heading);
    position: relative;
    overflow: hidden;
}

.mph-container {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

@media (max-width: 480px) {
    .module-page-hero {
        padding: 10px 0 20px;
    }

    .module-hero-title {
        font-size: 1.8rem;
    }

    .module-hero-subtitle {
        font-size: 0.95rem;
    }
}

.module-hero-icon {
    font-size: 2.5rem;
    color: var(--primary-red);
    margin-bottom: 1rem;
    background: rgba(210, 18, 46, 0.05);
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(210, 18, 46, 0.1);
}

.module-hero-title {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 800;
    color: var(--text-heading);
    margin-bottom: 0.25rem;
    letter-spacing: -1px;
}

.module-hero-subtitle {
    font-size: 1rem;
    color: var(--text-body);
    max-width: 600px;
}

.module-content-section {
    padding: 100px 0;
    background-color: #F1F5F9;
    /* slightly different from main bg */
}

.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

@media (max-width: 480px) {
    .topic-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .module-content-section {
        padding: 50px 0;
    }
}

.topic-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.03);
    position: relative;
    z-index: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.topic-card::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(210, 18, 46, 0.08) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    z-index: -1;
    transition: transform 0.5s ease;
}

.topic-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-8px);
    border-color: rgba(210, 18, 46, 0.2);
}

.topic-card:hover::before {
    transform: scale(1.5);
}

.topic-card-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(210, 18, 46, 0.1), rgba(210, 18, 46, 0.01));
    color: var(--primary-red);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(210, 18, 46, 0.1);
}

.topic-card-title {
    font-family: var(--font-primary);
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-heading);
}

.topic-card-desc {
    color: var(--text-light);
    font-size: 1.05rem;
    line-height: 1.6;
    flex-grow: 1;
}

.back-nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-heading);
    font-weight: 600;
    background: rgba(0, 0, 0, 0.05);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
}

.back-nav-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--primary-red);
}

/* --- CERTIFICATION SECTION --- */
.certification-section {
    padding: 90px 0;
    background: linear-gradient(135deg, #1a0a2e 0%, #2d1b4e 30%, #4a1942 60%, #6b1d3a 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

/* Animated floating orbs */
.certification-section::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(240, 185, 11, 0.2) 0%, transparent 65%);
    border-radius: 50%;
    animation: orbFloat1 8s ease-in-out infinite alternate;
}

.certification-section::after {
    content: '';
    position: absolute;
    bottom: -25%;
    left: -8%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(210, 18, 46, 0.25) 0%, transparent 65%);
    border-radius: 50%;
    animation: orbFloat2 10s ease-in-out infinite alternate;
}

@keyframes orbFloat1 {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(-30px, 40px) scale(1.1);
    }

    100% {
        transform: translate(20px, -20px) scale(0.95);
    }
}

@keyframes orbFloat2 {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(40px, -30px) scale(1.15);
    }

    100% {
        transform: translate(-20px, 30px) scale(0.9);
    }
}

.cert-container {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 3rem;
    align-items: center;
}

@media (max-width: 768px) {
    .cert-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .certification-section {
        padding: 50px 0;
    }

    .cert-container {
        gap: 2rem;
    }

    .cert-title {
        font-size: 1.8rem;
    }

    .cert-description {
        font-size: 0.95rem;
    }

    .cert-highlights li {
        font-size: 0.85rem;
        padding: 0.6rem 0.8rem;
        text-align: left;
        /* Keep list left aligned on mobile */
    }
}

/* Certificate Image */
.cert-image-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Spinning particle ring behind image */
.cert-image-wrapper::after {
    content: '';
    position: absolute;
    width: 580px;
    height: 580px;
    border: 2px dashed rgba(240, 185, 11, 0.15);
    border-radius: 50%;
    animation: spinRing 20s linear infinite;
}

@keyframes spinRing {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.cert-image-wrapper img {
    width: 100%;
    max-width: 550px;
    height: auto;
    border-radius: 16px;
    border: 2px solid rgba(240, 185, 11, 0.35);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(240, 185, 11, 0.15),
        0 0 80px rgba(240, 185, 11, 0.05);
    animation: certFloat 4s ease-in-out infinite alternate, certGlow 3s ease-in-out infinite alternate;
    position: relative;
    z-index: 2;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: high-quality;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

@keyframes certFloat {
    0% {
        transform: translateY(0px) rotate(0deg);
    }

    100% {
        transform: translateY(-15px) rotate(1.5deg);
    }
}

@keyframes certGlow {
    0% {
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 30px rgba(240, 185, 11, 0.1);
    }

    100% {
        box-shadow: 0 25px 70px rgba(0, 0, 0, 0.5), 0 0 50px rgba(240, 185, 11, 0.25), 0 0 100px rgba(240, 185, 11, 0.08);
    }
}

/* Shimmer border */
.cert-image-wrapper::before {
    content: '';
    position: absolute;
    inset: -4px;
    max-width: 558px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(240, 185, 11, 0.5), rgba(210, 18, 46, 0.4), rgba(240, 185, 11, 0.5), rgba(107, 29, 58, 0.4));
    background-size: 300% 300%;
    animation: shimmerBorder 4s ease-in-out infinite;
    z-index: 1;
    margin: 0 auto;
}

@keyframes shimmerBorder {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Certificate Content */
.cert-content {
    animation: certSlideIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes certSlideIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.cert-title {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 800;
    color: white;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.cert-title .highlight-yellow {
    color: var(--accent-yellow);
    text-shadow: 0 0 20px rgba(240, 185, 11, 0.3);
}

.cert-description {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.8;
    margin-bottom: 2rem;
}

.cert-highlights {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

/* Staggered animation for list items */
.cert-highlights li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    animation: staggerIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.cert-highlights li:nth-child(1) {
    animation-delay: 0.1s;
}

.cert-highlights li:nth-child(2) {
    animation-delay: 0.2s;
}

.cert-highlights li:nth-child(3) {
    animation-delay: 0.3s;
}

.cert-highlights li:nth-child(4) {
    animation-delay: 0.4s;
}

@keyframes staggerIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.cert-highlights li:hover {
    background: linear-gradient(135deg, rgba(240, 185, 11, 0.12), rgba(255, 255, 255, 0.08));
    border-color: rgba(240, 185, 11, 0.4);
    transform: translateX(8px);
    box-shadow: 0 4px 20px rgba(240, 185, 11, 0.1);
}

.cert-highlights li i {
    color: var(--accent-yellow);
    font-size: 1.1rem;
    margin-top: 0.15rem;
    flex-shrink: 0;
    filter: drop-shadow(0 0 4px rgba(240, 185, 11, 0.4));
    transition: transform 0.3s ease;
}

.cert-highlights li:hover i {
    transform: scale(1.2);
}