/*
|--------------------------------------------------------------------------
| File: asset/css/certificates.css
| Deskripsi: Styling untuk section "Certificates & Achievements" interaktif.
|--------------------------------------------------------------------------
*/

.certificates-section {
    --color: #191919;
    background-color: #000000;
    background-image: linear-gradient(0deg,
            transparent 24%,
            var(--color) 25%,
            var(--color) 26%,
            transparent 27%,
            transparent 74%,
            var(--color) 75%,
            var(--color) 76%,
            transparent 77%,
            transparent),
        linear-gradient(90deg,
            transparent 24%,
            var(--color) 25%,
            var(--color) 26%,
            transparent 27%,
            transparent 74%,
            var(--color) 75%,
            var(--color) 76%,
            transparent 77%,
            transparent);
    background-size: 55px 55px;
    position: relative;
    height: 100vh;
    overflow: hidden;
    touch-action: none;
    user-select: none;
}

.certificates-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px,
            transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.5;
    z-index: 0;
}

.certificates-header {
    position: absolute;
    top: 4rem;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    z-index: 10;
    text-align: center;
}

.certificates-subtitle {
    font-size: 1.1rem;
    color: #b0b0b0;
    max-width: 700px;
    margin: auto;
    line-height: 1.7;
    opacity: 0;
    animation: fadeIn 1s ease-out 0.5s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Judul Animasi */
.animated-title-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.animated-title {
    font-size: 2.8rem;
    font-weight: 700;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.words-container {
    overflow: hidden;
    position: relative;
    height: 100%;
    min-width: 260px;
    width: auto;
    padding: 0 14px;
    transition: width 0.3s ease-in-out;
}

.words {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.word {
    display: block;
    height: 100%;
    white-space: nowrap;
    /* Pastikan properti ini ada untuk menyembunyikan warna teks asli */
    -webkit-text-fill-color: transparent;
    animation: spin-words 12s infinite;
}

/* Menggunakan .word:nth-child(n) agar lebih spesifik */
.words .word:nth-child(1) {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.words .word:nth-child(2) {
    background: linear-gradient(135deg, #a754eb 0%, #c084f3 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.words .word:nth-child(3) {
    background: linear-gradient(135deg, #4caf50 0%, #81c784 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.words .word:nth-child(4) {
    background: linear-gradient(135deg, #2196f3 0%, #64b5f6 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.words .word:nth-child(5) {
    background: linear-gradient(135deg, #ff9800 0%, #ffb74d 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.words .word:nth-child(6) {
    background: linear-gradient(135deg, #9e9e9e 0%, #d5d5d5 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

/* Aturan untuk kata terakhir (yang duplikat untuk loop) */
.words .word:nth-child(7) {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

@keyframes spin-words {
    8% {
        transform: translateY(-100%);
    }

    16% {
        transform: translateY(-100%);
    }

    24% {
        transform: translateY(-200%);
    }

    32% {
        transform: translateY(-200%);
    }

    40% {
        transform: translateY(-300%);
    }

    48% {
        transform: translateY(-300%);
    }

    56% {
        transform: translateY(-400%);
    }

    64% {
        transform: translateY(-400%);
    }

    72% {
        transform: translateY(-500%);
    }

    80% {
        transform: translateY(-500%);
    }

    88% {
        transform: translateY(-600%);
    }

    100% {
        transform: translateY(-600%);
    }
}

/* Card Sertifikat */
.certificate-item-interactive {
    position: absolute;
    border-radius: 12px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    cursor: grab;
    will-change: transform;
    opacity: 0;
    transition: opacity 0.5s ease,
        transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.certificate-item-interactive:active {
    cursor: grabbing;
    z-index: 1000 !important;
}

.card-content {
    position: relative;
    width: 100%;
    height: 100%;
    /* border-radius: 12px; */
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.682);
}

.certificate-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

/* .certificate-item-interactive:hover .certificate-img {
    transform: scale(1.05);
} */

/* Header & Detail Hover */
.card-header,
.card-details {
    position: absolute;
    width: 100%;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.certificate-item-interactive:hover .card-header,
.certificate-item-interactive:hover .card-details {
    opacity: 1;
}

.card-header {
    top: 0;
    left: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent);
}

.card-tools {
    display: flex;
    gap: 6px;
}

.card-circle {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.card-circle.red {
    background-color: #ff605c;
}

.card-circle.yellow {
    background-color: #ffbd44;
}

.card-circle.green {
    background-color: #00ca4e;
}

.card-custom-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    background: rgba(0, 0, 0, 0.425);
    padding: 2px 8px;
    border-radius: 4px;
}

.card-details {
    bottom: 0;
    left: 0;
    padding: 1rem;
    color: #fff;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    text-align: left;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.card-issuer,
.card-date {
    font-size: 0.8rem;
    color: #b0b0b0;
}

/* Controls */
.controls {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1rem;
    z-index: 10;
}

/* Neon Button Styles */
.neon-button {
    --primary: #00ffff;
    --primary-dark: #ff6b6b;
    --primary-light: #ffffff;
    --size: 50px;
    position: relative;
    width: var(--size);
    height: var(--size);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    font-size: 20px;
    color: var(--primary-light);
}

.neon-button__frame {
    position: relative;
    width: 100%;
    height: 100%;
}

.neon-button__box {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 4px;
    border: 2px solid var(--primary-dark);
    transition: all 0.4s ease;
}

.neon-button__icon-container {
    position: absolute;
    inset: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.neon-button__glow {
    position: absolute;
    inset: -2px;
    border-radius: 6px;
    background: var(--primary);
    opacity: 0;
    filter: blur(8px);
    transform: scale(1.2);
    transition: all 0.4s ease;
}

.neon-button__borders {
    position: absolute;
    inset: 0;
    border-radius: 4px;
    overflow: hidden;
}

.neon-button__borders span {
    position: absolute;
    width: 40px;
    height: 1px;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.neon-button__borders span:nth-child(1) {
    top: 0;
    left: -100%;
    animation: borderFlow1 2s linear infinite;
}

.neon-button__borders span:nth-child(2) {
    top: -100%;
    right: 0;
    width: 1px;
    height: 40px;
    animation: borderFlow2 2s linear infinite;
}

.neon-button__borders span:nth-child(3) {
    bottom: 0;
    right: -100%;
    animation: borderFlow3 2s linear infinite;
}

.neon-button__borders span:nth-child(4) {
    bottom: -100%;
    left: 0;
    width: 1px;
    height: 40px;
    animation: borderFlow4 2s linear infinite;
}

.neon-button__particles span {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    top: 50%;
    left: 50%;
    box-shadow: 0 0 6px var(--primary);
}

.neon-button__rings {
    position: absolute;
    inset: -20px;
    pointer-events: none;
}

.neon-button__rings .ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid var(--primary);
    opacity: 0;
    transform: scale(0);
}

.neon-button__sparks span {
    position: absolute;
    width: 20px;
    height: 1px;
    background: linear-gradient(90deg, var(--primary), transparent);
    opacity: 0;
}

/* Hover Effects */
.neon-button:hover .neon-button__box {
    border-color: var(--primary);
    transform: scale(1.05);
}

/* Animating State (triggered by JS) */
.neon-button.is-animating .neon-button__box {
    border-color: var(--primary);
    background: rgba(0, 255, 170, 0.1);
}

.neon-button.is-animating .neon-button__glow {
    opacity: 0.2;
}

.neon-button.is-animating .neon-button__borders span {
    opacity: 1;
}

/* Particle Animations on Animating */
.neon-button.is-animating .neon-button__particles span {
    animation: particleExplosion 0.6s ease-out forwards;
}

.neon-button.is-animating .neon-button__rings .ring {
    animation: ringPulse 0.6s ease-out forwards;
}

.neon-button.is-animating .neon-button__sparks span {
    animation: sparkFlash 0.6s ease-out forwards;
}

/* Animations */
@keyframes borderFlow1 {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(200%);
    }
}

@keyframes borderFlow2 {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(200%);
    }
}

@keyframes borderFlow3 {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-200%);
    }
}

@keyframes borderFlow4 {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-200%);
    }
}

@keyframes particleExplosion {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    100% {
        transform: translate(calc(-50% + var(--x, 20px)),
                calc(-50% + var(--y, 20px))) scale(0);
        opacity: 0;
    }
}

@keyframes ringPulse {
    0% {
        transform: scale(0);
        opacity: 1;
    }

    100% {
        transform: scale(2);
        opacity: 0;
    }
}

@keyframes sparkFlash {
    0% {
        transform: rotate(var(--r, 0deg)) translateX(0) scale(1);
        opacity: 1;
    }

    100% {
        transform: rotate(var(--r, 0deg)) translateX(30px) scale(0);
        opacity: 0;
    }
}

/* Particle Positions */
.neon-button__particles span:nth-child(1) {
    --x: 25px;
    --y: -25px;
}

.neon-button__particles span:nth-child(2) {
    --x: -25px;
    --y: -25px;
}

.neon-button__particles span:nth-child(3) {
    --x: 25px;
    --y: 25px;
}

.neon-button__particles span:nth-child(4) {
    --x: -25px;
    --y: 25px;
}

.neon-button__particles span:nth-child(5) {
    --x: 35px;
    --y: 0px;
}

.neon-button__particles span:nth-child(6) {
    --x: -35px;
    --y: 0px;
}

.neon-button__particles span:nth-child(7) {
    --x: 0px;
    --y: 35px;
}

.neon-button__particles span:nth-child(8) {
    --x: 0px;
    --y: -35px;
}

.neon-button__particles span:nth-child(9) {
    --x: 20px;
    --y: -30px;
}

.neon-button__particles span:nth-child(10) {
    --x: -20px;
    --y: 30px;
}

.neon-button__particles span:nth-child(11) {
    --x: 30px;
    --y: 20px;
}

.neon-button__particles span:nth-child(12) {
    --x: -30px;
    --y: -20px;
}

/* Spark Rotations */
.neon-button__sparks span:nth-child(1) {
    --r: 0deg;
    top: 50%;
    left: 50%;
}

.neon-button__sparks span:nth-child(2) {
    --r: 90deg;
    top: 50%;
    left: 50%;
}

.neon-button__sparks span:nth-child(3) {
    --r: 180deg;
    top: 50%;
    left: 50%;
}

.neon-button__sparks span:nth-child(4) {
    --r: 270deg;
    top: 50%;
    left: 50%;
}

/* Ring Delays */
.neon-button__rings .ring:nth-child(1) {
    animation-delay: 0s;
}

.neon-button__rings .ring:nth-child(2) {
    animation-delay: 0.1s;
}

.neon-button__rings .ring:nth-child(3) {
    animation-delay: 0.2s;
}

/* Responsive */
@media (max-width: 768px) {
    .animated-title {
        font-size: 2.2rem;
        height: 40px;
    }

    .certificates-header {
        top: 2rem;
    }

    .controls {
        bottom: 1rem;
    }

    .neon-button {
        --size: 45px;
    }

    .card-title {
        font-size: 0.9rem;
    }

    .card-issuer,
    .card-date {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .animated-title {
        font-size: 1.8rem;
        height: 35px;
    }

    .certificates-subtitle {
        font-size: 1rem;
    }
}