:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #1a1a1a;
  --bg-card: #222;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --accent: #555;
  --border: #333;
  --input-bg: #2a2a2a;
  --hover: #2d2d2d;
}

[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-card: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #6c757d;
  --accent: #7cb342;
  --border: #e0e0e0;
  --input-bg: #f5f5f5;
  --hover: #f0f0f0;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
*::-webkit-scrollbar {
  display: none;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
}

.navbar {
  background: transparent;
  border-bottom: none;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary) !important;
  letter-spacing: 1px;
}

.theme-toggle {
  background: var(--input-bg);
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-right: 1rem;
}

.theme-toggle:hover {
  background: var(--hover);
  transform: scale(1.05);
}

.btn-signup {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.5rem 1.5rem;
  border-radius: 25px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-signup:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .btn-signup {
  background: var(--accent);
}

.hero-section {
  padding: 3rem 0 2rem;
  text-align: center;
}

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

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.report-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  max-width: 700px;
  margin: 0 auto 3rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.form-label {
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.required-mark {
  color: #ff4444;
}

.form-control,
.form-select,
textarea {
  background: var(--input-bg);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus,
textarea:focus {
  background: var(--input-bg);
  border-color: var(--accent);
  color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(124, 179, 66, 0.1);
}

textarea.form-control {
  min-height: 150px;
  resize: vertical;
}

.radio-group {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.radio-option {
  flex: 1;
  position: relative;
}

.radio-option input[type="radio"] {
  position: absolute;
  opacity: 0;
}

.radio-label {
  display: block;
  background: var(--input-bg);
  border: 2px solid var(--border);
  padding: 1rem;
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.radio-option input[type="radio"]:checked + .radio-label {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.radio-label:hover {
  background: var(--hover);
}

.file-upload {
  position: relative;
  overflow: hidden;
  display: inline-block;
  width: 100%;
}

.file-upload input[type="file"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.file-upload-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--input-bg);
  border: 2px dashed var(--border);
  padding: 1.5rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-secondary);
}

.file-upload-label:hover {
  border-color: var(--accent);
  background: var(--hover);
}

.btn-submit {
  background: var(--accent);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1.1rem;
  width: 100%;
  transition: all 0.3s ease;
  margin-top: 1rem;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(246, 246, 246, 0.3);
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }

  .report-card {
    padding: 1.5rem;
    border-radius: 15px;
  }

  .radio-group {
    flex-direction: column;
  }

  .navbar-brand {
    font-size: 1.25rem;
  }
}

.navbar-toggler {
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.navbar-toggler:focus {
  box-shadow: none;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.7)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

[data-theme="light"] .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(0, 0, 0, 0.7)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.mb-3 {
  margin-bottom: 1.5rem !important;
}

/* Right fixed icon-only sidebar */
.right-sidebar {
  position: fixed;
  right: 0;
  top: 0;
  height: 100vh;
  width: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1050;
  pointer-events: auto;
}

.right-nav {
  background: var(--bg-card);
  border-radius: 12px 0 0 12px;
  width: 56px;
  height: calc(100vh - 32px);
  margin: 16px 8px;
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.right-nav .nav-item {
  color: var(--text-secondary);
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  text-decoration: none;
  transition: background-color 120ms ease, color 120ms ease,
    transform 120ms ease;
}

.right-nav .nav-item + .nav-item {
  margin-top: 10px;
}

.right-nav .nav-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  transform: translateY(-3px);
}

.right-nav .nav-item.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.right-nav .nav-spacer {
  flex: 1 1 auto;
}

/* brief visual click effect on icons (very fast) */
.right-nav .nav-item.nav-click {
  background: rgba(255, 255, 255, 0.08);
}

/* --- MOBILE BOTTOM NAVIGATION (Instagram Style) --- */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px; /* Tinggi standar mobile nav */
  background-color: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around; /* Bagi rata jarak icon */
  align-items: center;
  z-index: 1050; /* Di atas konten lain */
  padding-bottom: env(safe-area-inset-bottom); /* Untuk iPhone X ke atas */
  backdrop-filter: blur(10px); /* Efek blur transparan dikit */
}

.bottom-nav .nav-item {
  color: var(--text-secondary);
  font-size: 1.2rem;
  padding: 10px;
  border-radius: 50%;
  transition: color 0.2s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

/* State Aktif (Sedang dibuka) */
.bottom-nav .nav-item.active {
  color: var(--text-primary); /* Jadi putih/hitam */
}

.bottom-nav .nav-item.active i {
  /* Opsional: Icon jadi agak tebal/solid kalau active */
  text-shadow: 0 0 10px rgba(255,255,255,0.3); 
}

/* Avatar Khusus Mobile (Kecil) */
.mobile-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.mobile-avatar-default {
    width: 28px;
    height: 28px;
    background: #333;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Highlight border avatar kalau sedang di halaman profile */
.bottom-nav .nav-item.active .mobile-avatar {
    border: 2px solid var(--text-primary);
}

/* --- ADJUST CONTENT PADDING --- */
/* Penting: Beri jarak di bawah konten utama agar tidak tertutup navbar */
@media (max-width: 768px) {
  body {
    padding-bottom: 70px; /* 60px navbar + 10px space */
  }
  
  /* Sembunyikan sidebar desktop secara paksa jika bootstrap class gagal */
  .right-sidebar {
    display: none !important;
  }
}

@media (min-width: 769px) {
  /* Sembunyikan bottom nav di desktop */
  .bottom-nav {
    display: none !important;
  }
}

@media (max-width: 769px) {
  .right-sidebar {
    display: none;
  }
}

/* Profile avatar in sidebar */
.profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
}

/* Report post styling */
.report-post {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.report-post .card-body {
  padding: 1rem 1.25rem;
}
.report-post .card-title {
  font-size: 1.05rem;
  margin-bottom: 0;
}
.report-description {
  color: var(--text-secondary);
}

/* Reaction buttons */
.btn-reaction {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-primary);
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  box-shadow: none !important; 
  outline: none !important;
}


.btn-reaction:focus,
.btn-reaction:active,
.btn-reaction:focus-visible {
    border-color: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    background-color: rgba(255, 255, 255, 0.05); /* Efek tekan halus */
}
.btn-reaction:hover {
  background: rgba(255, 255, 255, 0.03);
  transform: translateY(-2px);
}
.btn-reaction.active {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

/* Auth modal overlay (ChatGPT-style) */
.auth-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2000;
}
.auth-modal {
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 1.5rem;
  border-radius: 12px;
  width: min(420px, 90%);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  text-align: center;
  position: relative; /* ensure absolute children like .auth-close are positioned inside */
}
.auth-close {
  position: absolute;
  right: 1rem;
  top: 1rem;
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: var(--text-secondary);
  cursor: pointer;
}

/* --- PAKSA KARTU SELALU GELAP (HYBRID STYLE) --- */

.report-post {
  /* Selalu gunakan warna gelap, tidak peduli tema website apa */
  background-color: #222 !important; 
  border: 1px solid #333 !important;
  color: #ffffff !important; /* Teks Selalu Putih */
}

/* Paksa Judul, Paragraf, dan Heading jadi Putih */
.report-post h5,
.report-post .card-title,
.report-post p,
.report-post .lead,
.report-post strong,
.report-post span {
  color: #ffffff !important;
}

/* Paksa Teks Sekunder (Tanggal/Kategori) jadi Abu terang */
.report-post .text-muted,
.report-post .text-secondary,
.report-post .small {
  color: #b0b0b0 !important; 
}

/* --- BAGIAN REACTION (YANG TADI BERMASALAH) --- */
.btn-reaction {
  background: transparent;
  border: 1px solid transparent;
}

/* Paksa Ikon dan Angka Selalu Putih/Terang */
.btn-reaction i, 
.btn-reaction span {
  color: #e0e0e0 !important; /* Putih agak abu dikit biar ga sakit mata */
  font-weight: 600;
}

/* Saat Hover */
.btn-reaction:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
}

/* Saat Aktif */
.btn-reaction.active span,
.btn-reaction.active i {
  color: #ffffff !important;
}

/* Link Attachment */
.attachment-list a {
    color: #4ade80 !important; /* Hijau terang biar kontras di hitam */
}

/* --- CHAT WELCOME BUBBLE --- */
.chat-bubble {
    position: fixed;
    z-index: 1060; /* Di atas navbar/sidebar */
    background: var(--accent); /* Warna hijau/aksen tema */
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    max-width: 200px;
    font-size: 0.9rem;
    animation: floatBubble 3s ease-in-out infinite;
    display: none; /* Hidden default, dimunculkan JS */
}

.chat-bubble-content {
    position: relative;
}

.close-bubble {
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.8;
}

.close-bubble:hover { opacity: 1; }

/* ANIMASI NAIK TURUN */
@keyframes floatBubble {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* --- POSISI DESKTOP (Sidebar Kanan) --- */
@media (min-width: 769px) {
    .chat-bubble {
        right: 80px; /* Di sebelah kiri sidebar */
        top: 140px;  /* Sesuaikan dengan tinggi ikon robot di sidebar */
    }
    
    /* Panah menghadap Kanan (ke Sidebar) */
    .chat-bubble::after {
        content: '';
        position: absolute;
        right: -8px;
        top: 41%;
        transform: translateY(-50%);
        border-width: 8px 0 8px 8px;
        border-style: solid;
        border-color: transparent transparent transparent var(--accent);
    }
}

/* --- POSISI MOBILE (Bottom Nav) --- */
@media (max-width: 768px) {
    .chat-bubble {
        bottom: 75px; /* Di atas bottom nav */
        left: 62%;    /* Tengah layar (karena ikon robot di tengah) */
        transform: translateX(-50%); /* Center alignment */
        animation: none; /* Matikan float biar ga pusing di HP */
    }

    /* Panah menghadap Bawah (ke Bottom Nav) */
    .chat-bubble::after {
        content: '';
        position: absolute;
        bottom: -8px;
        left: 50%;
        transform: translateX(-50%);
        border-width: 8px 8px 0 8px;
        border-style: solid;
        border-color: var(--accent) transparent transparent transparent;
    }
}
/* Tambahan untuk animasi hilang */
.chat-bubble.fade-out {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 1s ease, transform 1s ease;
    pointer-events: none; /* Agar tidak bisa diklik pas lagi menghilang */
}

/* Cursor kedip-kedip ala ketikan (Opsional) */
#typewriter-text::after {
    content: '|';
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* --- GEMINI STYLE CHATBOT --- */

.chat-layout {
    height: 100vh;
    background-color: var(--bg-primary);
    overflow: hidden; /* Biar ga ada scroll body */
}

/* Gradient Text (Hello User) */
.gemini-greeting {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -1px;
    background: linear-gradient(90deg, #4285F4, #9B72CB, #F86868); /* Warna Google/Gemini */
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent; /* Agar gradient terlihat */
}

@media (max-width: 768px) {
    .gemini-greeting { font-size: 2.2rem; }
}

/* Chips (Tombol Saran) */
.gemini-chip {
    background-color: var(--input-bg);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: 16px; /* Pill Shape */
    cursor: pointer;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    min-width: 140px;
    justify-content: center;
}

.gemini-chip:hover {
    background-color: var(--hover);
    transform: translateY(-2px);
    border-color: var(--text-secondary);
}

/* Chat History Area */
.chat-history {
    flex-grow: 1;
    overflow-y: auto;
    scroll-behavior: smooth;
    max-width: 900px; /* Batasi lebar biar enak dibaca */
    margin: 0 auto;
    /* Hide scrollbar */
    scrollbar-width: none; 
}
.chat-history::-webkit-scrollbar { display: none; }

/* Input Wrapper (Floating) */
.chat-input-wrapper {
    background: transparent; /* Transparan biar nyatu */
    max-width: 850px;
    margin: 0 auto;
}

/* The Input Bar Itself */
.input-container {
    background-color: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 50px; /* Rounded banget */
    padding: 10px 20px;
    display: flex;
    align-items: center;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.input-container:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.1); /* Glow dikit */
}

.gemini-input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    width: 100%;
    font-size: 1rem;
    padding: 5px;
    outline: none;
}

.gemini-send-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.gemini-send-btn:hover {
    background-color: var(--bg-card);
    color: var(--accent);
}

/* Chat Bubbles (Clean Style) */
.message-content {
    line-height: 1.6;
    font-size: 1rem;
}

/* User Bubble (Minimalis) */
.user-message .message-content {
    background-color: var(--input-bg); /* Abu gelap */
    color: var(--text-primary);
    border-radius: 20px;
    padding: 12px 20px;
    max-width: 80%;
    margin-left: auto; /* Rata kanan */
}

/* Bot Bubble (No Background, Just Text + Icon) */
.bot-message {
    align-items: flex-start;
}
.bot-message .message-content {
    background: transparent;
    color: var(--text-primary);
    padding: 5px 0;
    max-width: 90%;
}

.avatar-robot-small {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #00c6ff, #0072ff);
    box-shadow: 0 0 10px rgba(0, 114, 255, 0.4);
}

/* --- TYPING / THINKING ANIMATION --- */
.typing-dots {
    display: inline-flex;
    align-items: center;
    height: 20px;
}

.typing-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--text-secondary); /* Warna abu-abu */
    border-radius: 50%;
    margin: 0 3px;
    opacity: 0.6;
    animation: typingWave 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }
.typing-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes typingWave {
    0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}