/* =====================================================================
 *  Tapween — by Takween Solutions  ·  styles.css
 *  Dark, premium, gradient brand identity.
 * ===================================================================== */
:root {
  --bg: #0a0b14;
  --bg-2: #11131f;
  --surface: #161826;
  --surface-2: #1d2031;
  --line: #262a3d;
  --txt: #eef0fb;
  --txt-2: #9aa0bf;
  --txt-3: #6b7090;
  --brand: #7c3aed;
  --brand-2: #06b6d4;
  --accent: #f472b6;
  --good: #22c55e;
  --warn: #f59e0b;
  --bad: #ef4444;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7);
  --grad: linear-gradient(120deg, var(--brand) 0%, var(--brand-2) 100%);
  --grad-soft: linear-gradient(120deg, rgba(124, 58, 237, 0.18), rgba(6, 182, 212, 0.14));
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, rgba(124, 58, 237, 0.18), transparent 60%),
              radial-gradient(900px 500px at -10% 10%, rgba(6, 182, 212, 0.12), transparent 55%),
              var(--bg);
  color: var(--txt);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--brand-2); }
button { font-family: inherit; cursor: pointer; }

/* ---------------------------- top bar ---------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  backdrop-filter: blur(14px);
  background: rgba(10, 11, 20, 0.72);
  border-bottom: 1px solid var(--line);
}
.topbar__in {
  max-width: 1180px; margin: 0 auto; padding: 12px 18px;
  display: flex; align-items: center; gap: 14px;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand__mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--grad);
  display: grid; place-items: center;
  font-size: 19px; box-shadow: 0 8px 22px -8px rgba(124, 58, 237, 0.8);
}
.brand__name { font-weight: 800; letter-spacing: -0.02em; font-size: 18px; color: var(--txt); }
.brand__by { font-size: 11px; color: var(--txt-2); margin-top: -2px; }
.topbar__sp { flex: 1; }
.ghost {
  background: transparent; border: 1px solid var(--line); color: var(--txt);
  padding: 9px 14px; border-radius: 11px; font-weight: 600; font-size: 14px;
  display: inline-flex; align-items: center; gap: 7px; transition: 0.15s;
}
.ghost:hover { border-color: var(--brand); background: var(--surface); }
.ghost.is-active { background: var(--grad); border-color: transparent; }

/* ---------------------------- hero ------------------------------- */
.hero { max-width: 1180px; margin: 0 auto; padding: 40px 18px 8px; }
.hero__badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--grad-soft); border: 1px solid var(--line);
  color: var(--txt-2); font-size: 12.5px; font-weight: 600;
  padding: 6px 12px; border-radius: 999px; margin-bottom: 16px;
}
.hero h1 {
  margin: 0 0 12px; font-size: clamp(30px, 6vw, 54px); line-height: 1.04;
  letter-spacing: -0.03em; font-weight: 850;
}
.hero h1 .grad {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p { color: var(--txt-2); font-size: clamp(15px, 2.4vw, 19px); max-width: 640px; margin: 0 0 22px; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.hero__stats { display: flex; gap: 26px; margin-top: 26px; flex-wrap: wrap; }
.stat b { display: block; font-size: 24px; font-weight: 800; }
.stat span { color: var(--txt-2); font-size: 13px; }

.btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--txt);
  padding: 12px 18px; border-radius: 12px; font-weight: 650; font-size: 14.5px;
  display: inline-flex; align-items: center; gap: 8px; transition: 0.15s;
}
.btn:hover { background: var(--surface-2); border-color: #34394f; }
.btn--primary { background: var(--grad); border-color: transparent; box-shadow: 0 12px 28px -12px rgba(124, 58, 237, 0.9); }
.btn--primary:hover { filter: brightness(1.07); }
.btn--lg { padding: 14px 22px; font-size: 16px; }

/* ---------------------------- banner ----------------------------- */
.banner {
  max-width: 1180px; margin: 14px auto 0; padding: 0 18px;
}
.banner__in {
  background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fcd9a0; border-radius: 14px; padding: 12px 16px; font-size: 13.5px;
  display: flex; gap: 10px; align-items: flex-start;
}

/* ---------------------------- controls --------------------------- */
.controls { max-width: 1180px; margin: 28px auto 0; padding: 0 18px; }
.searchbar {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
}
.search {
  flex: 1; min-width: 220px; display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0 14px;
}
.search input {
  flex: 1; background: transparent; border: 0; outline: 0; color: var(--txt);
  font-size: 15px; padding: 13px 0;
}
.search svg { opacity: 0.55; flex-shrink: 0; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.seg button {
  border: 0; background: transparent; color: var(--txt-2); padding: 8px 13px;
  border-radius: 9px; font-weight: 600; font-size: 13px; transition: 0.15s;
}
.seg button.is-active { background: var(--grad); color: #fff; }

.chips { display: flex; gap: 9px; overflow-x: auto; padding: 18px 0 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  white-space: nowrap; border: 1px solid var(--line); background: var(--surface);
  color: var(--txt-2); padding: 8px 14px; border-radius: 999px; font-weight: 600;
  font-size: 13.5px; display: inline-flex; align-items: center; gap: 7px; transition: 0.15s;
}
.chip:hover { color: var(--txt); border-color: #34394f; }
.chip.is-active { background: var(--grad); color: #fff; border-color: transparent; }

.resultline { display: flex; justify-content: space-between; align-items: center; color: var(--txt-2); font-size: 13px; margin-top: 8px; }

/* ---------------------------- grid ------------------------------- */
.grid {
  max-width: 1180px; margin: 14px auto 60px; padding: 0 18px;
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
}
.card {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--c, var(--brand)); opacity: 0.85;
}
.card:hover { transform: translateY(-4px); border-color: var(--c); box-shadow: var(--shadow); }
.card__top { display: flex; justify-content: space-between; align-items: flex-start; }
.card__icon {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  font-size: 23px; background: color-mix(in srgb, var(--c) 16%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
}
.fav { background: transparent; border: 0; color: var(--txt-3); font-size: 21px; line-height: 1; padding: 2px; }
.fav.is-fav { color: #fbbf24; }
.card__title { margin: 13px 0 6px; font-size: 16.5px; font-weight: 750; letter-spacing: -0.01em; }
.card__desc { margin: 0 0 14px; color: var(--txt-2); font-size: 13.3px; min-height: 38px; }
.card__meta { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.card__cat { color: var(--txt-2); font-size: 12px; }
.cat-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.tag {
  font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 7px; letter-spacing: 0.01em;
}
.tag--write { background: rgba(34, 197, 94, 0.14); color: #7ee2a8; }
.tag--auto { background: rgba(245, 158, 11, 0.14); color: #fbcf8a; }
.tag--mine { background: rgba(124, 58, 237, 0.18); color: #c4a8ff; }

.empty { grid-column: 1/-1; text-align: center; color: var(--txt-2); padding: 60px 20px; }
.link { background: 0; border: 0; color: var(--brand-2); text-decoration: underline; font: inherit; cursor: pointer; }

/* ---------------------------- modal ------------------------------ */
.modal {
  position: fixed; inset: 0; z-index: 50; display: none;
  background: rgba(5, 6, 12, 0.72); backdrop-filter: blur(6px);
  align-items: flex-end; justify-content: center;
}
.modal.open { display: flex; }
@media (min-width: 720px) { .modal { align-items: center; } }
.modal__panel {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 22px 22px 0 0; width: 100%; max-width: 560px;
  max-height: 92vh; overflow-y: auto; box-shadow: var(--shadow);
  animation: rise 0.22s ease;
}
@media (min-width: 720px) { .modal__panel { border-radius: 22px; } }
@keyframes rise { from { transform: translateY(30px); opacity: 0.4; } to { transform: none; opacity: 1; } }
.modal__close {
  position: sticky; top: 0; float: right; margin: 12px 14px -10px 0; z-index: 2;
  background: var(--surface); border: 1px solid var(--line); color: var(--txt);
  width: 34px; height: 34px; border-radius: 10px; font-size: 18px;
}
#modalBody { padding: 18px 20px 26px; }
.modal__hd { display: flex; gap: 14px; align-items: center; margin: 4px 0 14px; }
.modal__icon {
  width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 28px;
  background: color-mix(in srgb, var(--c) 18%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--c) 32%, transparent);
}
.modal__hd h2 { margin: 0; font-size: 21px; letter-spacing: -0.02em; }
.modal__meta { display: flex; gap: 9px; align-items: center; margin-top: 6px; }
.modal__desc { color: var(--txt-2); font-size: 14.5px; margin: 0 0 16px; }

.form { display: grid; gap: 12px; margin-bottom: 14px; }
.fld { display: grid; gap: 6px; }
.fld span { font-size: 13px; color: var(--txt-2); font-weight: 600; }
.fld input, .fld select, .fld textarea {
  background: var(--surface); border: 1px solid var(--line); color: var(--txt);
  padding: 12px 13px; border-radius: 11px; font-size: 15px; outline: 0; transition: 0.15s; font-family: inherit;
}
.fld input:focus, .fld select:focus, .fld textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18); }
.fld textarea { resize: vertical; min-height: 70px; }

.preview {
  background: #0c0d18; border: 1px solid var(--line); border-radius: 11px;
  padding: 12px; font-family: "SF Mono", ui-monospace, Menlo, monospace; font-size: 12.5px;
  color: #9fe7c4; word-break: break-all; white-space: pre-wrap; margin-bottom: 12px;
}
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.steps { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 14px; }
.steps h4 { margin: 0 0 8px; font-size: 14px; }
.steps ol { margin: 0; padding-left: 18px; color: var(--txt-2); font-size: 13.5px; display: grid; gap: 7px; }
.hint { color: var(--txt-3); font-size: 12.5px; margin: 14px 0 0; }

/* ---------------------------- write sheet ------------------------ */
.sheet { position: fixed; inset: 0; z-index: 60; display: none; align-items: center; justify-content: center; background: rgba(5, 6, 12, 0.8); backdrop-filter: blur(8px); padding: 20px; }
.sheet.open { display: flex; }
.sheet__card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 22px; padding: 30px 26px; max-width: 380px; width: 100%; text-align: center; box-shadow: var(--shadow); }
.sheet__ico { font-size: 50px; margin-bottom: 8px; }
.sheet__ico.pulse { animation: pulse 1.3s infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.12); opacity: 0.7; } }
.sheet__card h3 { margin: 6px 0; font-size: 20px; }
.sheet__card p { color: var(--txt-2); font-size: 14px; margin: 0 0 14px; }
.sheet__payload { background: #0c0d18; border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: 11.5px; color: #9fe7c4; text-align: left; white-space: pre-wrap; word-break: break-all; max-height: 140px; overflow: auto; }
.sheet__actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.sheet__card--wide { max-width: 460px; }
.ios-steps { text-align: left; margin: 6px 0 10px; padding-left: 20px; display: grid; gap: 10px; color: var(--txt); font-size: 13.7px; }
.ios-steps li { line-height: 1.5; }
.ios-steps b { color: var(--txt); }
.muted { color: var(--txt-3); font-size: 12px; display: block; margin-top: 4px; }
p.muted { text-align: left; }

/* ---------------------------- toast ------------------------------ */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--surface-2); border: 1px solid var(--line); color: var(--txt);
  padding: 12px 18px; border-radius: 12px; font-size: 14px; z-index: 70;
  box-shadow: var(--shadow); opacity: 0; transition: 0.25s; max-width: 90vw;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ---------------------------- footer ----------------------------- */
.foot { border-top: 1px solid var(--line); padding: 30px 18px 50px; }
.foot__in { max-width: 1180px; margin: 0 auto; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--txt-2); font-size: 13px; }
.foot a { color: var(--txt-2); text-decoration: none; }
.foot a:hover { color: var(--txt); }

/* floating add button (mobile) */
.fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 25;
  width: 56px; height: 56px; border-radius: 18px; border: 0;
  background: var(--grad); color: #fff; font-size: 26px;
  box-shadow: 0 16px 34px -12px rgba(124, 58, 237, 0.9);
  display: grid; place-items: center;
}
