/* Cyber/Premium Design System */
:root {
    --bg-dark: #0a0a0f;
    --bg-panel: rgba(20, 20, 30, 0.6);
    --primary: #00f3ff;
    /* Neon Cyan */
    --secondary: #bc13fe;
    /* Neon Purple */
    --text-main: #ffffff;
    --text-muted: #a0a0b0;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
}

html {
    scroll-behavior: smooth;
}

section {
    scroll-margin-top: 100px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 1px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s ease;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    font-family: var(--font-heading);
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: var(--primary);
    z-index: -1;
    transition: 0.3s ease;
}

.btn:hover::before {
    width: 100%;
}

.btn:hover {
    color: var(--bg-dark);
    box-shadow: 0 0 15px var(--primary);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-content {
    text-align: center;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-profile-container {
    width: 150px;
    height: 150px;
    margin-bottom: 2rem;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--primary);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
    animation: float 6s ease-in-out infinite;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

.glitch-text {
    font-size: 4rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px var(--secondary), -2px -2px var(--primary);
    animation: glitch 3s infinite;
}

.subtitle {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.terminal-box {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid var(--glass-border);
    padding: 1rem;
    font-family: 'Courier New', monospace;
    text-align: left;
    max-width: 500px;
    margin: 0 auto 2rem;
    border-radius: 8px;
}

.command-line::before {
    content: '> ';
    color: var(--primary);
}

/* Timeline (Intern Progress) */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background: var(--glass-border);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1px;
}

/* ================================
   BLIBLI TIMELINE ITEM (HORIZONTAL LAYOUT)
   ================================ */

.timeline-item.blibli-item {
    width: 100%;
    left: 0;
    padding: 20px 0;
}

.blibli-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    max-width: 900px;
    margin: 0 auto;
}

/* Image Container (LEFT) */
.blibli-media {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

/* Glow effect for active slideshow */
.blibli-media.active-glow,
.blibli-media:hover {
    border-color: var(--primary);
    box-shadow: 0 0 25px rgba(0, 243, 255, 0.6),
        0 0 50px rgba(0, 243, 255, 0.3);
}

/* Slideshow Images */
.blibli-media .slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.blibli-media .slide.active {
    opacity: 1;
}

/* Text Content (RIGHT) */
.blibli-layout .timeline-content {
    width: 100%;
}

/* Mobile Responsive */
@media screen and (max-width: 768px) {
    .blibli-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .blibli-media {
        aspect-ratio: 4/3;
    }
}

/* ================================
   TIMELINE MEDIA STYLES
   ================================ */

.timeline-media {
    width: 100%;
    margin-top: 15px;
    background: #000;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 16/9;
    /* Standard widescreen container */
}

/* Ensure images fill container */
.timeline-media img,
.timeline-media .slide {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    transition: opacity 1s ease-in-out;
}

.timeline-media .slide {
    opacity: 0;
}

.timeline-media .slide.active {
    opacity: 1;
}

/* Active Glow Effect (Cyber Theme) */
.active-glow {
    border-color: var(--primary) !important;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.4) !important;
}

/* Ensure transition exists for smooth glow */
.timeline-media,
.timeline-content {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
}

.timeline-item.left {
    left: 0;
}

.timeline-item.right {
    left: 50%;
}

.timeline-content {
    padding: 20px 30px;
    background: var(--bg-panel);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    position: relative;
    transition: 0.3s;
}

.timeline-content:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.1);
}

.timeline-date {
    color: var(--primary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: block;
}

/* Timeline Image Layout */
.timeline-content.with-image {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    gap: 15px;
}

.timeline-content.with-image:hover {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.2);
}

.with-image .text-content {
    flex: 1;
}

.with-image .img-preview {
    width: 100px;
    height: 100px;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    flex-shrink: 0;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 900px;
    max-height: 80vh;
    position: relative;
    top: 50%;
    transform: translateY(-50%);
    text-align: center;
}

#slideshow-img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.2);
    border: 1px solid var(--glass-border);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--primary);
}

.modal-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 15px;
    gap: 20px;
}

.modal-caption {
    color: var(--text-main);
    font-size: 1.1rem;
    font-family: var(--font-heading);
}

.prev-slide,
.next-slide {
    cursor: pointer;
    width: auto;
    padding: 10px;
    color: white;
    font-weight: bold;
    font-size: 18px;
    transition: 0.6s ease;
    border: 1px solid var(--primary);
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prev-slide:hover,
.next-slide:hover {
    background-color: var(--primary);
    color: black;
}

/* Skills Grid (Learning Journey) */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.skill-card {
    text-align: center;
}

.skill-icon {
    font-size: 3rem;
    color: var(--secondary);
    margin-bottom: 1rem;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--glass-border);
    border-radius: 3px;
    margin-top: 1rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0;
    /* Animated with JS */
    transition: width 1.5s ease-out;
}

/* Portfolio Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.project-img-container {
    width: 100%;
    height: 180px;
    background: #000;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid var(--glass-border);
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.3s;
    opacity: 0.9;
}

.project-card:hover .project-img {
    opacity: 1;
    transform: scale(1.05);
}

.project-tags span {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(188, 19, 254, 0.1);
    color: var(--secondary);
    border-radius: 20px;
    font-size: 0.8rem;
    margin-right: 5px;
    margin-top: 10px;
}

/* ================================
   CERTIFICATES — FINAL FIX
   ================================ */

/* Grid */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

/* Card */
.cert-card {
    background: rgba(20, 20, 30, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.cert-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.15);
    transform: translateY(-5px);
}

/* Image Container — KUNCI STABIL */
.cert-img-container {
    width: 100%;
    height: 220px;
    /* stabil & konsisten */
    background: rgba(10, 10, 20, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid var(--glass-border);
}

/* Image — TIDAK PECAH */
.cert-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    /* WAJIB untuk dokumen */
    opacity: 0.9;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Hover image — halus */
.cert-card:hover .cert-img {
    opacity: 1;
    transform: scale(1.03);
}

/* Info */
.cert-info {
    padding: 1.5rem;
    text-align: left;
}

.cert-name {
    font-family: var(--font-heading);
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.cert-issuer {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Mobile tweak */
@media (max-width: 768px) {
    .cert-img-container {
        height: 200px;
    }
}

/* Nav/CSP Refactor */
.main-nav {
    padding: 20px;
    position: fixed;
    width: 100%;
    z-index: 100;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    background: rgba(10, 10, 15, 0.7);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-family: var(--font-heading);
    font-weight: bold;
    color: var(--primary);
    font-size: 1.2rem;
}

.nav-item {
    margin-left: 20px;
}

.nav-btn {
    margin-left: 20px;
    padding: 5px 15px;
    font-size: 0.9rem;
}

/* Animations */
@keyframes glitch {
    0% {
        text-shadow: 2px 2px var(--secondary), -2px -2px var(--primary);
    }

    25% {
        text-shadow: -2px 2px var(--secondary), 2px -2px var(--primary);
    }

    50% {
        text-shadow: 2px -2px var(--secondary), -2px 2px var(--primary);
    }

    75% {
        text-shadow: -2px -2px var(--secondary), 2px 2px var(--primary);
    }

    100% {
        text-shadow: 2px 2px var(--secondary), -2px -2px var(--primary);
    }
}

/* ================================
/* ================================
   TIMELINE EVIDENCE BELOW CARD
   ================================ */

.timeline-item.with-evidence-below {
    display: flex;
    flex-direction: column;
}

/* Ensure content and evidence have same width/style basis */
.timeline-item.with-evidence-below .timeline-evidence {
    margin-top: 15px;
    /* Spacing between card and evidence */
    width: 100%;
    height: 180px;
    /* Fixed height for slideshow */
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    overflow: hidden;
    position: relative;
    background: #000;
}

/* Slideshow inside evidence container */
.evidence-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.evidence-slide.active {
    opacity: 1;
}

/* Fix specific responsive height */
@media screen and (max-width: 768px) {
    .timeline-item.with-evidence-below .timeline-evidence {
        height: 150px;
    }
}

/* ================================
/* ================================
/* ================================
   TIMELINE EVIDENCE SIDE LAYOUT
   ================================ */

.timeline-item.with-evidence-side {
    width: 50%;
    /* Standard timeline item width */
}

.timeline-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 15px;
    width: 100%;
}

/* Specific adjustment for the content card when in a row */
.timeline-row .timeline-content {
    flex: 1;
    /* Take remaining space */
    min-width: 0;
    /* Prevent flex overflow */
}

/* Evidence Container */
.timeline-evidence-side {
    width: 140px;
    /* Base width */
    height: 140px;
    /* Square aspect ratio usually looks good side-by-side */
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: #000;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    /* Do not shrink */
    margin-right: 30px;
    /* Extra separation from center line */
}

/* Slideshow Images */
.timeline-evidence-side .slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.timeline-evidence-side .slide.active {
    opacity: 1;
}

/* Mobile Responsive: Stack them */
@media screen and (max-width: 768px) {
    .timeline-row {
        flex-direction: column;
    }

    .timeline-evidence-side {
        width: 100%;
        height: 160px;
        /* Slightly taller for stacked view */
        margin-top: 10px;
    }
}

/* Evidence container */
.timeline-evidence-below {
    width: 100%;
    max-width: 420px;
    /* SAMA dengan card timeline */
    margin-top: 12px;
}

/* Slideshow box */
.evidence-slideshow {
    position: relative;
    width: 100%;
    height: 160px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.4);
}

/* Slide images */
.evidence-slideshow img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.evidence-slideshow img.active {
    opacity: 1;
}

.evidence-caption {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* LEFT timeline compatibility */
.timeline-item.left.with-evidence-below {
    align-items: flex-start;
}

.timeline-item.with-evidence .timeline-inner {
    display: grid;
    grid-template-columns: 1fr 40px 1fr;
    align-items: center;
}

/* Evidence on LEFT */
.timeline-evidence {
    grid-column: 1;
    width: 100%;
    max-width: 260px;
}

/* Timeline line stays center */
.timeline::after {
    left: 50%;
}

/* Content on RIGHT */
.timeline-item.with-evidence .timeline-content {
    grid-column: 3;
}

/* === BLIBLI SLIDESHOW === */
.blibli-media {
    position: relative;
    width: 100%;
    max-width: 420px;
    height: 260px;
    border-radius: 14px;
    overflow: hidden;
}

.blibli-media .slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;

    opacity: 0;
    transition: opacity 0.8s ease, box-shadow 0.4s ease;
    border-radius: 14px;
}

/* ACTIVE SLIDE */
.blibli-media .slide.active {
    opacity: 1;
    z-index: 2;

    box-shadow:
        0 0 18px rgba(0, 255, 255, 0.7),
        0 0 36px rgba(0, 255, 255, 0.35);
    border: 2px solid var(--primary);
}

.blibli-media img.active {
    opacity: 1;
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.6);
}