:root {
  --bg: #f6f7f9;
  --bg-card: #ffffff;
  --border: #e8eaed;
  --text: #11131a;
  --text-dim: #6b7280;
  --green: #0f9d58;
  --green-bg: #e7f7ee;
  --red: #d93025;
  --red-bg: #fdeceb;
  --accent: #2563eb;
  --accent-bg: #eaf1ff;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(17,19,26,.04), 0 6px 20px rgba(17,19,26,.05);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-wrap: wrap;
}
.brand { font-weight: 800; font-size: 19px; white-space: nowrap; letter-spacing: -.3px; }
.brand span { color: var(--accent); }
.ticker-bar {
  flex: 1;
  overflow-x: auto;
  white-space: nowrap;
  color: var(--text-dim);
  font-size: 13px;
  min-width: 0;
  -ms-overflow-style: none; scrollbar-width: none;
}
.ticker-bar::-webkit-scrollbar { display: none; }
.auth-area { display: flex; gap: 8px; margin-left: auto; align-items: center; }

button {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background .15s ease, transform .1s ease;
}
button:hover { background: #f1f2f4; }
button:active { transform: scale(.97); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { background: #1d4ed8; }
button.full { width: 100%; }

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  padding: 18px;
  max-width: 1100px;
  margin: 0 auto;
}
@media (min-width: 900px) {
  .layout { grid-template-columns: 300px 1fr; align-items: start; }
  .side-widgets { position: sticky; top: 86px; }
}

.widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}
.widget h3 { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; font-weight: 700; }
.widget .widget-body { font-size: 15px; line-height: 1.7; }

.coin-search { position: relative; margin-bottom: 18px; }
.coin-search input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 16px;
  box-shadow: var(--shadow);
}
.coin-search input:focus { outline: none; border-color: var(--accent); }
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  max-height: 320px;
  overflow-y: auto;
  z-index: 40;
  display: none;
}
.search-results.open { display: block; }
.search-row {
  display: flex; justify-content: space-between;
  padding: 12px 16px; cursor: pointer; border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.search-row:last-child { border-bottom: none; }
.search-row:hover { background: #f6f7f9; }
.up { color: var(--green); font-weight: 600; } .down { color: var(--red); font-weight: 600; }

.position-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 22px;
  display: flex; flex-direction: column; gap: 12px;
}
.position-form h3 { margin-bottom: 2px; font-size: 16px; font-weight: 700; }
.position-form input, .position-form textarea {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
}
.position-form input:focus, .position-form textarea:focus { outline: none; border-color: var(--accent); background: #fff; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.grid2 label, .grid3 label { font-size: 12px; color: var(--text-dim); display: flex; flex-direction: column; gap: 6px; font-weight: 600; }

.direction-toggle { display: flex; gap: 8px; }
.dir-btn { flex: 1; padding: 12px; border-radius: 10px; font-weight: 700; border: 1.5px solid var(--border); }
.dir-btn[data-dir="long"].active { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.dir-btn[data-dir="short"].active { background: var(--red-bg); border-color: var(--red); color: var(--red); }

.positions-feed { display: flex; flex-direction: column; gap: 14px; }
.position-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.position-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.position-head .coin { font-weight: 800; font-size: 17px; letter-spacing: -.2px; }
.badge { padding: 5px 12px; border-radius: 8px; font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.badge.long { background: var(--green-bg); color: var(--green); }
.badge.short { background: var(--red-bg); color: var(--red); }
.position-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 12px; font-size: 13.5px; color: var(--text-dim); margin: 10px 0; }
.position-meta b { color: var(--text); font-weight: 700; }
.position-note { font-size: 14px; color: var(--text-dim); margin-top: 8px; line-height: 1.6; overflow-wrap: anywhere; }
.position-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-dim); }

.gate-message, .loading { text-align: center; padding: 48px 20px; color: var(--text-dim); font-size: 15px; }

.notif-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--accent-bg); border: 1px solid #c7dbff; color: var(--accent);
  border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; font-size: 14px; font-weight: 600;
}
.notif-banner button { padding: 7px 14px; font-size: 13px; }

.modal {
  position: fixed; inset: 0; background: rgba(17,19,26,.45);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px;
  backdrop-filter: blur(2px);
}
.modal.hidden { display: none; }
.modal-box {
  background: var(--bg-card); border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(17,19,26,.18);
  border-radius: 18px; padding: 26px; width: 100%; max-width: 360px; position: relative;
}
.modal-close { position: absolute; top: 12px; right: 14px; border: none; background: none; font-size: 22px; color: var(--text-dim); padding: 4px; }
.modal-box h3 { font-size: 19px; font-weight: 800; }
.modal-box form { display: flex; flex-direction: column; gap: 11px; margin-top: 16px; }
.modal-box input { padding: 13px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--bg); color: var(--text); font-size: 15px; }
.modal-box input:focus { outline: none; border-color: var(--accent); background: #fff; }
.form-error { color: var(--red); font-size: 13px; margin-top: 10px; min-height: 16px; font-weight: 600; }
.ad-slot {
  max-width: 1100px;
  margin: 14px auto;
  padding: 0 18px;
}
.ad-slot .ad-label {
  display: block;
  font-size: 10.5px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 6px;
  text-align: center;
}
.side-widgets .ad-slot { padding: 0; margin: 0 0 16px; }

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  margin-top: 24px;
  padding: 24px 18px;
}
.footer-inner { max-width: 1100px; margin: 0 auto; text-align: center; }
.footer-disclaimer { font-size: 12.5px; color: var(--text-dim); max-width: 640px; margin: 0 auto 14px; line-height: 1.6; }
.footer-links { display: flex; gap: 18px; justify-content: center; margin-bottom: 10px; }
.footer-links a { color: var(--text-dim); font-size: 13px; text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
.footer-copy { font-size: 12px; color: var(--text-dim); }

.cookie-banner {
  position: fixed; left: 14px; right: 14px; bottom: 14px;
  background: #11131a; color: #fff;
  border-radius: 14px; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  box-shadow: 0 10px 40px rgba(0,0,0,.25);
  z-index: 90; max-width: 640px; margin: 0 auto; flex-wrap: wrap;
}
.cookie-banner span { font-size: 13px; line-height: 1.5; }
.cookie-banner a { color: #93c5fd; }
.cookie-banner button { padding: 8px 16px; white-space: nowrap; }

.static-page { max-width: 720px; margin: 0 auto; padding: 32px 18px; }
.static-page h1 { font-size: 24px; font-weight: 800; margin-bottom: 18px; }
.static-page h2 { font-size: 17px; font-weight: 700; margin: 24px 0 8px; }
.static-page p, .static-page li { font-size: 14.5px; color: var(--text-dim); line-height: 1.7; margin-bottom: 10px; }
.static-page ul { padding-left: 20px; }

.hidden { display: none !important; }

/* ---------- TradingView grafik kutusu ---------- */
.chart-box {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 18px; overflow: hidden;
}
.chart-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 14px;
}
.chart-head button { border: none; background: none; font-size: 20px; color: var(--text-dim); padding: 2px 8px; cursor: pointer; }
.tv-chart { height: 420px; width: 100%; }

/* ---------- Pozisyon karti - paylasim butonu ---------- */
.card-actions { margin-top: 10px; text-align: right; }
.btn-share {
  display: inline-block; font-size: 12.5px; font-weight: 700; color: var(--accent);
  text-decoration: none; padding: 7px 14px; border-radius: 8px; border: 1.5px solid var(--accent-bg); background: var(--accent-bg);
}
.btn-share:hover { background: #dbe8ff; }

/* ---------- Paylasim bildirim toast'u ---------- */
.share-toast {
  position: fixed; left: 14px; right: 14px; bottom: 14px; max-width: 480px; margin: 0 auto;
  background: #11131a; color: #fff; border-radius: 14px; padding: 14px 16px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  box-shadow: 0 10px 40px rgba(0,0,0,.25); z-index: 95; font-size: 13.5px;
  animation: toast-in .25s ease;
}
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.share-toast a { color: #93c5fd; font-weight: 700; text-decoration: none; }
.share-toast button { padding: 7px 12px; font-size: 12.5px; }
.share-toast .toast-close { margin-left: auto; background: none; border: none; color: #fff; font-size: 18px; padding: 0 4px; }

/* ---------- Sinyal paylasim sayfasi (/sinyal/<id>) ---------- */
.signal-card-wrap { margin-bottom: 16px; }
.signal-actions { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; margin-bottom: 24px; }
.btn-download {
  display: inline-block; background: var(--accent); color: #fff; font-weight: 700; font-size: 14.5px;
  padding: 12px 22px; border-radius: 10px; text-decoration: none;
}
.btn-download:hover { background: #1d4ed8; }
.share-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.share-row a { font-size: 13px; font-weight: 700; color: var(--accent); text-decoration: none; padding: 6px 12px; border: 1.5px solid var(--border); border-radius: 8px; }
.share-row a:hover { background: var(--accent-bg); }
.signal-detail-box {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 20px;
}
.signal-cta { text-align: center; padding: 20px 0; }
.signal-cta p { color: var(--text-dim); font-size: 14px; margin-bottom: 12px; }
.primary-link {
  display: inline-block; background: var(--accent); color: #fff; font-weight: 700;
  padding: 11px 22px; border-radius: 10px; text-decoration: none; font-size: 14px;
}
.primary-link:hover { background: #1d4ed8; }

/* ---------- Yorumlar (/sinyal/<id>) ---------- */
.comments-box {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 20px;
}
.comments-box h3 { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.comments-box h3 .comments-count { color: var(--text-dim); font-weight: 600; }
.comments-empty { color: var(--text-dim); font-size: 13.5px; padding: 6px 0 16px; }
.comments-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; max-height: 420px; overflow-y: auto; }
.comment-row { padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.comment-row:last-child { border-bottom: none; padding-bottom: 0; }
.comment-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.comment-user { font-weight: 700; font-size: 13.5px; color: var(--accent); overflow-wrap: anywhere; min-width: 0; }
.comment-date { font-size: 11.5px; color: var(--text-dim); white-space: nowrap; }
.comment-body { font-size: 14px; line-height: 1.6; color: var(--text); word-break: break-word; }
.comment-form { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.comment-form textarea {
  width: 100%; min-height: 72px; padding: 11px; border-radius: 10px; border: 1.5px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 14px; resize: vertical; font-family: inherit;
}
.comment-form textarea:focus { outline: none; border-color: var(--accent); background: #fff; }
.comment-form button { align-self: flex-end; padding: 10px 20px; }
.comment-error { color: var(--red); font-size: 12.5px; margin: 0; }
.comment-error:empty { display: none; }

/* ---------- Fed faiz tablosu ---------- */
.fed-table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-card); box-shadow: var(--shadow); }
.fed-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
.fed-table th { text-align: left; padding: 12px 14px; background: #f6f7f9; color: var(--text-dim); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border); }
.fed-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.fed-table tr:last-child td { border-bottom: none; }
.fed-action { font-weight: 700; padding: 3px 10px; border-radius: 7px; font-size: 12px; display: inline-block; }
.fed-action.hike { background: var(--red-bg); color: var(--red); }
.fed-action.cut { background: var(--green-bg); color: var(--green); }
.fed-action.hold { background: var(--accent-bg); color: var(--accent); }
.fed-aftermath { color: var(--text-dim); font-size: 13px; line-height: 1.6; max-width: 360px; overflow-wrap: anywhere; }

/* ---------- PWA kurulum teklifi ---------- */
.install-fab {
  position: fixed; right: 16px; bottom: 16px; z-index: 80;
  background: var(--accent); color: #fff; border: none; padding: 13px 20px;
  border-radius: 30px; font-weight: 700; font-size: 13.5px;
  box-shadow: 0 10px 30px rgba(37,99,235,.35);
  animation: toast-in .25s ease;
}
