/*
   RESET & BASE
*/
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-bg: #f8f4f0;
    --color-primary: #e60000;        /* merah utama */
    --color-secondary: #ff4d4d;
    --color-accent: #ff9999;
    --color-dark: #b30000;           /* merah tua untuk border/shadow */
    --color-text: #1e1e2a;
    --color-white: #ffffff;
    --border-thick: 4px solid var(--color-dark);
    --shadow-heavy: 6px 6px 0px var(--color-dark);
    --shadow-light: 4px 4px 0px rgba(179, 0, 0, 0.2);
    --radius: 12px;
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --ribbon-height: 28px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    padding-top: calc(2rem + var(--ribbon-height) + 12px);
    line-height: 1.5;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(230, 0, 0, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(230, 0, 0, 0.06) 0%, transparent 50%);
}

/*
   PITA MERAH PUTIH — STICKY DI ATAS (animasi CSS smooth, arah kiri→kanan)
*/
.top-ribbon {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--ribbon-height);
    z-index: 9999;
    overflow: hidden;
    background: #ffffff;
    border-bottom: 3px solid var(--color-dark);
    box-shadow: 0 2px 8px rgba(179, 0, 0, 0.15);
}

.ribbon-track {
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        90deg,
        #e60000 0px,
        #e60000 28px,
        #ffffff 28px,
        #ffffff 56px
    );
    background-size: 56px 100%;
    animation: scrollRibbon 1.2s linear infinite;
}

/* Arah kiri → kanan: background-position bergerak dari 0 ke 56px */
@keyframes scrollRibbon {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 56px 0;
    }
}

/*
   CONTAINER — Linktree card
*/
.linktree {
    max-width: 560px;
    width: 100%;
    background: var(--color-white);
    border: var(--border-thick);
    border-radius: var(--radius);
    box-shadow: var(--shadow-heavy);
    padding: 2rem 1.8rem 2.2rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.linktree:hover {
    transform: translate(-2px, -2px);
    box-shadow: 8px 8px 0px var(--color-dark);
}

/*
   NAVBAR
*/
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0 1rem 0;
    border-bottom: 4px solid var(--color-dark);
    margin-bottom: 1.5rem;
}

.nav-brand {
    font-weight: 900;
    font-size: 1.2rem;
    letter-spacing: -0.02em;
    background: var(--color-dark);
    color: var(--color-white);
    padding: 0.2rem 1rem;
    border-radius: 40px;
    border: var(--border-thick);
}

/*
   SEARCH SECTION
*/
.search-section {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.search-section input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: var(--border-thick);
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    background: var(--color-white);
    box-shadow: var(--shadow-light);
}

.search-section input:focus {
    outline: none;
    box-shadow: 4px 4px 0px var(--color-dark);
}

.search-section button {
    padding: 0.6rem 1rem;
    border: var(--border-thick);
    border-radius: var(--radius);
    background: var(--color-primary);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: var(--shadow-light);
    transition: all 0.12s ease;
    color: white;
}

.search-section button:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px var(--color-dark);
}

.search-section button:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px var(--color-dark);
}

#clearBtn {
    background: #e2e8f0;
    border-color: #64748b;
    color: #1e1e2a;
}

#clearBtn:hover {
    background: #cbd5e1;
}

/*
   RESULTS GRID
*/
.results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
    min-height: 100px;
}

/*
   CARD
*/
.card {
    background: var(--color-white);
    border: var(--border-thick);
    border-radius: var(--radius);
    padding: 1.2rem 1.5rem;
    box-shadow: var(--shadow-light);
    transition: all 0.12s ease;
}

.card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px var(--color-dark);
}

.card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.4rem;
}

.card p {
    font-size: 0.95rem;
    opacity: 0.8;
    margin-bottom: 0.8rem;
}

.card .card-link {
    display: inline-block;
    padding: 0.3rem 1rem;
    background: var(--color-primary);
    border: var(--border-thick);
    border-radius: 40px;
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
    color: white;
    transition: all 0.12s ease;
}

.card .card-link:hover {
    transform: scale(1.02);
    background: #cc0000;
}

.card-docs {
    display: block;
    margin-top: 0.6rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-dark);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s ease, transform 0.12s ease;
    width: fit-content;
}

.card-docs:hover {
    border-bottom-color: var(--color-dark);
    transform: translateX(4px);
}

.no-results {
    font-weight: 700;
    font-size: 1.1rem;
    text-align: center;
    padding: 2rem 0;
    background: var(--color-bg);
    border: var(--border-thick);
    border-radius: var(--radius);
    box-shadow: var(--shadow-light);
}

.cdn-badge {
    display: inline-block;
    margin-left: 0.5rem;
    vertical-align: middle;
    background: var(--color-dark);
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.1rem 0.6rem;
    border: 2px solid var(--color-dark);
    border-radius: 40px;
}

/*
   PAGINATION
*/
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 4px solid var(--color-dark);
}

.pagination button {
    padding: 0.5rem 1.2rem;
    border: var(--border-thick);
    border-radius: var(--radius);
    background: var(--color-white);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: var(--shadow-light);
    transition: all 0.12s ease;
}

.pagination button:hover:not(:disabled) {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px var(--color-dark);
}

.pagination button:active:not(:disabled) {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px var(--color-dark);
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.pagination #pageInfo {
    font-weight: 700;
    font-size: 1rem;
    background: var(--color-dark);
    color: var(--color-white);
    padding: 0.2rem 1rem;
    border-radius: 40px;
    border: var(--border-thick);
}

/*
   PROFILE / AVATAR
*/
.profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 2rem;
}

/* Container avatar dengan posisi relative untuk ring absolute */
.avatar {
    position: relative;
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    border-radius: 50%;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-light);
    background: white; /* dasar putih */
}

.avatar-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    background: var(--color-white);
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/*
   RING BENDERA MERAH PUTIH (dikelola oleh JS)
*/
.flag-ring {
    position: absolute;
    top: -10px;
    left: -10px;
    width: calc(100% + 20px);
    height: calc(100% + 20px);
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        #e60000 0deg 45deg,
        #ffffff 45deg 90deg,
        #e60000 90deg 135deg,
        #ffffff 135deg 180deg,
        #e60000 180deg 225deg,
        #ffffff 225deg 270deg,
        #e60000 270deg 315deg,
        #ffffff 315deg 360deg
    );
    z-index: -1;   /* di belakang avatar agar terlihat seperti border */
    box-shadow: 0 0 0 3px var(--color-dark); /* garis pinggir tegas */
    pointer-events: none; /* agar tidak menghalangi klik */
}

.profile h1 {
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    background: var(--color-dark);
    color: var(--color-white);
    display: inline-block;
    padding: 0.1rem 1rem;
    border: var(--border-thick);
    border-radius: 40px;
    box-shadow: var(--shadow-light);
    margin-bottom: 0.25rem;
}

.bio-description {
    margin-top: 0.6rem;
    font-weight: 600;
    font-size: 0.95rem;
    background: var(--color-bg);
    padding: 0.3rem 1rem;
    border: var(--border-thick);
    border-radius: 40px;
    box-shadow: var(--shadow-light);
}

/*
   LINK BUTTONS (donasi)
*/
.links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.link-btn {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.9rem 1.4rem;
    background: var(--color-white);
    border: var(--border-thick);
    border-radius: var(--radius);
    box-shadow: var(--shadow-light);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--color-text);
    text-decoration: none;
    transition: all 0.12s ease;
    cursor: pointer;
}

.link-btn .icon {
    font-size: 1.6rem;
    line-height: 1;
    flex-shrink: 0;
    width: 2.2rem;
    text-align: center;
}

.link-btn .label {
    flex: 1;
}

.link-btn .arrow {
    font-size: 1.2rem;
    opacity: 0.6;
    transition: transform 0.2s ease;
}

.link-btn:hover {
    transform: translate(-3px, -3px);
    box-shadow: 6px 6px 0px var(--color-dark);
}

.link-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px var(--color-dark);
}

.link-btn:hover .arrow {
    transform: translateX(4px);
    opacity: 1;
}

.link-btn--banana {
    background: #fef3c7;
    border-color: #d97706;
}

.link-btn--banana:hover {
    background: #fde68a;
}

.link-btn--sunflower {
    background: #fde68a;
    border-color: #b45309;
}

.link-btn--sunflower:hover {
    background: #fcd34d;
}

.link-btn--crypto {
    background: #dbeafe;
    border-color: #1e40af;
}

.link-btn--crypto:hover {
    background: #bfdbfe;
}

.link-btn--main {
    background: var(--color-primary);
    border-color: var(--color-dark);
    color: white;
}

.link-btn--main:hover {
    background: #cc0000;
}

.link-btn--secondary {
    background: var(--color-accent);
    border-color: var(--color-dark);
}

.link-btn--secondary:hover {
    background: #ff8080;
}

.badge {
    background: var(--color-dark);
    color: var(--color-white);
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.1rem 0.6rem;
    border: 2px solid var(--color-dark);
    border-radius: 40px;
    display: inline-block;
}

/*
   FOOTER
*/
.footer {
    margin-top: 2rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-dark);
    opacity: 0.7;
    border-top: 3px solid var(--color-dark);
    padding-top: 1.2rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem 1.2rem;
}

.footer .heart {
    display: inline-block;
    background: var(--color-primary);
    color: white;
    padding: 0 0.4rem;
    border: 2px solid var(--color-dark);
    border-radius: 4px;
    font-weight: 900;
}

/*
   RESPONSIVE
*/
@media (max-width: 480px) {
    :root {
        --ribbon-height: 22px;
    }

    body {
        padding-top: calc(1.5rem + var(--ribbon-height) + 10px);
    }

    .linktree {
        padding: 1.5rem 1.2rem 1.8rem;
    }

    .profile h1 {
        font-size: 1.4rem;
        padding: 0.1rem 0.8rem;
    }

    .bio-description {
        font-size: 0.8rem;
        padding: 0.2rem 0.8rem;
    }

    .avatar {
        width: 80px;
        height: 80px;
    }

    .flag-ring {
        top: -8px;
        left: -8px;
        width: calc(100% + 16px);
        height: calc(100% + 16px);
    }

    .link-btn {
        font-size: 0.95rem;
        padding: 0.75rem 1rem;
        gap: 0.6rem;
    }

    .link-btn .icon {
        font-size: 1.4rem;
        width: 1.8rem;
    }

    .footer {
        font-size: 0.75rem;
        flex-direction: column;
        gap: 0.3rem;
    }

    .search-section {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.6rem;
    }

    .search-section input {
        flex: 0 0 100%;
        margin-bottom: 0.2rem;
    }

    .search-section button {
        flex: 1;
        width: auto;
        padding: 0.6rem 0.5rem;
        font-size: 0.9rem;
    }

    .pagination {
        gap: 1rem;
        flex-wrap: wrap;
    }
}

@media (max-width: 380px) {
    :root {
        --ribbon-height: 18px;
    }

    body {
        padding-top: calc(1rem + var(--ribbon-height) + 8px);
    }

    .linktree {
        padding: 1rem 0.8rem 1.4rem;
    }

    .profile h1 {
        font-size: 1.2rem;
    }

    .link-btn {
        font-size: 0.85rem;
        padding: 0.6rem 0.8rem;
    }

    .avatar {
        width: 70px;
        height: 70px;
    }

    .flag-ring {
        top: -6px;
        left: -6px;
        width: calc(100% + 12px);
        height: calc(100% + 12px);
    }
}

/*
   ANIMASI FADE UP
*/
@keyframes fadeUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.linktree {
    animation: fadeUp 0.5s ease forwards;
}

.link-btn {
    animation: fadeUp 0.4s ease forwards;
    opacity: 0;
}

.link-btn:nth-child(1) {
    animation-delay: 0.08s;
}

.link-btn:nth-child(2) {
    animation-delay: 0.16s;
}

.link-btn:nth-child(3) {
    animation-delay: 0.24s;
}

.link-btn:nth-child(4) {
    animation-delay: 0.32s;
}

.link-btn:nth-child(5) {
    animation-delay: 0.40s;
}

/* ============================================================
   TOMBOL ORBITAL (FAQ & About)
   ============================================================ */
.orbit-btn {
    position: absolute;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 4px solid var(--color-dark);
    background: var(--color-primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 0 2px #fff, 0 4px 0 var(--color-dark);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    z-index: 5;
    padding: 0;
    line-height: 1;
    user-select: none;
    pointer-events: auto;
    text-shadow: 0 1px 0 rgba(0,0,0,0.2);
}

.orbit-btn:hover {
    transform: scale(1.12);
    box-shadow: 0 0 0 3px #fff, 0 6px 0 var(--color-dark);
    background: #cc0000;
}

.orbit-btn:active {
    transform: scale(0.92);
    box-shadow: 0 0 0 2px #fff, 0 2px 0 var(--color-dark);
}

/* Warna berbeda untuk About (biru) agar distinguishable */
.orbit-btn.about-btn {
    background: #1e3a8a;   /* biru tua */
    border-color: #0f172a;
    box-shadow: 0 0 0 2px #fff, 0 4px 0 #0f172a;
}

.orbit-btn.about-btn:hover {
    background: #1e40af;
    box-shadow: 0 0 0 3px #fff, 0 6px 0 #0f172a;
}

.orbit-btn.about-btn:active {
    box-shadow: 0 0 0 2px #fff, 0 2px 0 #0f172a;
}

/* Ikon kecil di dalam tombol */
.orbit-btn .orbit-icon {
    font-size: 1.1rem;
    line-height: 1;
}

/* Responsif tombol */
@media (max-width: 480px) {
    .orbit-btn {
        width: 36px;
        height: 36px;
        font-size: 0.6rem;
        border-width: 3px;
    }
    .orbit-btn .orbit-icon {
        font-size: 0.9rem;
    }
}

@media (max-width: 380px) {
    .orbit-btn {
        width: 30px;
        height: 30px;
        font-size: 0.5rem;
        border-width: 2px;
    }
    .orbit-btn .orbit-icon {
        font-size: 0.75rem;
    }
}

/* ============================================================
   OVERLAY MODAL
   ============================================================ */
.overlay-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 2rem;
    animation: fadeInOverlay 0.25s ease;
}

.overlay-content {
    max-width: 480px;
    width: 100%;
    background: var(--color-white);
    border: var(--border-thick);
    border-radius: var(--radius);
    box-shadow: var(--shadow-heavy);
    padding: 2rem 1.8rem;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUpOverlay 0.3s ease;
}

.overlay-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: transparent;
    border: none;
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-dark);
    cursor: pointer;
    line-height: 1;
    transition: transform 0.15s ease;
}

.overlay-close:hover {
    transform: rotate(90deg) scale(1.1);
}

#overlayBody {
    font-size: 1rem;
    line-height: 1.6;
}

#overlayBody h2 {
    font-size: 1.6rem;
    margin-bottom: 0.8rem;
    color: var(--color-dark);
    border-bottom: 4px solid var(--color-dark);
    padding-bottom: 0.4rem;
}

#overlayBody p {
    margin: 0.8rem 0;
}

#overlayBody .faq-item {
    margin: 1.2rem 0;
}

#overlayBody .faq-item strong {
    display: block;
    font-size: 1.05rem;
    color: var(--color-primary);
}

#overlayBody .faq-item span {
    display: block;
    margin-top: 0.2rem;
    padding-left: 0.5rem;
    border-left: 4px solid var(--color-primary);
    opacity: 0.9;
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUpOverlay {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Responsif overlay */
@media (max-width: 480px) {
    .overlay-content {
        padding: 1.5rem 1.2rem;
    }
    #overlayBody h2 {
        font-size: 1.3rem;
    }
    #overlayBody {
        font-size: 0.9rem;
    }
}

.coming-soon {
  display: inline-block;
  padding: 0.3rem 1rem;
  background: #e2e8f0;
  border: 4px solid #64748b;
  border-radius: 40px;
  font-weight: 700;
  font-size: 0.85rem;
  color: #475569;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-light);
  text-transform: uppercase;
  opacity: 0.8;
}

.coming-soon-desc {
  margin: 0.5rem 0 0.8rem 0;
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-primary);
  background: #fff5f5;
  padding: 0.3rem 0.8rem;
  border: 3px dashed var(--color-primary);
  border-radius: 40px;
  display: inline-block;
  box-shadow: var(--shadow-light);
  letter-spacing: 0.02em;
}

.version-badge {
    display: inline-block;
    background: #2563eb;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.1rem 0.6rem;
    border-radius: 40px;
    margin-left: 0.5rem;
    vertical-align: middle;
    border: 2px solid #1e3a8a;
    box-shadow: 0 2px 0 #1e3a8a;
    letter-spacing: 0.02em;
}