/* ==========================================================================
   StoneSmartAI – Base Styles (Split CSS)
   BASE ONLY: Variables, Theme, Reset, Generic UI.
   NO chat/sidebar/header/footer rules here.
   ========================================================================== */

/* ---------- Variables & Themes ---------- */
:root{
  --headerH: 64px;
  --footerH: 120px;
  --radius: 16px;

  --bg: #f7f7f9;
  --text: #0b0f16;
  --muted: #6b7280;

  --card: rgba(255,255,255,0.82);
  --line: rgba(0,0,0,.08);
  --glass: rgba(255,255,255,0.58);

  --primary: #2563eb;
  --primary-2: #1d4ed8;
  --danger: #ef4444;

  --bubble-user: rgba(37,99,235,0.18);
  --bubble-user-text: #0b0f16;

  --bubble-assistant: rgba(255,255,255,0.70);
  --bubble-assistant-text: #0b0f16;

  --shadow: 0 14px 40px rgba(15,23,42,0.10);

  --safeTop: env(safe-area-inset-top, 0px);
  --safeBottom: env(safe-area-inset-bottom, 0px);

  --appH: 100dvh;
}

html[data-theme="dark"]{
  --bg: #0b1220;
  --text: #e5e7eb;
  --muted: #9ca3af;

  --card: rgba(15,23,42,0.55);
  --line: rgba(255,255,255,0.10);
  --glass: rgba(15,23,42,0.50);

  --bubble-user: rgba(37,99,235,0.26);
  --bubble-user-text: #e5e7eb;

  --bubble-assistant: rgba(15,23,42,0.55);
  --bubble-assistant-text: #e5e7eb;

  --shadow: 0 18px 60px rgba(0,0,0,0.35);
}

/* Fallbacks */
@supports not (height: 100dvh){
  :root{ --appH: 100vh; }
}
@supports (-webkit-touch-callout: none){
  :root{ --appH: -webkit-fill-available; }
}

/* ---------- Reset / Base ---------- */
*{ box-sizing:border-box; }
html,body{ height:100%; }
html, body{
  height: 100%;
  overflow: hidden; /* Body scroll AUS */
}

body{
  margin:0;
  color:var(--text);
  font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:
    radial-gradient(900px 600px at 10% 0%, rgba(37,99,235,.12), transparent 60%),
    radial-gradient(800px 600px at 90% 10%, rgba(16,185,129,.10), transparent 60%),
    var(--bg);
}

a{ color:inherit; text-decoration:none; }
img{ max-width:100%; height:auto; }

/* ---------- Generic Glass ---------- */
.glass{
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

/* ---------- Generic Controls ---------- */
.btn{
  appearance:none;
  border:1px solid var(--line);
  background: rgba(255,255,255,0.55);
  color: var(--text);
  border-radius: 14px;
  padding: 10px 12px;
  cursor:pointer;
  box-shadow: var(--shadow);
  transition: transform .12s ease, filter .12s ease;
}
html[data-theme="dark"] .btn{ background: rgba(30,41,59,0.55); }
.btn:hover{ filter: brightness(1.05); transform: translateY(-1px); }
.btn:active{ transform: translateY(0); }

.select{
  padding:10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.55);
  color: var(--text);
  box-shadow: var(--shadow);
}
html[data-theme="dark"] .select{ background: rgba(30,41,59,0.55); }

.label{ font-size:12px; color: var(--muted); }
