/* ══ Override cert-card dari style.css ══ */
.cert-card {
    all: unset;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
    background: var(--surface);
    display: block;
}

.cert-card:hover {
    transform: translateY(-8px) scale(1.03);
    border-color: rgba(79, 143, 255, 0.5);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.cert-card.landscape {
    width: 560px;
    height: 300px;
}

.cert-card.portrait {
    width: 240px;
    height: 340px;
}

.cert-card img {
    width: 100%;
    height: 100%;
    object-fit: fill;
    display: block;
    transition: transform 0.4s;
    pointer-events: none;
    user-select: none;
}

.cert-card:hover img {
    transform: scale(1.04);
}

/* Carousel wrapper */
.cert-carousel-wrap {
    position: relative;
    overflow: hidden;
    padding: 1.4rem 0;
    cursor: grab;
    user-select: none;
}

.cert-carousel-wrap:active {
    cursor: grabbing;
}

.cert-track {
    display: flex;
    gap: 1.6rem;
    width: max-content;
    animation: scrollRight 60s linear infinite;
    will-change: transform;
}

.cert-track.dragging {
    animation-play-state: paused !important;
    transition: none !important;
}

.cert-track:hover {
    animation-play-state: paused;
}

@keyframes scrollRight {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

/* Overlay */
.cert-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem 1.4rem 1.2rem;
    background: linear-gradient(to top,
            rgba(4, 6, 20, 0.97) 0%,
            rgba(4, 6, 20, 0.65) 55%,
            transparent 100%);
    pointer-events: none;
}

.cert-overlay-name {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
    letter-spacing: 0.01em;
}

.cert-overlay-issuer {
    font-size: 0.78rem;
    color: rgba(200, 215, 255, 0.85);
    margin-bottom: 0.15rem;
}

.cert-overlay-year {
    font-size: 0.68rem;
    color: var(--accent2);
    font-family: 'Orbitron', monospace;
    letter-spacing: 0.08em;
}

/* Zoom hint */
.cert-zoom-hint {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    width: 32px;
    height: 32px;
    background: rgba(79, 143, 255, 0.75);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s;
    backdrop-filter: blur(4px);
}

.cert-card:hover .cert-zoom-hint {
    opacity: 1;
}

/* Fade edges */
.cert-carousel-wrap::before,
.cert-carousel-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 120px;
    z-index: 2;
    pointer-events: none;
}

.cert-carousel-wrap::before {
    left: 0;
    background: linear-gradient(to right, var(--bg), transparent);
}

.cert-carousel-wrap::after {
    right: 0;
    background: linear-gradient(to left, var(--bg), transparent);
}

/* Hint bar */
.cert-hint {
    text-align: center;
    font-size: 0.68rem;
    color: var(--muted);
    margin-top: 1.4rem;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.cert-hint::before,
.cert-hint::after {
    content: '';
    width: 40px;
    height: 1px;
    background: var(--border);
}

/* Light mode adjustments */
body.light-mode .cert-overlay {
    background: linear-gradient(to top,
            rgba(8, 20, 70, 0.97) 0%,
            rgba(8, 20, 70, 0.55) 55%,
            transparent 100%);
}

body.light-mode .cert-card {
    border-color: rgba(60, 120, 220, 0.25);
    box-shadow: 0 4px 16px rgba(60, 120, 200, 0.13);
}

body.light-mode .cert-card:hover {
    border-color: rgba(26, 111, 223, 0.5);
    box-shadow: 0 20px 60px rgba(60, 120, 200, 0.3);
}

/* ══ LIGHTBOX ══ */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(2, 4, 14, 0.96);
    backdrop-filter: blur(14px);
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    flex-direction: column;
    gap: 1.2rem;
}

.lightbox.open {
    display: flex;
}

.lightbox-img-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: lbIn 0.28s ease;
}

@keyframes lbIn {
    from {
        opacity: 0;
        transform: scale(0.93);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lightbox-img-wrap img {
    max-width: 88vw;
    max-height: 78vh;
    width: auto;
    height: auto;
    border-radius: 14px;
    border: 1px solid rgba(79, 143, 255, 0.25);
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.8);
    display: block;
}

.lightbox-placeholder {
    width: min(860px, 90vw);
    height: min(610px, 75vh);
    border-radius: 14px;
    border: 1px dashed rgba(79, 143, 255, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    color: var(--muted);
    background: var(--surface);
    font-size: 0.88rem;
}

.lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(79, 143, 255, 0.2);
    border: 1px solid rgba(79, 143, 255, 0.35);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    font-size: 1.4rem;
    transition: background 0.2s;
    backdrop-filter: blur(6px);
    z-index: 3;
}

.lb-nav:hover {
    background: rgba(79, 143, 255, 0.5);
}

.lb-prev {
    left: -64px;
}

.lb-next {
    right: -64px;
}

.lb-close {
    position: fixed;
    top: 1.2rem;
    right: 1.2rem;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s;
    z-index: 1000;
}

.lb-close:hover {
    background: rgba(255, 80, 80, 0.2);
    border-color: rgba(255, 80, 80, 0.4);
    color: #ff6060;
}

.lightbox-info {
    text-align: center;
}

.lb-name {
    font-family: 'Orbitron', monospace;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.35rem;
}

.lb-meta {
    font-size: 0.78rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
}

.lb-meta span {
    color: var(--accent2);
    font-family: 'Orbitron', monospace;
}

.lb-counter {
    font-size: 0.7rem;
    font-family: 'Orbitron', monospace;
    color: var(--muted);
    letter-spacing: 0.1em;
}

@media (max-width: 600px) {
    .cert-card.landscape {
        width: 300px;
        height: 210 px;
    }

    .cert-card.portrait {
        width: 170px;
        height: 240px;
    }

    .lb-prev {
        left: -6px;
    }

    .lb-next {
        right: -6px;
    }

    .lb-nav {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}