/* =========================
   base.css (shared styles)
   ========================= */

/* Theme tokens (CSS variables) */
:root{
  --bg:#0b1220;
  --card:#101828;
  --border:#233044;

  --text:#e5e7eb;
  --muted:#cbd5e1;
  --muted2:#94a3b8;

  --accent:#7dd3fc;
  --accent2:#22d3ee;

  --ring: rgba(125,211,252,.35);
  --focus: rgba(125,211,252,.25);
}

/* Reset / base */
*{ box-sizing:border-box; }
html, body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Noto Sans, Ubuntu, Cantarell, Helvetica Neue, Arial;
  color:var(--text);
  background:
    radial-gradient(900px 600px at -10% -20%,rgba(34,211,238,.08),transparent 50%),
    radial-gradient(900px 600px at 120% 0%,rgba(125,211,252,.08),transparent 50%),
    var(--bg);
  line-height:1.5;
}

/* Layout */
.container{
  max-width: 960px;
  margin: 36px auto;
  padding: 0 20px;
  position: relative;
  z-index: 1; /* above particles */
}

/* Card */
.card{
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

/* Typography */
h1{ font-size:1.25rem; margin:0 0 8px 0; }
h2{ font-size:1.05rem; margin:14px 0 6px; }
p{ color:var(--muted); line-height:1.6; margin:8px 0; }
ul{ margin:8px 0 0 18px; color:var(--muted); line-height:1.6; }

.divider{ height:1px; background:var(--border); margin:14px 0 16px; }
.hint{ color:var(--muted2); font-size:.9rem; margin:6px 0 10px; }
code{
  background: rgba(34,211,238,.08);
  border: 1px solid var(--border);
  padding:1px 6px;
  border-radius:6px;
}

/* Header (shared across pages) */
header{
  display:flex;
  align-items:center;
  gap:14px;
  margin-bottom:16px;
}
header img.logo{
  width:40px;
  height:40px;
  object-fit:contain;
  border-radius:8px;
  background:#0f172a;
  padding:6px;
  border:1px solid var(--border);
}
header .brand{ display:flex; flex-direction:column; }
header .brand h1,
header .brand .title{
  font-size:1.05rem;
  font-weight:700;
  margin:0;
  letter-spacing:.2px;
}
header .brand span,
header .brand .sub{
  font-size:.85rem;
  color:#bcd0ff;
  opacity:.9;
}
.header-right{
  margin-left:auto;
  display:flex;
  align-items:center;
  gap:10px;
}
.badge{
  display:inline-block;
  font-size:.78rem;
  padding:3px 8px;
  border-radius:999px;
  border:1px solid var(--border);
  color:#bfdbfe;
  background:#0b1a2e;
}

/* Language toggle */
.lang-toggle{
  display:inline-flex;
  border-radius:999px;
  padding:4px;
  background:#0f172a;
  border:1px solid #3b4a62;
}
.lang-btn{
  border:none;
  background:transparent;
  color:#f1f5f9;
  font-size:.9rem;
  padding:6px 14px;
  border-radius:999px;
  cursor:pointer;
  min-width:60px;
  transition:all .15s ease;
}
.lang-btn:hover{ background:rgba(255,255,255,0.08); }
.lang-btn.active{
  background:linear-gradient(180deg,#1c5a7a,#144056);
  color:#e2f5ff;
  box-shadow:0 0 6px rgba(125,211,252,0.4);
  font-weight:600;
}

/* Buttons */
.actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  margin-top:12px;
}

.btn,
a.btn,
button.btn{
  appearance:none;
  border:1px solid #29405c;
  background:linear-gradient(180deg,#143a53,#0f2a3d);
  color:#fff;
  padding:10px 14px;
  border-radius:10px;
  cursor:pointer;
  font-weight:600;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.btn:focus,
button.btn:focus{
  outline:none;
  box-shadow:0 0 0 4px var(--focus);
  border-color:var(--accent);
}
.btn-small{
  padding:6px 10px;
  font-size:.82rem;
  border-radius:10px;
  opacity:.95;
}
.btn-small:hover{ opacity:1; }

/* Form inputs */
label{ display:block; margin-top:12px; font-weight:600; font-size:.95rem; }
input[type="file"], select, textarea, input[type="email"], input[type="text"]{
  width:100%;
  background:#0f172a;
  color:var(--text);
  border:1px solid var(--border);
  border-radius:10px;
  padding:10px 12px;
  outline:none;
}
select:focus, input[type="file"]:focus, textarea:focus, input:focus{
  border-color:var(--accent);
  box-shadow:0 0 0 4px var(--focus);
}

/* Tables */
table{ width:100%; border-collapse:collapse; font-size:.95rem; }
th, td{
  border-bottom:1px solid var(--border);
  padding:8px 6px;
  text-align:left;
  vertical-align:top;
}
thead th{
  position:sticky;
  top:0;
  background:#0f1a2b;
  z-index:1;
}
table tbody tr:hover{
  background: rgba(255,255,255,0.04);
  transition: background 0.15s ease;
}
.scroll{
  max-height: 360px;
  overflow:auto;
  border:1px solid var(--border);
  border-radius:12px;
  margin-top:10px;
}

/* Range slider (shared) */
.range-block{ margin-top:8px; }
.range-header{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  margin-bottom:6px;
}
.range-title{ font-weight:600; font-size:.95rem; }
.range-value{ font-size:.9rem; color:#9ca3af; }

input[type="range"]{
  -webkit-appearance:none;
  appearance:none;
  width:100%;
  height:6px;
  border-radius:999px;
  background:#111827;
  outline:none;
  border:1px solid #1f2937;
}
input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance:none;
  appearance:none;
  width:16px;height:16px;border-radius:50%;
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  border:2px solid var(--bg);
  box-shadow:0 0 0 3px var(--focus);
  cursor:pointer;
}
input[type="range"]::-moz-range-thumb{
  width:16px;height:16px;border-radius:50%;
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  border:2px solid var(--bg);
  box-shadow:0 0 0 3px var(--focus);
  cursor:pointer;
}
input[type="range"]::-moz-range-track{
  height:6px;border-radius:999px;background:#111827;border:1px solid #1f2937;
}

/* Message panel used in BYOD */
.msg{
  display:none;
  margin-top:10px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:
    radial-gradient(600px 400px at 0% 0%,rgba(125,211,252,0.12),transparent 50%),
    radial-gradient(600px 400px at 100% 100%,rgba(34,211,238,0.06),transparent 50%);
  color: var(--muted);
  white-space:pre-line;
}

/* Footer */
footer{
  margin-top:24px;
  text-align:center;
  font-size:0.85rem;
  color:var(--muted2);
}

/* Particles (used on main + demo_detail) */
.particle-layer{
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.particle{
  position:absolute;
  width:6px;height:6px;
  border-radius:999px;
  background: radial-gradient(circle at center, rgba(125,211,252,0.9), transparent);
  opacity: 0.4;
  filter: blur(0.5px);
  animation: float 20s linear infinite;
}

/* Generic float animation */
@keyframes float{
  0%   { transform: translateY(0) translateX(0); opacity:0; }
  10%  { opacity:0.4; }
  90%  { opacity:0.4; }
  100% { transform: translateY(-165vh) translateX(10px); opacity:0; }
}
