/* ============================================================
   Danny Mini App — style.css
   Dark AI/cyberpunk theme
   ============================================================ */

/* ---- Design tokens ---- */
:root {
  --c-bg:        #0d0d0d;
  --c-bg-2:      #111111;
  --c-bg-3:      #1a1a1a;
  --c-card:      #12121f;
  --c-border:    rgba(99,102,241,.18);
  --c-border-hi: rgba(99,102,241,.45);
  --c-text:      #e2e8f0;
  --c-text-2:    rgba(226,232,240,.55);
  --c-hint:      rgba(226,232,240,.35);
  --c-accent:    #6366f1;
  --c-accent-2:  #8b5cf6;
  --c-btn-text:  #ffffff;
  --c-green:     #10b981;
  --c-red:       #ef4444;
  --c-yellow:    #f59e0b;
  --c-online:    #22c55e;
  --c-offline:   #ef4444;

  --glow-accent: 0 0 24px rgba(99,102,241,.22);
  --glow-card:   0 4px 24px rgba(0,0,0,.55);

  --r-card: 16px;
  --r-pill: 999px;
  --r-sm:    8px;

  --sp-page: 16px;
  --tab-h:   58px;
  --hdr-h:   52px;
}

/* ---- Animations ---- */
@keyframes spin       { to { transform: rotate(360deg); } }
@keyframes pulse-dot  { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:.45; transform:scale(.75); } }
@keyframes fade-up    { from { opacity:0; transform:translateY(18px); } to { opacity:1; transform:translateY(0); } }
@keyframes glow-pulse { 0%,100% { box-shadow: var(--glow-accent); } 50% { box-shadow: 0 0 36px rgba(99,102,241,.42); } }

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: -apple-system, 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  overflow: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* ================================================================
   LAYOUT
   ================================================================ */

.page {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100dvh;
}

.page__header {
  flex-shrink: 0;
  height: var(--hdr-h);
  display: flex;
  align-items: center;
  padding: 0 var(--sp-page);
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
}

.page__title {
  font-size: 20px;
  font-weight: 700;
  flex: 1;
  background: linear-gradient(90deg, #e2e8f0 0%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page__body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px var(--sp-page) calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 20px);
}

/* ================================================================
   TAB BAR
   ================================================================ */

.tab-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(13,13,13,.92);
  border-top: 1px solid var(--c-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  z-index: 100;
}

.tab-bar__btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--c-hint);
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  padding: 6px 0 0;
  transition: color .2s;
  background: none;
  border: none;
  -webkit-tap-highlight-color: transparent;
}

.tab-bar__btn--active { color: var(--c-accent); }

.tab-bar__icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* ================================================================
   TYPOGRAPHY
   ================================================================ */

.section-header {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--c-hint);
  margin: 24px 0 10px;
  padding: 0 2px;
}
.section-header:first-child { margin-top: 4px; }

/* ================================================================
   HERO — user name + Danny status
   ================================================================ */

.hero {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 2px 20px;
  animation: fade-up .4s ease both;
}

.hero__name {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
  background: linear-gradient(115deg, #e2e8f0 0%, #a5b4fc 50%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -.5px;
}

.hero__name-placeholder {
  font-size: 30px;
  font-weight: 800;
  color: var(--c-hint);
  letter-spacing: -.5px;
}

.danny-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--c-text-2);
  font-weight: 500;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot--online   { background: var(--c-online);  animation: pulse-dot 2s ease infinite; }
.status-dot--offline  { background: var(--c-offline); }
.status-dot--checking { background: var(--c-hint);    animation: pulse-dot 1s ease infinite; }

.status-label { color: var(--c-text-2); }

/* ================================================================
   INFO CARDS — timezone, language
   ================================================================ */

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 4px;
  animation: fade-up .4s .1s ease both;
}

.info-card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color .2s, box-shadow .2s;
}
.info-card:active { border-color: var(--c-border-hi); box-shadow: var(--glow-accent); }

.info-card__icon {
  font-size: 20px;
  line-height: 1;
}

.info-card__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--c-hint);
}

.info-card__value {
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.info-card__value--placeholder {
  color: var(--c-hint);
  font-weight: 400;
  font-style: italic;
}

/* ================================================================
   STAT ROW
   ================================================================ */

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 4px;
  animation: fade-up .4s .18s ease both;
}

.stat-card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  padding: 14px 10px;
  text-align: center;
  transition: border-color .2s;
}
.stat-card:active { border-color: var(--c-border-hi); }

.stat-card__num   { font-size: 26px; font-weight: 800; line-height: 1; color: var(--c-accent); }
.stat-card__label { font-size: 11px; color: var(--c-hint); margin-top: 4px; }

/* ================================================================
   CARD + ITEM
   ================================================================ */

.card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  overflow: hidden;
  animation: fade-up .4s .25s ease both;
}
.card + .card { margin-top: 10px; }

.item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(99,102,241,.08);
  min-height: 52px;
  -webkit-tap-highlight-color: transparent;
}
.item:last-child { border-bottom: none; }
.item--tappable { cursor: pointer; transition: background .12s; }
.item--tappable:active { background: rgba(99,102,241,.08); }

.item__icon {
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.item__body   { flex: 1; min-width: 0; }
.item__title  { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item__sub    { font-size: 12px; color: var(--c-text-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item__right  { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

/* ================================================================
   BADGES & PRIORITY
   ================================================================ */

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  white-space: nowrap;
}
.badge--todo     { background: rgba(226,232,240,.08); color: var(--c-text-2); }
.badge--progress { background: rgba(245,158,11,.15);  color: var(--c-yellow); }
.badge--done     { background: rgba(16,185,129,.15);  color: var(--c-green); }
.badge--blocked  { background: rgba(239,68,68,.15);   color: var(--c-red); }

.priority {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 1px;
}
.priority--high { background: var(--c-red); box-shadow: 0 0 6px rgba(239,68,68,.5); }
.priority--mid  { background: var(--c-yellow); }
.priority--low  { background: var(--c-green); }

/* ================================================================
   TASK CHECKBOX
   ================================================================ */

.task-check {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(99,102,241,.3);
  background: none;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.task-check--done {
  background: var(--c-green);
  border-color: var(--c-green);
}
.task-check__tick { display: none; width: 13px; height: 13px; }
.task-check--done .task-check__tick { display: block; }

/* ================================================================
   FAB
   ================================================================ */

.fab {
  position: fixed;
  right: var(--sp-page);
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 16px);
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-accent) 0%, var(--c-accent-2) 100%);
  color: #fff;
  border: none;
  font-size: 26px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(99,102,241,.5);
  z-index: 50;
  transition: transform .1s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
  animation: glow-pulse 3s ease infinite;
}
.fab:active { transform: scale(.91); }

/* ================================================================
   FILTER STRIP
   ================================================================ */

.filter-strip {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 2px;
}
.filter-strip::-webkit-scrollbar { display: none; }

.filter-btn {
  flex-shrink: 0;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-pill);
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text-2);
  transition: background .15s, color .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.filter-btn--active {
  background: rgba(99,102,241,.18);
  border-color: var(--c-accent);
  color: var(--c-accent);
}

/* ================================================================
   SETTINGS
   ================================================================ */

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px;
  border-bottom: 1px solid rgba(99,102,241,.08);
  min-height: 48px;
}
.settings-row:last-child { border-bottom: none; }
.settings-row__label { font-size: 15px; }
.settings-row__value { font-size: 14px; color: var(--c-text-2); }

.privacy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 14px;
}
.privacy-opt {
  background: rgba(99,102,241,.06);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  padding: 12px;
  text-align: left;
  transition: border-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.privacy-opt--active { border-color: var(--c-accent); background: rgba(99,102,241,.12); }
.privacy-opt__name { font-size: 14px; font-weight: 600; display: block; color: var(--c-text); }
.privacy-opt__desc { font-size: 11px; color: var(--c-text-2); margin-top: 3px; display: block; }

.style-row {
  display: flex;
  gap: 8px;
  padding: 14px;
}
.style-opt {
  flex: 1;
  background: rgba(99,102,241,.06);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text);
  transition: border-color .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
}
.style-opt--active { border-color: var(--c-accent); background: rgba(99,102,241,.12); }

/* ================================================================
   GREETING (kept for backward compat)
   ================================================================ */

.greeting { margin-bottom: 16px; }
.greeting__name { font-size: 22px; font-weight: 700; }
.greeting__date { font-size: 14px; color: var(--c-text-2); margin-top: 2px; }

/* ================================================================
   STATES: loading / empty
   ================================================================ */

.state-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 48px 0;
  color: var(--c-text-2);
  font-size: 14px;
}
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--c-bg-3);
  border-top-color: var(--c-accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}

.state-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 0 24px;
  color: var(--c-text-2);
  font-size: 14px;
  gap: 8px;
  text-align: center;
}
.state-empty__icon { font-size: 36px; }
