@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    --bg-gradient: linear-gradient(-45deg, #f4f7f6, #e0eafc, #cfdef3, #f4f7f6);
    --text-color: #2c3e50;
    --card-bg: rgba(255, 255, 255, 0.85);
    --primary-color: #0056b3;
    --secondary-color: #007bff;
    --shadow: 0 8px 32px rgba(31, 38, 135, 0.1);
    --jonathan-color: #17a2b8;
}

.dark-mode {
    --bg-gradient: linear-gradient(-45deg, #1a1a2e, #16213e, #0f3460, #1a1a2e);
    --text-color: #e0e0e0;
    --card-bg: rgba(30, 30, 47, 0.85);
    --primary-color: #4da3ff;
    --secondary-color: #80bdff;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    --jonathan-color: #20c997;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

button,
input,
textarea,
select {
    font: inherit;
}

body {
    background: var(--bg-gradient);
    background-size: 400% 400%;
    animation: gradientMove 15s ease infinite;
    color: var(--text-color);
    line-height: 1.6;
    transition: color 0.3s;
    scroll-behavior: smooth;
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: padding 0.25s ease, background 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

header.is-scrolled {
    padding: 14px 50px;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

header h1 {
    font-weight: 700;
    font-size: 1.8rem;
    letter-spacing: 1px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.45);
}

.nav-link,
.admin-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: 0.2s ease;
}

.nav-link {
    color: var(--text-color);
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link.is-active {
    background: rgba(255, 255, 255, 0.78);
    box-shadow: var(--shadow);
    outline: none;
}

.admin-link {
    color: #fff;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 4px 15px rgba(0, 86, 179, 0.22);
}

.admin-link:hover,
.admin-link:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(0, 86, 179, 0.28);
    outline: none;
}

.theme-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    border: none;
    padding: 10px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 86, 179, 0.3);
    transition: all 0.3s ease;
}

.theme-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 86, 179, 0.5);
}

.hero {
    text-align: center;
    padding: 60px 20px 20px;
    max-width: 800px;
    margin: 0 auto;
}

.hero h2 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.hero-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    padding: 12px 18px;
    border-radius: 999px;
    text-decoration: none;
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 86, 179, 0.18);
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 86, 179, 0.1);
}

.hero-link:hover,
.hero-link:focus-visible {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    outline: none;
}

.hero-link-primary {
    background: rgba(255, 255, 255, 0.85);
    color: var(--primary-color);
    border: 1px solid rgba(0, 86, 179, 0.18);
}

.fade-up {
    opacity: 0;
    transform: translateY(30px);
    animation: slideUp 0.8s ease forwards;
}

@keyframes slideUp {
    to { opacity: 1; transform: translateY(0); }
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

.portfolio-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 360px));
    gap: 18px;
    margin-bottom: 20px;
    justify-content: center;
}

.highlight-card {
    background: var(--card-bg);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 16px;
    padding: 22px;
    box-shadow: var(--shadow);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

.highlight-card strong {
    display: block;
    font-size: 1.6rem;
    color: var(--primary-color);
    width: 100%;
    text-align: center;
}

.highlight-card span {
    display: block;
    width: 100%;
    text-align: center;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.feature-card {
    background: var(--card-bg);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 18px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.feature-card h3 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

/* PERBAIKAN CENTER JUDUL */
.section-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2rem;
    font-weight: 600;
    position: relative;
    /* Fit-content memastikan kotaknya sebesar teksnya saja, sehingga garisnya pas di tengah */
    width: fit-content; 
    margin-left: auto;
    margin-right: auto;
}

.section-title::after {
    content: '';
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

.creators-section {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 70px;
}

.creator-card {
    background: var(--card-bg);
    backdrop-filter: blur(5px);
    padding: 40px 30px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    text-align: center;
    flex: 1;
    min-width: 300px;
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s ease;
    cursor: pointer; /* Memberitahu user bahwa ini bisa diklik */
    position: relative;
    border: 1px solid rgba(255,255,255,0.2);
    color: inherit;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

button.creator-card {
    text-align: center;
    width: 100%;
}

button.project-card {
    text-align: left;
    width: 100%;
}

/* Efek saat card kreator di-hover */
.creator-card:hover,
.creator-card:focus-visible {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 86, 179, 0.2);
    border-color: var(--primary-color);
    outline: none;
}

.dark-mode .creator-card:hover,
.dark-mode .creator-card:focus-visible {
    box-shadow: 0 15px 35px rgba(77, 163, 255, 0.2);
}

/* Teks Petunjuk Klik */
.click-hint {
    display: block;
    margin-top: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
    opacity: 0; /* Sembunyi secara default */
    transition: 0.3s;
}

.creator-card h3,
.creator-card p,
.creator-card .click-hint {
    text-align: center;
}

.creator-card:hover .click-hint,
.creator-card:focus-visible .click-hint {
    opacity: 1; /* Muncul saat di hover */
}

.avatar {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 4px solid var(--primary-color);
    background-color: #e9ecef;
    padding: 2px;
}

.avatar-fallback {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0 auto 15px;
    border: 4px solid white;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.project-toolbar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 14px;
    background: var(--card-bg);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 18px;
    padding: 18px;
    box-shadow: var(--shadow);
}

.toolbar-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    font-weight: 600;
}

.toolbar-field input,
.toolbar-field select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(0, 86, 179, 0.18);
    background: rgba(255, 255, 255, 0.9);
    color: #1f2937;
}

.project-result-count {
    margin-bottom: 18px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-color);
}

.project-card {
    background: var(--card-bg);
    backdrop-filter: blur(5px);
    padding: 18px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 100%;
}

.project-card:hover,
.project-card:focus-visible {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 86, 179, 0.2);
    border-color: var(--primary-color);
    outline: none;
}

.project-card h4 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    font-weight: 600;
}

.project-card-media {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    min-height: 180px;
    background: linear-gradient(135deg, rgba(0, 86, 179, 0.18), rgba(77, 163, 255, 0.18));
}

.project-card-media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.18), transparent 50%);
}

.project-card-image {
    width: 100%;
    height: 100%;
    min-height: 180px;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease;
}

.project-card:hover .project-card-image,
.project-card:focus-visible .project-card-image {
    transform: scale(1.06);
}

.project-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.project-card-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.project-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 86, 179, 0.09);
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 700;
    flex-shrink: 0;
}

.project-card[hidden] {
    display: none;
}

.creator-tag {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.jonathan-tag {
    background: var(--jonathan-color);
}

.category {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: auto;
    font-weight: 600;
    text-transform: uppercase;
}

.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    font-size: 1.35rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(0, 86, 179, 0.24);
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    z-index: 1100;
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus-visible {
    transform: translateY(-3px);
    outline: none;
}

footer {
    text-align: center;
    padding: 30px;
    margin-top: 50px;
    font-size: 0.9rem;
    opacity: 0.7;
}

.empty-state {
    margin-top: 22px;
    text-align: center;
    background: var(--card-bg);
    border: 1px dashed var(--primary-color);
    border-radius: 18px;
    padding: 28px 20px;
    box-shadow: var(--shadow);
}

.empty-state h3 {
    margin-bottom: 8px;
    color: var(--primary-color);
}

/* MODAL & POP-UP (Digunakan untuk Project & CV) */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--card-bg);
    color: var(--text-color);
    padding: 40px;
    border-radius: 20px;
    max-width: 650px;
    width: 90%;
    position: relative;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    animation: scaleIn 0.3s ease-out;
    max-height: 90vh; /* Agar bisa di-scroll jika isinya panjang */
    overflow-y: auto;
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 2rem;
    cursor: pointer;
    transition: transform 0.2s;
    background: transparent;
    border: none;
    color: inherit;
}

.close-btn:hover,
.close-btn:focus-visible {
    color: #dc3545;
    transform: rotate(90deg);
    outline: none;
}

.modal-img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 25px;
}

/* DESAIN KHUSUS UNTUK KONTEN CV */
.cv-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(128,128,128,0.2);
    padding-bottom: 20px;
}

.cv-header h2 {
    font-size: 2rem;
    color: var(--primary-color);
}

.cv-section {
    margin-bottom: 25px;
}

.cv-section h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--primary-color);
    display: inline-block;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.skill-tag {
    background-color: rgba(0, 86, 179, 0.1);
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid var(--primary-color);
}

.stack-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 20px;
}

.stack-chip {
    background: var(--card-bg);
    border: 1px solid rgba(0, 86, 179, 0.18);
    color: var(--primary-color);
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: 600;
    box-shadow: var(--shadow);
}

@media (max-width: 768px) {
    header {
        padding: 18px 20px;
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .header-nav {
        width: 100%;
        justify-content: center;
    }

    .admin-link {
        width: 100%;
    }

    .hero {
        padding-top: 40px;
    }

    .hero h2 {
        font-size: 2.2rem;
    }

    header.is-scrolled {
        padding: 14px 20px;
    }

    .creator-card {
        min-width: unset;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .project-card-media,
    .project-card-image {
        min-height: 160px;
    }

    .project-toolbar {
        grid-template-columns: 1fr;
    }

    .back-to-top {
        right: 16px;
        bottom: 16px;
        width: 48px;
        height: 48px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* FIX DARK MODE UNTUK TEKS DI PROJECT CARD */
body.dark-mode .project-card h4 {
    color: #ffffff !important;
}
body.dark-mode .project-card p {
    color: #cbd5e1 !important;
}
body.dark-mode .project-card .category {
    color: #94a3b8 !important;
}