:root{
  --bg: #f7f9ff;
  --card: rgba(255,255,255,.86);
  --text: #0b1220;
  --muted: #55607a;
  --line: rgba(15,23,42, 0.10);
  --primary: #2563eb;
  --cyan: #06b6d4;
  --violet: #7c3aed;
  --pink: #ec4899;
  --radius: 18px;
  --shadow: 0 14px 40px rgba(15,23,42,.10);
}

/* Base */
*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 520px at 12% -10%, rgba(6,182,212,.28), transparent 58%),
    radial-gradient(880px 520px at 95% 5%, rgba(124,58,237,.22), transparent 55%),
    radial-gradient(820px 520px at 65% 115%, rgba(236,72,153,.20), transparent 58%),
    linear-gradient(180deg, #f7f9ff 0%, #f3f6ff 55%, #f8fbff 100%);
}

/* TOPBAR (TITLE UTAMA) */
.topbar{
  max-width: 1120px;
  margin: 0 auto;
  padding: 34px 18px 8px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.brand{
  display:flex;
  flex-direction:column;
  gap:4px;
  align-items:center;
  text-align:center;
}

.brand-title{
  font-weight: 950;
  letter-spacing:.26em;
  font-size: 28px;
  line-height: 1.05;
  text-transform:uppercase;
  background: linear-gradient(90deg, var(--primary), var(--violet), var(--cyan), var(--pink));
  -webkit-background-clip:text;
  background-clip:text;
  color: transparent;
  filter: drop-shadow(0 16px 30px rgba(124,58,237,.18));
}

.brand-sub{
  font-size: 15px;
  font-weight: 700;
  letter-spacing:.10em;
  text-transform:uppercase;
  color: rgba(15,23,42,.72);
}

/* PAGE */
.page{
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 18px 40px;
  min-height: 100vh;
}

/* HERO */
.hero{
  text-align:center;
  padding: 10px 0 16px;
}

.hero-title{
  margin: 0;
  font-size: 0;
  line-height: 0;
}

/* ICON BAR */
.hero-iconbar{
  display:inline-flex;
  gap:14px;
  padding: 10px 18px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 15% 10%, rgba(236,72,153,.26), transparent 55%),
    radial-gradient(circle at 85% 30%, rgba(6,182,212,.24), transparent 55%),
    radial-gradient(circle at 55% 110%, rgba(124,58,237,.20), transparent 60%),
    rgba(255,255,255,.70);
  border: 1px solid rgba(15,23,42,.10);
  box-shadow: 0 22px 60px rgba(15,23,42,.14), 0 0 0 1px rgba(255,255,255,.55) inset;
  backdrop-filter: blur(10px);
}

/* ICON BUTTONS */
.icon-btn{
  -webkit-appearance:none;
  appearance:none;
  border:1px solid transparent;
  outline:none;
  width:42px;
  height:42px;
  border-radius:999px;
  background: radial-gradient(circle at 30% 0%, rgba(255,255,255,.90), rgba(255,255,255,.55));
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:20px;
  text-decoration:none;
  opacity:.95;
  box-shadow: 0 10px 22px rgba(15,23,42,.10);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, filter .15s ease;
}

button.icon-btn{
  padding:0;
  font:inherit;
}

.icon-btn i{
  pointer-events:none;
  line-height:1;
}

.icon-home i{ color:#0ea5e9; }
.icon-image i{ color:#06b6d4; }
.icon-puzzle i{ color:#84cc16; }
.icon-video i{ color:#a855f7; }
.icon-light i{ color:#f59e0b; }
.icon-gear i{ color:#334155; }

.icon-btn:hover{
  transform: translateY(-2px);
  filter: saturate(1.05);
  border-color: rgba(37,99,235,.22);
  box-shadow: 0 16px 34px rgba(15,23,42,.14), 0 0 0 4px rgba(6,182,212,.08);
}

.icon-btn.active{
  background:
    radial-gradient(circle at 20% 0%, rgba(6,182,212,.26), transparent 55%),
    radial-gradient(circle at 80% 30%, rgba(124,58,237,.22), transparent 55%),
    radial-gradient(circle at 30% 120%, rgba(236,72,153,.18), transparent 58%),
    rgba(255,255,255,.78);
  border-color: rgba(37,99,235,.28);
  box-shadow: 0 18px 40px rgba(37,99,235,.14), 0 0 0 1px rgba(255,255,255,.65) inset;
}

/* PANEL WRAPPER */
.panel-wrapper{
  margin-top: 22px;
}

.card{
  background: var(--card);
  border: 1px solid rgba(15,23,42,.10);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
  backdrop-filter: blur(10px);
}

/* FEATURE SUMMARY CARD */
.feature-card{
  margin-bottom: 18px;
}

.feature-head{
  display:flex;
  justify-content: space-between;
  align-items:center;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(15,23,42,.08);
  background:
    radial-gradient(900px 120px at 10% 0%, rgba(6,182,212,.18), transparent 65%),
    radial-gradient(900px 120px at 90% 0%, rgba(124,58,237,.16), transparent 65%),
    linear-gradient(90deg, rgba(37,99,235,.10), rgba(124,58,237,.08), rgba(6,182,212,.10));
}

.feature-title{
  font-weight: 950;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: 12px;
  color: rgba(11,18,32,.88);
}

.feature-badge{
  font-size: 12px;
  color: rgba(11,18,32,.72);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.70);
  border: 1px solid rgba(15,23,42,.10);
  box-shadow: 0 10px 18px rgba(15,23,42,.08);
}

.feature-grid{
  padding: 14px 16px 18px;
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.feature-item{
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 14px 30px rgba(15,23,42,.08);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.feature-item:hover{
  transform: translateY(-2px);
  border-color: rgba(124,58,237,.18);
  box-shadow: 0 22px 44px rgba(15,23,42,.10);
}

.feature-ico{
  font-size: 20px;
  width: 40px;
  height: 40px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius: 12px;
  background:
    radial-gradient(circle at 25% 20%, rgba(6,182,212,.22), transparent 60%),
    radial-gradient(circle at 80% 30%, rgba(124,58,237,.20), transparent 60%),
    linear-gradient(135deg, rgba(37,99,235,.14), rgba(236,72,153,.10));
  border: 1px solid rgba(15,23,42,.08);
  color:#0b1220;
}

.feature-ico i{
  pointer-events:none;
}

.feature-name{
  margin-top: 10px;
  font-weight: 850;
  font-size: 13px;
  color: rgba(11,18,32,.92);
}

.feature-desc{
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

/* PANEL HEADERS */
.panel-head{
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(15,23,42,.08);
  background:
    radial-gradient(1000px 140px at 15% 0%, rgba(236,72,153,.14), transparent 62%),
    radial-gradient(1000px 140px at 85% 0%, rgba(6,182,212,.14), transparent 62%),
    linear-gradient(90deg, rgba(37,99,235,.10), rgba(124,58,237,.08), rgba(6,182,212,.10));
}

.panel-title{
  font-weight: 950;
  font-size: 15px;
  color: rgba(11,18,32,.92);
}

.panel-sub{
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted);
}

.panel-body{
  padding: 14px 16px 16px;
  font-size: 13px;
  color: var(--muted);
}

/* Buttons */
.main-btn{
  padding: 12px 16px;
  border: 0;
  border-radius: 999px;
  cursor:pointer;
  font-weight: 950;
  color: #fff;
  background: linear-gradient(90deg, var(--primary), var(--violet), var(--pink));
  box-shadow: 0 18px 45px rgba(124,58,237,.20);
}

.copy-btn{
  margin-left: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(37,99,235,.18);
  background: rgba(255,255,255,.86);
  cursor:pointer;
  font-weight: 900;
  font-size: 12px;
  color: rgba(37,99,235,.95);
}

/* VEO submit button */
.veo-submit{
  width: 100%;
  padding: 12px 16px;
  border: 0;
  border-radius: 999px;
  cursor:pointer;
  font-weight: 950;
  font-size: 13px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(90deg, var(--primary), var(--violet), var(--pink));
  box-shadow: 0 18px 45px rgba(124,58,237,.20);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

/* IDEA LIST */
.idea-list{
  margin-top: 12px;
  max-height: 520px;
  overflow:auto;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(10px);
}
.idea-list::-webkit-scrollbar{
  width: 0;
  height: 0;
}
.idea-item{
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 10px;
  padding: 10px 10px;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 14px;
  background: rgba(255,255,255,.90);
  margin-bottom: 8px;
}

.idea-text{
  font-size: 13px;
  color: rgba(11,18,32,.90);
}

.idea-check{
  width: 16px;
  height: 16px;
  accent-color: var(--violet);
}

.idea-empty{
  padding: 18px;
  text-align:center;
  color: var(--muted);
  font-size: 13px;
}

/* BAR TOMBOL IDEA LIST */
.idea-actions{
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.idea-actions .action-center{
  grid-column: 2;
  justify-self: center;
}

.idea-actions .action-right{
  grid-column: 3;
  justify-self: end;
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

/* hilangkan margin-left default untuk copy-btn di dalam idea-actions */
.idea-actions .copy-btn{
  margin-left: 0;
}

/* Modal */
.modal-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(2,6,23,.45);
  display:none;
  align-items:center;
  justify-content:center;
  padding: 18px;
  z-index: 9999;
  box-sizing: border-box;
}

.modal-backdrop.show{
  display:flex;
}

.modal{
  box-sizing:border-box;
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  background: rgba(255,255,255,.92);
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(15,23,42,.35);
  border: 1px solid rgba(255,255,255,.22);
  overflow:hidden;
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
}

.modal-head{
  padding: 14px 16px 10px;
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  border-bottom: 1px solid rgba(15,23,42,.08);
  background: linear-gradient(120deg, rgba(37,99,235,.10), rgba(6,182,212,.08));
  flex-shrink: 0;
}

.modal-title{
  font-size: 16px;
  font-weight: 950;
  color: rgba(11,18,32,.92);
}

.modal-sub{
  font-size: 13px;
  color: #6b7280;
  margin-top: 2px;
}

.modal-close{
  border: 0;
  background: transparent;
  cursor:pointer;
  font-size: 18px;
  line-height: 1;
  color: #6b7280;
  padding: 2px 4px;
}

/* Form */
.field-label{
  display:block;
  margin: 10px 0 6px;
  font-size: 12px;
  font-weight: 950;
  color: rgba(11,18,32,.70);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.field{
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(15,23,42,.12);
  padding: 10px 10px;
  font-size: 13px;
  outline: none;
  background: rgba(255,255,255,.92);
  min-height: 38px;
}

/* textarea 20 tema – tinggi tetap + scrollbar disembunyikan */
#themes_input{
  resize: vertical;
  min-height: 120px;
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: none;      /* Firefox */
  -ms-overflow-style: none;   /* IE/Edge lama */
}
#themes_input::-webkit-scrollbar{
  width: 0;
  height: 0;
}

/* form dalam modal (scroll) */
.settings-form{
  padding: 12px 16px 14px;
  overflow-y: auto;
  max-height: calc(88vh - 70px);
}

/* textarea API key */
#apikey{
  resize: vertical;
  min-height: 80px;
  max-height: 200px;
  line-height: 1.4;
}

/* tombol Save API */
.settings-btn{
  width: 100%;
  margin-top: 10px;
  padding: 11px 14px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(90deg, var(--primary), var(--violet), var(--pink));
  box-shadow: 0 14px 32px rgba(37,99,235,.30);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease, opacity .15s ease;
}

.settings-btn:hover{
  transform: translateY(-1px);
  filter: saturate(1.05);
  box-shadow: 0 18px 40px rgba(37,99,235,.34);
  opacity: .98;
}

.settings-btn:active{
  transform: translateY(0);
  box-shadow: 0 10px 24px rgba(37,99,235,.26);
  opacity: .95;
}

.keys-small{
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed rgba(15,23,42,.15);
  font-size: 12px;
  line-height: 1.5;
}

/* ============================
   HASIL ANALISIS – BOX PER RANK
   ============================ */

.analysis-wrapper{
  margin-top: 18px;
}

/* Frame card hasil */
.analysis-card{
  margin-top: 8px;
  padding: 12px 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(148,163,184,.45);
  background: rgba(255,255,255,.96);
  box-shadow: 0 12px 28px rgba(15,23,42,.10);
}

/* Scroll hanya di dalam card hasil, scrollbar disembunyikan */
.analysis-scroll{
  height: 360px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;      /* Firefox */
  -ms-overflow-style: none;   /* IE/Edge lama */
}
.analysis-scroll::-webkit-scrollbar{
  width: 0;
  height: 0;
}

/* Box per Rank */
.analis-item{
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,.55);
  background: rgba(255,255,255,.98);
  margin-bottom: 10px;
  box-shadow: 0 10px 24px rgba(15,23,42,.08);
  padding: 0;
  overflow:hidden;
}

/* Header: "Rank: 1" */
.analis-title{
  margin: 0;
  padding: 10px 12px;
  font-weight: 900;
  color: rgba(15,23,42,.92);
  border-bottom: 1px solid rgba(148,163,184,.45);
  background: linear-gradient(90deg, rgba(37,99,235,.08), rgba(124,58,237,.06), rgba(6,182,212,.08));
}

/* Baris isi sejajar: Label : Value */
.analis-row{
  display: grid;
  grid-template-columns: 170px 14px 1fr;
  gap: 0;
  padding: 6px 12px;
  font-size: 13px;
  color: #475569;
  border-top: 1px solid rgba(148,163,184,.18);
  align-items: start;
}

.analis-k{
  font-weight: 700;
  color: rgba(15,23,42,.80);
  white-space: nowrap;
}

.analis-sep{
  text-align: center;
  color: rgba(15,23,42,.45);
  font-weight: 700;
}

.analis-v{
  color: #475569;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

/* Mobile: label jadi di atas */
@media (max-width: 520px){
  .analis-row{
    grid-template-columns: 1fr;
  }
  .analis-sep{
    display:none;
  }
  .analis-k{
    white-space: normal;
  }
}

/* Isi: "Tema: ...", "Trend: ...", dst */
.analis-cell{
  margin: 0;
  padding: 6px 12px;
  font-size: 13px;
  color: #475569;
  border-top: 1px solid rgba(148,163,184,.18);
}

/* fallback paragraf */
.analis-p{
  margin: 0;
}

/* List bullet (kalau ada) */
.analis-list{
  margin: 6px 0 6px 22px;
  padding: 0;
}

.analis-list li{
  font-size: 13px;
  color: #55607a;
  margin-bottom: 3px;
}

/* Tabel (jika model kadang pakai markdown table) */
.analis-table-wrap{
  margin: 6px 12px;
  overflow-x:auto;
}

.analis-table{
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.analis-table th,
.analis-table td{
  padding: 4px 6px;
  border: 1px solid rgba(148,163,184,.45);
}

.analis-table th{
  background: rgba(37,99,235,.06);
  font-weight: 800;
}

/* Bar tombol bawah */
.analysis-actions{
  margin-top: 10px;
  display:flex;
  gap: 8px;
  justify-content:flex-end;
}

/* Loading */
.loading-overlay{
  position: fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  flex-direction: column;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(8px);
  z-index: 9998;
}

.loading-overlay.show{
  display:flex;
}

.spinner{
  width: 44px;
  height:44px;
  border-radius: 999px;
  border: 3px solid rgba(124,58,237,.18);
  border-top-color: rgba(37,99,235,.95);
  animation: spin .85s linear infinite;
}

.loading-text{
  margin-top: 12px;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(11,18,32,.72);
}

@keyframes spin{
  to{
    transform: rotate(360deg);
  }
}

/* Responsive */
@media (max-width: 520px){
  .brand-title{ font-size: 22px; }
  .brand-sub{ font-size: 13px; }
  .hero-iconbar{ padding:8px 12px; gap:8px; }
  .feature-grid{ grid-template-columns: 1fr; }
  .icon-btn{ width:40px; height:40px; }

  .idea-actions{
    grid-template-columns: 1fr;
  }

  .idea-actions .action-center{
    grid-column: 1;
    justify-self: stretch;
  }

  .idea-actions .action-right{
    grid-column: 1;
    justify-self: stretch;
    justify-content: space-between;
  }

  .modal{
    max-width: 100%;
    max-height: 92vh;
  }

  .settings-form{
    max-height: calc(92vh - 70px);
    padding: 10px 14px 12px;
  }

  .modal-title{ font-size: 15px; }
  .modal-sub{ font-size: 12px; }
}

/* GLOBAL: sembunyikan semua scrollbar, tapi tetap bisa scroll */

/* Firefox */
* {
  scrollbar-width: none;
}

/* IE/Edge lama */
* {
  -ms-overflow-style: none;
}

/* WebKit (Chrome, Edge baru, Safari) */
*::-webkit-scrollbar {
  width: 0;
  height: 0;
}
