/* ChatBot That Says Ni
   Clean, fanvue-adjacent vibe with light/dark mode support.
*/

:root{
  --bg1:#edf4ee;
  --bg2:#e6efe7;
  --card:rgba(255, 255, 255, 0.78);
  --text:#000000;
  --muted:#5b7a55;
  --line:rgba(20, 40, 16, 0.12);
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.14);

  --brand1: rgba(22,163,74,.95);
  --brand2: rgba(21,128,61,.85);
  --glow1: rgba(22,163,74,.20);
  --glow2: rgba(21,128,61,.16);

  --btn:#49F264; /* Fanvue official Screamin' Green */
  --btnText:#07130a;
  --btnLine: rgba(17, 40, 16, 0.14);

  --pillBg: rgba(0, 0, 0, 0.04);
  --pillLine: rgba(19, 40, 16, 0.1);

  --radius: 18px;
}

@media (prefers-color-scheme: dark){
  :root{
    /* Base background: near-black, very subtle green bias */
    --bg1:#060807;
    --bg2:#090c0a;
    --card:rgba(14, 18, 15, 0.82);
    --text:#eef6f1;
    --muted:#9bb8a8;
    --line:rgba(255,255,255,0.08);
    --shadow: 0 30px 90px rgba(0,0,0,0.55);
    --brand1: rgba(22,163,74,.95);
    --brand2: rgba(21,128,61,.85);
    --glow1: rgba(73,242,100,0.14);
    --glow2: rgba(73,242,100,0.08);

    --btn:#49F264; /* Fanvue Screamin’ Green */
    --btnText:#07130a; /* almost-black */
    --btnLine: rgba(255,255,255,0.08);

    --pillBg: rgba(255,255,255,0.05);
    --pillLine: rgba(255,255,255,0.10);
  }
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
    "Apple Color Emoji","Segoe UI Emoji";
  color:var(--text);
  background:
    radial-gradient(900px 520px at 18% 10%, var(--glow1), transparent 60%),
    radial-gradient(900px 520px at 82% 10%, var(--glow2), transparent 62%),
    linear-gradient(180deg, var(--bg1), var(--bg2));
}

a{ color:inherit; }

.container{
  min-height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:28px;
}

.wrap{
  width:min(1000px, 100%);
  display:grid;
  gap:16px;
}

.card{
  border:1px solid var(--line);
  background:var(--card);
  backdrop-filter: blur(12px);
  border-radius:var(--radius);
  padding:22px;
  box-shadow: var(--shadow);
}

.top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
}

.brand{
  display:flex;
  gap:12px;
  align-items:center;
}

.logo{
  width:44px;
  height:44px;
  border-radius:14px;
  background: linear-gradient(135deg, var(--brand1), var(--brand2));
  box-shadow: 0 12px 36px rgba(99,102,241,.22);
}

.brand.disconnected .logo{
  background: linear-gradient(135deg, #c53030, #9b2c2c);
  box-shadow: 0 12px 36px rgba(197,48,48,.25);
}
h1.disconnected{ color: #c53030; }

h1{
  margin:0;
  font-size:22px;
  letter-spacing:-0.01em;
}

p{
  margin:10px 0 0;
  color:var(--muted);
  line-height:1.55;
}

.small{ font-size:12px; }
.muted{ color:var(--muted); }
.k{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
}

.grid{
  display:grid;
  gap:14px;
  grid-template-columns: 1.25fr .75fr;
}
@media (max-width: 860px){
  .grid{ grid-template-columns: 1fr; }
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:12px 14px;
  border-radius:12px;
  border:1px solid var(--btnLine);
  background:var(--btn);
  color:var(--btnText);
  text-decoration:none;
  font-weight:650;
  transition: transform .06s ease, opacity .15s ease;
  user-select:none;
}
.btn:hover{ opacity:.94; }
.btn:active{ transform: translateY(1px); }

.btn.secondary{
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid var(--pillLine);
  background:var(--pillBg);
  color:var(--muted);
  font-size:12px;
}

.row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:12px;
}

hr.sep{
  border:0;
  height:1px;
  background: var(--line);
  margin:16px 0;
}

.notice{
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--line);
  background: rgba(99,102,241,.07);
  color: var(--muted);
}

.codeblock{
  margin-top:10px;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.035);
  overflow:auto;
}
@media (prefers-color-scheme: dark){
  .codeblock{ background: rgba(255,255,255,.06); }
}

.welcome{ margin:8px 0 0; font-weight:500; }
.profile-form .form-group{ margin-bottom:1rem; }
.profile-form label{ display:block; margin-bottom:6px; color:var(--muted); }
.profile-form .checkbox-label{ display:flex; align-items:center; gap:8px; margin-bottom:8px; font-weight:500; cursor:pointer; }
.profile-form .checkbox-label input[type="checkbox"]{ flex-shrink:0; accent-color: var(--brand1); }
.profile-form input[type="text"],
.profile-form select{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font: inherit;
}
.profile-form select{ cursor:pointer; accent-color: var(--brand1); }
.profile-form select option{ background: var(--card); color: var(--text); }
.profile-form input:disabled{ opacity:0.6; cursor:not-allowed; }
.profile-form .follow-options{ display:flex; flex-direction:column; gap:8px; margin-top:8px; }
.profile-form textarea{
  width:100%;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font: inherit;
  resize: vertical;
  min-height: 140px;
}
.profile-form .form-actions{ display:flex; align-items:center; gap:12px; margin-top:12px; }
.profile-form .form-actions .btn{ flex-shrink:0; }
.profile-form .form-actions .small{ flex:1; }
.profile-form .form-actions .small.error{ color: #c53030; }

#emoji-usage-wrap .profile-form-select-inline{ width:100%; max-width:360px; margin-top:4px; }
.emoji-grid{ display:flex; flex-wrap:wrap; gap:6px 12px; margin-top:12px; }
.emoji-check{ display:inline-flex; align-items:center; cursor:pointer; font-size:1.1em; }
.emoji-check input{ margin:0 4px 0 0; accent-color: var(--brand1); }
.emoji-check input:disabled{ cursor:not-allowed; opacity:0.6; }

@media (prefers-color-scheme: dark){
  .profile-form select{
    -webkit-appearance: none;
    appearance: none;
    background-color: var(--card) !important;
    color: #eef6f1 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239bb8a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 1.1em;
    padding-right: 2.5em;
  }
  .profile-form select option{
    background: #0e120f !important;
    color: #eef6f1 !important;
  }
  .profile-form select::-ms-value{
    color: #eef6f1 !important;
    background: transparent !important;
  }
  .profile-form .checkbox-label input[type="checkbox"],
  .emoji-check input[type="checkbox"]{
    appearance: none;
    width: 1.15em;
    height: 1.15em;
    border: 2px solid rgba(73, 242, 100, 0.55);
    background: transparent;
    border-radius: 4px;
    flex-shrink: 0;
  }
  .profile-form .checkbox-label input[type="checkbox"]:checked,
  .emoji-check input[type="checkbox"]:checked{
    background: var(--brand1);
    border-color: var(--brand1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Cpath fill='none' stroke='%2307130a' stroke-width='2' d='M1 5l3 3 7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 0.85em;
  }
  .profile-form .checkbox-label input[type="checkbox"]:disabled,
  .emoji-check input[type="checkbox"]:disabled{
    border-color: rgba(255,255,255,0.25);
    background: var(--bg1);
    opacity: 0.7;
  }
  .emoji-check input[type="checkbox"]:checked:disabled{
    background-color: var(--brand1);
    opacity: 0.8;
  }
}
