/* ==========================================================================
   1. ROOT VARIABLES & GLOBAL STYLES
   ========================================================================== */
:root {
    --color-primary-teal: #14B8A6;
    --color-primary-dark-teal: #0D9488;
    --color-text-dark: #1F2937;
    --color-text-light: #4B5563;
    --color-background-light: #F9FAFB;
    --color-white: #FFFFFF;
    --color-border: #E5E7EB;
    --color-highlight-yellow: #ffc107; /* [DITAMBAHKAN] Variabel untuk highlight kuning */

    --font-primary: 'Montserrat', sans-serif;
    --font-size-base: 16px;
    --border-radius-normal: 16px;
    --border-radius-small: 10px;
    --box-shadow-soft: 0 4px 15px -1px rgba(0, 0, 0, 0.06), 0 2px 8px -2px rgba(0, 0, 0, 0.05);
}

::selection {
    background-color: var(--color-primary-teal);
    color: var(--color-white);
}

::-moz-selection { /* Buat Mozilla Firefox */
    background-color: var(--color-primary-teal);
    color: var(--color-white);
}

/* Reset & Body */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    color: var(--color-text-light);
    background-color: var(--color-background-light);
    line-height: 1.6;
    transition: opacity 0.3s ease-in-out;
}

body.is-translating {
    opacity: 0; /* Sembunyikan HANYA saat sedang menerjemahkan saat load */
}

p{
    color: var(--color-text-dark);
}

.container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

/* [DIRAPIKAN] Kelas utilitas global */
.section-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--color-text-dark);
    text-align: center;
    margin-bottom: 10px;
}

.section-description {
    font-size: 15px;
    font-weight: 400; /* Dibuat lebih tebal agar mudah dibaca */
    line-height: 1.8;
    color: var(--color-text-light);
    text-align: justify;
    margin-bottom: 1rem;
}

.section-description b {
    font-weight: 700;
    color: var(--color-text-dark);
}

.subtitle {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--color-primary-teal);
    margin-bottom: 1.5rem;
}

.text--highlight {
    color: var(--color-primary-teal);
}

.btn {
    display: inline-block;
    background-color: var(--color-primary-teal);
    color: #FFFFFF;
    font-weight: 600;
    font-size: 15px;
    padding: 12px 32px;
    border: none;
    border-radius: var(--border-radius-small);
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: var(--color-primary-dark-teal);
}

.background-text {
    position: absolute;
    font-size: 32px;
    font-weight: 700;
    color: var(--color-border);
    z-index: -1;
    user-select: none;
    letter-spacing: 5px;
    text-transform: uppercase;
}

/* ========================
   STICKY HEADER (BARU)
   ======================== */

.sticky-header {
  position: fixed; /* Menempel di layar */
  right: 16px;
  width: fit-content;
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.95); /* Putih sedikit transparan */
  backdrop-filter: blur(8px); /* Efek blur (opsional, modern) */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08); /* Bayangan lembut */
  margin-top: 20px;
  padding: 10px 0; /* Padding vertikal lebih kecil */
  z-index: 2; /* Pastikan di atas konten lain, tapi di bawah modal/popup jika ada */

  /* State Awal: Tersembunyi */
  opacity: 0;
  visibility: hidden;

  /* Modifikasi transisi agar muncul dari kanan atas (opsional) */
  transform: translateX(50px); 
  transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease;
}

/* State Saat Muncul */
.sticky-header--visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Navigasi di dalam sticky header */
.sticky-header__nav ul {
  list-style: none;
  display: flex;
  justify-content: flex-end; /* Item rata kanan */
  align-items: center;
  gap: 24px; /* Jarak antar item */
  margin: 0;
  padding: 0;
}

/* Menggunakan kembali style link, tapi tanpa border bawah */
.sticky-header__nav .nav__link {
  padding-bottom: 0; 
  border-bottom: none;
  white-space: nowrap
}

/* Style link aktif di sticky header (hanya warna) */
.sticky-header__nav .nav__link--active {
  color: var(--color-primary-teal);
  font-weight: 700;
  border-bottom: none; 
}

/* Tampilan Bahasa Sederhana di Sticky Header */
.sticky-lang-display {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: var(--color-primary-teal); 
  color: white;
  padding: 5px 10px; /* Padding lebih kecil */
  border-radius: 16px;
  font-weight: 600;
  font-size: 0.85rem; /* Font sedikit lebih kecil */
}

.sticky-lang-display img {
  width: 16px; /* Flag lebih kecil */
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
}

/* Dark Mode Adjustment for Sticky Header */
body[data-theme='dark'] .sticky-header {
    background-color: rgba(17, 24, 39, 0.95); /* Warna --color-white dark mode */
    box-shadow: 0 1px 4px rgba(255, 255, 255, 0.1);
}


/* ==========================================================================
   2. HEADER & FOOTER (Komponen Umum)
   ========================================================================== */
/* Header */
.header {
    padding: 24px 0;
    border-bottom: 1px solid var(--color-border);
    background-color: var(--color-white);
}

.header__nav ul {
    list-style: none;
    display: flex;
    justify-content: flex-end;
    gap: 24px;
}

.nav__link {
    text-decoration: none;
    color: var(--color-text-light);
    font-weight: 600;
    font-size: 15px;
    padding-bottom: 8px;
    transition: color 0.3s ease;
    border-bottom: 3px solid transparent;
}

.nav__link:hover {
    color: var(--color-primary-teal);
}

.nav__link--active {
    color: var(--color-primary-teal);
    font-weight: 600;
    border-bottom: 3px solid var(--color-primary-teal);
    padding-bottom: 5px;
}

/* Contact Section */
.contact {
    padding: 96px 0;
    background-color: var(--color-white);
}

.contact__container {
    display: flex;
    align-items: center;
    gap: 80px;
}

.contact__illustration {
    flex: 1;
    transition: transform 0.3s ease;
}

.contact__illustration:hover {
    transform: scale(1.1) rotate(-15deg);
}

.contact__illustration img {
    max-width: 80%;
    height: auto;
}

.contact__form-wrapper {
    flex: 1;
}

.contact__form-wrapper .section-title {
    text-align: left;
    margin-bottom: 36px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--color-text-dark);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 13px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.contact__form input:focus,
.contact__form textarea:focus {
    outline: none;
    border-color: var(--color-primary-teal);
}

/* Footer */
.footer {
    background-color: var(--color-white); /* <-- GANTI DENGAN INI */
    padding: 3rem 0;
    position: relative;
}

.footer__bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--color-primary-teal);
}

.footer__container {
    display: flex;
    align-items: flex-start;
    gap: 130px;
}

.footer__column {
    flex: 1;
}

.footer__column--contact {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
}

.footer__name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-dark);
    margin-bottom: 0.25rem;
}

.footer__location {
    font-size: 0.9rem;
    color: var(--color-text-light);
}

.footer__email {
    color: var(--color-text-dark);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.footer__email:hover {
    color: var(--color-primary-teal);
}

.social-icons {
    display: flex;
    gap: 1rem;
}

.social-icons img {
    width: 24px;
    height: auto;
    transition: transform 0.3s ease;
}

.social-icons a:hover img {
    transform: scale(1.1);
}

.footer__copyright {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-top: 0.5rem;
}


body[data-theme='dark'] {
    --color-text-dark: #F9FAFB;
    --color-text-light: #D1D5DB;
    --color-background-light: #1F2937;
    --color-white: #111827;
    --color-border: #4B5563;
    --box-shadow-soft: 0 4px 15px -1px rgba(255, 255, 255, 0.03), 0 2px 8px -2px rgba(255, 255, 255, 0.02);
}

#scroll-to-top-btn {
    position: static;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--color-primary-teal);
    color: #FFFFFF;
    border-radius: 50%;
    text-decoration: none;
    font-size: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    flex-shrink: 0; /* Mencegah tombol menyusut aneh */
    
    /* State Awal: Tersembunyi */
    opacity: 0;
    visibility: hidden;
    width: 0px; /* Lebar 0 saat tersembunyi */
    transform: translateX(calc(100% + 10px));
    
    /* Transisi untuk semua properti yang berubah */
    transition: opacity 0.4s ease, visibility 0.4s ease, width 0.4s ease, transform 0.4s ease, order 0.4s ease;
}

.bottom-controls {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex; 
  align-items: center; 
  gap: 0px; 
  z-index: 1000;
  transition: transform 0.4s ease, gap 0.4s ease; 
  
  /* Pindahkan style container ini dari CSS Anda sebelumnya ke sini */
  background-color: var(--color-white);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  border-radius: 99px;
  padding: 0.3rem 0.5rem;

  overflow: hidden;
}

body[data-theme='dark'] .bottom-controls {
    /* Ganti background menjadi warna gelap (sesuai --color-white di dark mode) */
    background-color: var(--color-white);
    
    /* Ganti box-shadow hitam menjadi glow putih */
    box-shadow: 0 1px 4px rgba(255, 255, 255, 0.1);
}

.bottom-controls.show-scroll-top #scroll-to-top-btn {
    opacity: 1;
    visibility: visible;
    width: 40px; /* Lebar normal */
    transform: translateX(0); /* Posisi normal */
    order: 2; /* Pindah ke tengah */
}

.bottom-controls.show-scroll-top #bottom-dark-mode-toggle {
    order: 1; 
}

.bottom-controls.show-scroll-top {
    gap: 10px; /* Terapkan gap HANYA saat kedua tombol terlihat */
}

/* Ensure hover effect only applies when visible (redundant but safe) */
#scroll-to-top-btn.visible:hover {
     background-color: var(--color-primary-dark-teal);
}

#scroll-to-top-btn.visible {
    /* State Saat Muncul */
    flex-shrink: 0; 
    transform: scale(1.5); /* Keep your image scale */
}

#scroll-to-top-btn img {
    transform: scale(1.5);
    transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease;
}

#scroll-to-top-btn:hover {
    background-color: var(--color-primary-dark-teal);
}

#scroll-to-top-btn img:hover {
    transform: scale(1.8);
}

/* Transisi Halus untuk Perubahan Tema */
body, .project-card, .contact__illustration img, .card, .contact, 
.hero, .motto, .persona-section, .problem-statement-section, 
.story-section, .prototype-section, .feedback-section, .constraints-section, 
.discover-section, .define-section, .develop-section, .deliver-section {
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

/* ========================
   LANGUAGE DROPDOWN (BARU)
   ======================== */

/* 1. Wadah utama dropdown */
.lang-dropdown {
  position: relative; /* Agar .lang-options bisa diposisikan absolut */
  display: inline-block;
}

/* 2. Tombol bahasa aktif */
.lang-current {
  display: flex;
  align-items: center;
  gap: 8px; /* Jarak antara flag, teks, dan panah */
  background-color: transparent;
  border: 1px solid var(--color-border, #ddd);
  border-radius: 20px; /* Membuat sudut lebih bulat */
  padding: 6px 12px 6px 12px; /* Padding tombol */
  cursor: pointer;
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text-light);
  transition: background-color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap; /* Mencegah teks wrap */
}

.lang-current:hover,
.lang-dropdown.active .lang-current { /* Style saat aktif/hover */
  background-color: var(--color-background-light, #f9fafb); /* Sedikit abu-abu */
  border-color: var(--color-primary-teal, #14B8A6);
}

.lang-current img {
  width: 20px; /* Ukuran flag di tombol */
  height: 20px;
  border-radius: 50%;
  object-fit: cover; /* Jaga aspek rasio bendera */
}

.lang-current i { /* Styling ikon panah */
  font-size: 14px;
  transition: transform 0.3s ease;
}

/* Putar panah saat dropdown aktif */
.lang-dropdown.active .lang-current i {
  transform: rotate(180deg);
}

/* 3. Kontainer opsi dropdown */
.lang-options {
  position: absolute;
  top: calc(100% + 14px); /* Posisi di bawah tombol + sedikit jarak */
  right: 0; /* Rata kanan dengan tombol */
  background-color: var(--color-white, #fff);
  border: 1px solid var(--color-border, #ddd);
  border-radius: 8px;
  box-shadow: var(--box-shadow-soft);
  min-width: 150px; /* Lebar minimum dropdown */
  z-index: 10; /* Pastikan di atas konten lain */
  
  /* Logika Sembunyikan/Tampilkan */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px); /* Efek muncul dari atas */
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

/* Tampilkan dropdown saat .lang-dropdown punya kelas 'active' */
.lang-dropdown.active .lang-options {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 4. Tombol opsi bahasa di dalam dropdown */
.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: transparent;
  border: none;
  width: 100%;
  padding: 10px 15px;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-primary);
  font-size: 0.9rem;
  color: var(--color-text-dark);
  transition: background-color 0.2s ease;
}

.lang-option:hover {
  background-color: var(--color-background-light, #f9fafb); /* Highlight saat hover */
}

.lang-option:first-child {
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}
.lang-option:last-child {
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

.lang-option img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}

/* Gaya untuk Toggle Button */
.theme-toggle-button {
    background-color: white;
    border: 2px solid var(--color-border);
    outline: none;
    cursor: pointer;
    width: 40px; /* Match scroll-to-top size */
    height: 40px; /* Match scroll-to-top size */
    border-radius: 50%;
    font-size: 18px;
    transition: all 0.3s ease;
    /* Remove fixed positioning properties */
    /* bottom: 70px; */
    /* right: 23px; */
    /* position: fixed; */
    /* z-index: 3; */
     display: flex; /* Add flex to center icons */
     align-items: center;
     justify-content: center;
}

.theme-toggle-button .icon-sun {
    display: none; /* Sembunyikan ikon matahari secara default */
    transform: translate(0.5px, -1.2px);
}

.theme-toggle-button .icon-moon {
    display: block; /* Tampilkan ikon bulan di light mode */
    transform: translate(0.5px, -1.2px);
}

body[data-theme='dark'] .theme-toggle-button .icon-sun {
    display: block; /* Tampilkan ikon matahari di dark mode */
}

body[data-theme='dark'] .theme-toggle-button .icon-moon {
    display: none; /* Sembunyikan ikon bulan di dark mode */
}

/* Penyesuaian Header untuk mengakomodasi tombol */
.header__nav ul {
    align-items: center; /* Membuat link dan tombol sejajar */
}

#bottom-dark-mode-toggle {
    position: static; 
    opacity: 1;
    visibility: visible;
    transform: none; 
    /* Tambahkan transisi untuk 'order' agar smooth saat pindah */
    transition: transform 0.4s ease, order 0.4s ease; 
    order: 2; /* State awal: di kiri (atau satu-satunya tombol) */
}

#bottom-dark-mode-toggle:hover {
    transform: rotate(15deg);
    background-color: var(--color-primary-teal); /* Pindahkan background-color hover ke sini */
    border: 2px solid var(--color-primary-teal);
}

/* --- Global Aurora Animation --- */
@keyframes aurora-animation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.bg-aurora {
    position: relative;
    background-color: var(--color-white) !important;
    overflow: hidden;
}

.bg-aurora::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    
    /* PERBAIKAN: 
      Hapus transparent white. Biarkan warnanya penuh dari ujung ke ujung.
      Karena kita punya 'mask-image', bagian atas dan bawah otomatis akan memudar.
    */
    background: linear-gradient(
        -45deg, 
        rgba(20, 184, 166, 0.2) 0%, 
        rgba(99, 102, 241, 0.15) 50%, 
        rgba(20, 184, 166, 0.2) 100%
    );

    background-size: 400% 400%;
    /* Animasi sedikit dilambatkan agar pergerakannya lebih elegan */
    animation: aurora-animation 25s ease infinite; 
    
    /* Masking tetap dipertahankan */
    mask-image: linear-gradient(to bottom, transparent, black 20%, black 80%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 20%, black 80%, transparent);
}

/* Pastikan konten di dalam bg-aurora selalu di atas gradien */
.bg-aurora > * {
    position: relative;
    z-index: 1;
}

@media (max-width: 1071px){
    .contact__illustration {
        display: none;
    }
}

@media (max-width: 768px) {
    .contact__form-wrapper .section-title {
        text-align: center;
    }

    .sticky-header {
        top: auto; /* Hapus 'top' dari desktop */
        right: auto; /* Hapus 'right' dari desktop */
        left: 50%; /* Posisikan di tengah */
        bottom: 16px; /* Jarak dari bawah */
        margin-top: 0; /* Hapus margin-top desktop */

        /* State Awal (Tersembunyi): Mulai dari Bawah */
        opacity: 0;
        visibility: hidden;
        /* Geser 50% lebarnya sendiri ke kiri (untuk center) */
        /* Geser 100px ke bawah (agar tersembunyi di bawah layar) */
        transform: translate(-50%, 100px);
    }

    .sticky-header--visible {
        opacity: 1;
        visibility: visible;
        /* Geser 50% lebarnya sendiri ke kiri (untuk center) */
        /* Geser 0px secara vertikal (ke posisi normal 'bottom: 16px') */
        transform: translate(-50%, 0);
    }

    .sticky-header__nav ul {
        justify-content: center; /* Pusatkan item (ganti dari flex-end) */
        width: 100%; /* Pastikan <ul> mengisi container */
    }

    /* Target <li> pertama (Home) */
    .sticky-header__nav ul li:nth-child(1) {
        order: 2; /* Pindah ke posisi kedua (tengah) */
    }

    /* Target <li> kedua (About Me) */
    .sticky-header__nav ul li:nth-child(2) {
        order: 3; /* Pindah ke posisi ketiga (kanan) */
    }

    /* Target <li> ketiga (Language Dropdown) */
    .sticky-header__nav ul li:nth-child(3) {
        order: 1; /* Pindah ke posisi pertama (kiri) */
    }

    .sticky-header .lang-options {
        top: auto; /* Hapus 'top' */
        bottom: calc(100% + 8px); /* Posisikan di ATAS tombol */
        transform: translateY(100px); /* Animasi dari BAWAH */
        left: 0;
    }

    .bottom-controls.pushed-up {
        /* Geser ke atas sejauh 70px saat sticky header muncul */
        /* Sesuaikan 70px jika tinggi sticky header Anda berbeda */
        transform: translateY(-70px);
    }

    .footer__container {
        flex-direction: column;
        align-items: flex-start;
        gap: 2rem;
    }

    .footer__column--contact {
        text-align: left;
        align-items: flex-start;
    }
}

/* Disable animation for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .bg-aurora::before {
        animation: none;
        /* Kunci di satu posisi warna aja */
        background-position: 50% 50%;
    }
}

/* --- PRINT STYLES --- */
@media print {
    /* Sembunyikan elemen UI yang nggak perlu di kertas */
    .sticky-header, 
    .bottom-controls, 
    #bottom-dark-mode-toggle, 
    #scroll-to-top-btn,
    .header__nav {
        display: none !important;
    }

    /* Paksa background jadi putih dan teks jadi hitam biar tinta nggak boros */
    body {
        background-color: white !important;
        color: black !important;
    }
    
    .project-card, .bg-aurora {
        background: white !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
}
