@tailwind base;
@tailwind components;
@tailwind utilities;

/*
 * Blue & white glass theme: royal blue #2563EB accent, lavender #8B7CF6 secondary, white frosted panels on a soft blue field.
 * Dark mode: deep navy glass. All colours are tokens so components never hard-code a palette.
 */
:root {
  --font-syne: "Plus Jakarta Sans";
  --font-inter: "Inter";
  --font-bangla: "Hind Siliguri";
  --brand: 37 99 235;
  --brand-600: 29 78 216;
  --brand-50: 235 242 255;
  --violet: 124 108 240;
  --violet-50: 238 236 255;
  --bg: 238 243 251;
  --panel: 255 255 255;
  --sunken: 244 247 252;
  --line: 222 229 240;
  --ink: 15 23 42;
  --ink-2: 71 85 105;
  --ink-3: 136 148 168;
  --ok: 22 163 106;
  --warn: 217 140 18;
  --bad: 225 61 72;
  --info: 37 99 235;
  --sidebar: 255 255 255;
  --glass: 255 255 255;
  --glass-alpha: 0.62;
  --glass-border: 255 255 255;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: 96 145 255;
    --brand-600: 130 168 255;
    --brand-50: 23 37 72;
    --violet: 160 148 255;
    --violet-50: 40 36 78;
    --bg: 8 13 28;
    --panel: 17 25 45;
    --sunken: 13 20 38;
    --line: 39 51 78;
    --ink: 236 241 250;
    --ink-2: 176 188 210;
    --ink-3: 120 134 160;
    --sidebar: 17 25 45;
    --glass: 22 32 58;
    --glass-alpha: 0.55;
    --glass-border: 120 150 220;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: 96 145 255;
  --brand-600: 130 168 255;
  --brand-50: 23 37 72;
  --violet: 160 148 255;
  --violet-50: 40 36 78;
  --bg: 8 13 28;
  --panel: 17 25 45;
  --sunken: 13 20 38;
  --line: 39 51 78;
  --ink: 236 241 250;
  --ink-2: 176 188 210;
  --ink-3: 120 134 160;
  --sidebar: 17 25 45;
  --glass: 22 32 58;
  --glass-alpha: 0.55;
  --glass-border: 120 150 220;
  color-scheme: dark;
}

html, body { height: 100%; }
body {
  @apply bg-bg text-ink font-sans antialiased;
  font-size: 13.5px;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { @apply font-display tracking-tight; }
:lang(bn), .bn { @apply font-bangla; }

::selection { background: rgb(var(--brand) / 0.22); }
*:focus-visible { outline: none; box-shadow: 0 0 0 3px rgb(var(--brand) / 0.35); border-radius: 6px; }

/* macOS overlay scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgb(var(--ink-3) / .45) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgb(var(--ink-3) / .35); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgb(var(--ink-3) / .6); }

@layer components {
  .vibrancy { background: rgb(var(--glass) / var(--glass-alpha)); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px); }
  .glass { background: rgb(var(--glass) / 0.82); backdrop-filter: saturate(180%) blur(22px); -webkit-backdrop-filter: saturate(180%) blur(22px); }
  /* frosted panel: translucent fill, bright top edge, soft blue drop shadow */
  .glass-panel {
    background: linear-gradient(180deg, rgb(var(--glass) / calc(var(--glass-alpha) + .14)), rgb(var(--glass) / var(--glass-alpha)));
    backdrop-filter: saturate(170%) blur(22px); -webkit-backdrop-filter: saturate(170%) blur(22px);
    border: 1px solid rgb(var(--glass-border) / .7);
    box-shadow: 0 1px 0 rgb(255 255 255 / .55) inset, 0 18px 40px -22px rgb(30 64 175 / .28), 0 2px 6px -2px rgb(15 23 42 / .06);
  }
  .app-bg { background: radial-gradient(1200px 700px at 0% 0%, rgb(219 234 254 / .9), transparent 60%), radial-gradient(1000px 700px at 100% 100%, rgb(224 231 255 / .9), transparent 60%), rgb(var(--bg)); }
  :root[data-theme="dark"] .app-bg { background: radial-gradient(1100px 700px at 0% 0%, rgb(30 58 138 / .45), transparent 60%), radial-gradient(900px 700px at 100% 100%, rgb(76 29 149 / .35), transparent 60%), rgb(var(--bg)); }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .app-bg { background: radial-gradient(1100px 700px at 0% 0%, rgb(30 58 138 / .45), transparent 60%), radial-gradient(900px 700px at 100% 100%, rgb(76 29 149 / .35), transparent 60%), rgb(var(--bg)); } }
  .no-scrollbar { scrollbar-width: none; } .no-scrollbar::-webkit-scrollbar { display: none; }
  /* hero card: the blue gradient tile from the reference design */
  .hero-blue { background: radial-gradient(120% 120% at 100% 0%, rgb(129 140 248 / .55), transparent 55%), linear-gradient(140deg, #3B6CF6 0%, #2457E6 45%, #1D3FBF 100%); color: white; box-shadow: 0 24px 50px -24px rgb(37 99 235 / .7), inset 0 1px 0 rgb(255 255 255 / .25); }
  .lift { transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s ease; }
  .lift:hover { transform: translateY(-3px); box-shadow: 0 1px 0 rgb(255 255 255 / .55) inset, 0 26px 50px -24px rgb(30 64 175 / .38); }
  .hairline { border-color: rgb(var(--line)); border-width: 0.5px; }
  .card { @apply glass-panel rounded-[22px]; }
  .label { @apply text-[11.5px] font-medium text-ink-2; }
  .muted { @apply text-ink-3; }
  .kbd { @apply inline-flex items-center rounded border border-line bg-sunken px-1.5 py-0.5 text-[10.5px] font-medium text-ink-2; }
  .field { @apply w-full rounded-[10px] border border-line bg-panel/80 px-3 py-[7px] text-[13px] text-ink placeholder:text-ink-3 shadow-[inset_0_1px_1px_rgb(0_0_0/0.04)] outline-none transition focus:border-brand/60 focus:shadow-focus disabled:opacity-60; }
  .table-mac { @apply w-full text-left text-[13px]; }
  .table-mac thead th { @apply sticky top-0 z-10 border-b border-line bg-panel/80 px-3 py-2.5 text-[11px] font-semibold uppercase tracking-wide text-ink-3 backdrop-blur; }
  .table-mac tbody td { @apply border-b border-line/70 px-3 py-2 align-middle; }
  .table-mac tbody tr:nth-child(even) { background: rgb(var(--sunken) / 0.35); }
  .table-mac tbody tr:hover { background: rgb(var(--brand) / 0.05); }
}

.react-flow__attribution { display: none; }
.react-flow__node { font-family: var(--font-inter); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* 3D glass used on the sign-in / sign-up screens */
.glass-3d {
  background: linear-gradient(160deg, rgb(255 255 255 / .78), rgb(255 255 255 / .42));
  backdrop-filter: saturate(180%) blur(26px); -webkit-backdrop-filter: saturate(180%) blur(26px);
  border: 1px solid rgb(255 255 255 / .85);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .9), inset 0 -1px 0 rgb(37 99 235 / .06), 0 30px 60px -25px rgb(30 64 175 / .35), 0 8px 20px -10px rgb(15 23 42 / .12);
  transform-style: preserve-3d;
}
:root[data-theme="dark"] .glass-3d { background: linear-gradient(160deg, rgb(30 44 80 / .72), rgb(15 24 48 / .5)); border-color: rgb(120 150 220 / .25); box-shadow: inset 0 1px 0 rgb(255 255 255 / .08), 0 30px 60px -25px rgb(0 0 0 / .6); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .glass-3d { background: linear-gradient(160deg, rgb(30 44 80 / .72), rgb(15 24 48 / .5)); border-color: rgb(120 150 220 / .25); box-shadow: inset 0 1px 0 rgb(255 255 255 / .08), 0 30px 60px -25px rgb(0 0 0 / .6); } }
@keyframes float { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(30px, -24px, 0); } }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
