/* Soc Bay Studio — styles */
:root {
  --bg: #000000;
  --surface: #0c0c10;
  --surface-2: #14141c;
  --surface-3: #1c1c28;
  --border: #232334;
  --text: #f5f5fa;
  --text-dim: #8a8aa0;
  --text-faint: #4d4d63;
  --grad-1: #3c5af0;
  --grad-2: #b43cdc;
  --grad-3: #f03296;
  --gradient: linear-gradient(135deg, #3c5af0 0%, #b43cdc 50%, #f03296 100%);
  --gradient-soft: linear-gradient(135deg, rgba(60,90,240,.18) 0%, rgba(180,60,220,.18) 50%, rgba(240,50,150,.18) 100%);
  --danger: #ff4d6d;
  --success: #2ecc71;
  --shadow: 0 8px 24px rgba(0,0,0,.5);
  --radius: 14px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ----- Splash ----- */
.splash {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  animation: splashOut 0.4s ease 1.2s forwards;
}
.splash-logo { text-align: center; }
.splash-logo svg { width: 140px; height: 154px; filter: drop-shadow(0 0 30px rgba(180,60,220,.4)); animation: pulse 1.6s ease-in-out infinite; }
.splash-title { font-family: Georgia, serif; letter-spacing: 8px; font-size: 22px; margin-top: 8px; }
.splash-sub { letter-spacing: 6px; font-size: 12px; color: var(--text-dim); margin-top: 4px; }
@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.05)} }
@keyframes splashOut { to { opacity: 0; visibility: hidden; } }

/* ----- Lock screen ----- */
.lock {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 999;
  padding: 24px;
  padding-top: max(24px, env(safe-area-inset-top));
}
.lock-inner {
  width: 100%; max-width: 320px;
  text-align: center;
  animation: lockIn 0.35s ease both;
}
@keyframes lockIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.lock-logo svg { width: 96px; height: 106px; filter: drop-shadow(0 0 24px rgba(180,60,220,.35)); }
.lock-title { font-family: Georgia, serif; letter-spacing: 4px; font-size: 18px; margin-top: 12px; }
.lock-sub { font-size: 12px; color: var(--text-dim); margin-top: 6px; letter-spacing: 2px; }
.lock-form { margin-top: 28px; display: flex; flex-direction: column; gap: 12px; }
.lock-input {
  width: 100%;
  text-align: center;
  font-size: 28px;
  letter-spacing: 14px;
  padding: 16px 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.lock-input:focus { border-color: rgba(180,60,220,.6); box-shadow: 0 0 0 3px rgba(180,60,220,.18); }
.lock-submit {
  border: none;
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 1px;
  padding: 14px;
  border-radius: 12px;
  cursor: pointer;
}
.lock-submit:active { transform: translateY(1px); }
.gradient-bg { background: linear-gradient(135deg, #3c5af0 0%, #b43cdc 50%, #f03296 100%); }
.lock-error {
  min-height: 18px;
  color: #ff6b8a;
  font-size: 13px;
  opacity: 0;
  transition: opacity .15s ease;
}
.lock-error.show { opacity: 1; }
.lock-shake { animation: lockShake 0.4s ease; }
@keyframes lockShake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

/* ----- App layout ----- */
.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}

/* ----- Header ----- */
.app-header {
  position: sticky; top: 0; z-index: 50;
  padding: calc(env(safe-area-inset-top) + 12px) 16px 12px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 36px; height: 36px; }
.brand-text { line-height: 1; }
.brand-title { font-family: Georgia, serif; letter-spacing: 3px; font-size: 14px; font-weight: 700; }
.brand-sub { letter-spacing: 3px; font-size: 9px; color: var(--text-dim); margin-top: 2px; }

.icon-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  height: 36px; min-width: 36px; padding: 0 10px;
  border-radius: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.icon-btn:active { transform: scale(.96); }

/* ----- Page host ----- */
.page-host { flex: 1; padding: 16px 16px 92px; }
.page { animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px) } to { opacity: 1; transform: none } }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 12px; }
.page-title { font-size: 24px; font-weight: 700; margin: 4px 0 16px; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-dim); margin: 20px 0 10px; }

/* ----- Stats grid ----- */
.stats-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; inset: 0;
  background: var(--gradient-soft);
  opacity: .5; pointer-events: none;
}
.stat-card.wide { grid-column: 1 / -1; }
.stat-label { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; position: relative; }
.stat-value { font-size: 26px; font-weight: 800; margin-top: 6px; position: relative; }
.stat-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; position: relative; }

/* ----- Card list ----- */
.card-list { display: flex; flex-direction: column; gap: 8px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex; align-items: center; gap: 12px;
  position: relative;
}
.card.gradient-border {
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--gradient) border-box;
  border: 1px solid transparent;
}
.card .swatch {
  width: 4px; align-self: stretch; border-radius: 2px;
  background: var(--gradient);
  flex-shrink: 0;
}
.card-body { flex: 1; min-width: 0; }
.card-title { font-weight: 600; font-size: 15px; }
.card-meta { color: var(--text-dim); font-size: 12px; margin-top: 2px; display: flex; flex-wrap: wrap; gap: 8px; }
.card-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-faint); align-self: center; }
.card-price { font-weight: 700; font-size: 14px; }
.card-actions { display: flex; gap: 6px; flex-shrink: 0; }
.card .chip {
  padding: 2px 8px;
  font-size: 10px;
  border-radius: 10px;
  background: var(--surface-3);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.card .chip.gradient {
  background: var(--gradient);
  color: white;
}
.card.empty {
  border: 1px dashed var(--border);
  color: var(--text-dim);
  text-align: center;
  justify-content: center;
  padding: 22px;
  font-size: 13px;
  background: transparent;
}

/* ----- Day tabs ----- */
.day-tabs {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px;
  scrollbar-width: none; margin-bottom: 12px;
}
.day-tabs::-webkit-scrollbar { display: none; }
.day-tab {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.day-tab.active {
  background: var(--gradient);
  color: white;
  border-color: transparent;
}

/* ----- Buttons ----- */
.btn-primary {
  background: var(--gradient);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 22px;
  font-size: 14px; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(180,60,220,.35);
}
.btn-primary:active { transform: scale(.97); }
.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: 22px;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
}
.btn-secondary.full, .btn-danger.full, .btn-primary.full { width: 100%; margin-bottom: 8px; }
.btn-danger {
  background: rgba(255,77,109,.12);
  color: var(--danger);
  border: 1px solid rgba(255,77,109,.3);
  padding: 10px 16px;
  border-radius: 22px;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
}
.btn-text {
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
}
.btn-text.danger { color: var(--danger); }

/* ----- Search ----- */
.search {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--text);
  font-size: 14px;
  margin-bottom: 12px;
}
.search:focus { outline: none; border-color: var(--grad-2); }

/* ----- Bottom nav ----- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(0,0,0,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
  background: transparent; border: none;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 4px 8px;
  color: var(--text-faint);
  font-size: 10px;
  cursor: pointer;
}
.nav-item svg { width: 22px; height: 22px; }
.nav-item.active { color: transparent; }
.nav-item.active span {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nav-item.active svg {
  stroke: url(#sbGrad);
  color: var(--grad-2);
}

/* ----- Modal ----- */
.modal-host {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  animation: fadeIn .2s ease;
}
.modal {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  padding: 20px 18px calc(env(safe-area-inset-bottom) + 20px);
  max-height: 92vh;
  overflow-y: auto;
  animation: slideUp .25s ease;
  border-top: 1px solid var(--border);
}
@keyframes slideUp { from { transform: translateY(100%) } to { transform: none } }
.modal-handle {
  width: 36px; height: 4px; background: var(--text-faint);
  border-radius: 2px;
  margin: 0 auto 14px;
}
.modal-title {
  font-size: 18px; font-weight: 700; margin: 0 0 16px;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.modal-actions {
  display: flex; gap: 8px; margin-top: 16px;
}
.modal-actions > * { flex: 1; }

/* ----- Form ----- */
.form-row { margin-bottom: 12px; }
.form-row label {
  display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 1px;
}
.form-row input, .form-row select, .form-row textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none; border-color: var(--grad-2);
}
.form-row textarea { resize: vertical; min-height: 60px; }
.form-row .row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.day-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.day-pill {
  padding: 8px 14px;
  border-radius: 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  user-select: none;
}
.day-pill.active {
  background: var(--gradient);
  color: white;
  border-color: transparent;
}

/* ----- Settings ----- */
.settings-group { margin-bottom: 24px; }
.lang-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lang-opt {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
}
.lang-opt.active {
  background: var(--gradient);
  border-color: transparent;
  color: white;
}
.footer-note { text-align: center; color: var(--text-faint); font-size: 11px; margin-top: 30px; line-height: 1.6; }

/* ----- Month nav ----- */
.month-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.month-label { font-size: 16px; font-weight: 600; }

/* ----- Toast ----- */
.toast {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%);
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 22px;
  font-size: 13px;
  z-index: 300;
  box-shadow: var(--shadow);
  animation: toastIn .25s ease;
}
.toast.gradient {
  background: var(--gradient);
  border: none;
  color: white;
  font-weight: 600;
}
@keyframes toastIn { from { transform: translate(-50%, 10px); opacity: 0 } to { transform: translateX(-50%); opacity: 1 } }

/* ----- Helpers ----- */
.row-between { display: flex; align-items: center; justify-content: space-between; }
.spacer { flex: 1; }
.text-dim { color: var(--text-dim); }
.text-right { text-align: right; }

/* Larger screens (tablets) */
@media (min-width: 600px) {
  .page-host { padding: 20px 24px 100px; max-width: 720px; margin: 0 auto; width: 100%; }
  .stats-grid { grid-template-columns: 1fr 1fr 1fr; }
  .stat-card.wide { grid-column: span 3; }
}
