@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #070b14;
  --bg2: #0f172a;
  --surface: rgba(30, 41, 59, 0.72);
  --surface-solid: #1e293b;
  --surface2: #334155;
  --border: rgba(148, 163, 184, 0.12);
  --text: #f8fafc;
  --muted: #94a3b8;
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --primary-glow: rgba(99, 102, 241, 0.35);
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, var(--primary-glow), transparent),
    radial-gradient(ellipse 50% 40% at 100% 0%, rgba(139, 92, 246, 0.15), transparent),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
  pointer-events: none;
  z-index: -1;
}

.hidden { display: none !important; }

/* ── Public subscribe page ── */
.subscribe-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.subscribe-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow);
}

.brand {
  text-align: center;
  margin-bottom: 1.75rem;
}

.brand-logo-wrap {
  width: 88px;
  height: 88px;
  margin: 0 auto 1rem;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 32px var(--primary-glow);
  overflow: hidden;
}

.brand-logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-logo-wrap .brand-fallback {
  font-size: 2.5rem;
}

.brand h1 {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand p {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 0.35rem;
}

.active-badge {
  display: inline-block;
  margin: 0.5rem auto 0;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #86efac;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.feature-pills {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.pill {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--primary-hover);
}

.steps-flow {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.step {
  flex: 1;
  text-align: center;
  font-size: 0.68rem;
  color: var(--muted);
  padding: 0.5rem 0.25rem;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid transparent;
  transition: all 0.2s;
}

.step-num {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.step.active {
  border-color: var(--primary);
  color: var(--text);
  background: rgba(99, 102, 241, 0.08);
}

.step.active .step-num { color: var(--primary-hover); }

.step.done {
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.3);
}

.step.done .step-num { color: #86efac; }

.steps-flow.completed .step { color: #86efac; border-color: rgba(34, 197, 94, 0.2); }

.ios-steps {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.ios-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.ios-step span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.2);
  color: #fde68a;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.version-tag {
  font-size: 0.72rem;
  color: var(--muted);
  opacity: 0.7;
}

#pwa-update-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.65rem 1rem;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: white;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

#pwa-update-bar button {
  background: white;
  color: var(--primary);
  border: none;
  padding: 0.35rem 0.85rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
}

/* PWA kurulum rehberi (iOS + Android) */
body.install-mode {
  overflow: hidden;
}

.install-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(7, 11, 20, 0.92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem 1rem calc(5.5rem + env(safe-area-inset-bottom));
}

.install-sheet {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 24px 24px 20px 20px;
  padding: 1.5rem 1.25rem 1.25rem;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
  animation: iosSheetUp 0.35s ease;
}

@keyframes iosSheetUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.install-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  margin-bottom: 0.65rem;
}

.install-badge.ios {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.install-badge.android {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.install-sheet h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.install-lead {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.install-visual {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.1rem;
}

.visual-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.visual-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.visual-icon.share { background: rgba(59, 130, 246, 0.2); }
.visual-icon.add { background: rgba(34, 197, 94, 0.15); }
.visual-icon.open { background: rgba(99, 102, 241, 0.2); }

.visual-step strong {
  display: block;
  font-size: 0.88rem;
  margin-bottom: 0.1rem;
}

.visual-step span {
  font-size: 0.78rem;
  color: var(--muted);
}

.install-check-hint {
  margin-top: 0.65rem;
  font-size: 0.82rem;
  color: #fca5a5;
  text-align: center;
}

.install-note {
  margin-top: 0.75rem;
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
}

.ios-share-pointer {
  position: fixed;
  bottom: calc(0.75rem + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  animation: iosBounce 1.2s ease-in-out infinite;
}

.ios-pointer-arrow {
  font-size: 1.75rem;
  color: #fde68a;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.ios-pointer-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #fde68a;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  margin-top: 0.15rem;
}

@keyframes iosBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

/* eski alias */
body.ios-install-mode { overflow: hidden; }

.sidebar-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.status-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  text-align: center;
}

.status-dot {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin: 0 auto 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: var(--surface2);
}

.status-dot.ok { background: rgba(34, 197, 94, 0.15); }
.status-dot.error { background: rgba(239, 68, 68, 0.15); }
.status-dot.pending { background: rgba(99, 102, 241, 0.15); }

.status-text {
  color: var(--muted);
  font-size: 0.9rem;
}

.banner {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  font-size: 0.88rem;
}

.banner strong { color: #fde68a; display: block; margin-bottom: 0.35rem; }
.banner ol { margin: 0.5rem 0 0 1.1rem; color: var(--muted); }
.banner li { margin: 0.2rem 0; }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.9rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, background 0.15s;
}

.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: white;
  box-shadow: 0 8px 24px var(--primary-glow);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 12px 32px var(--primary-glow);
}

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  margin-top: 0.5rem;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  margin-top: 0.5rem;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-sm {
  width: auto;
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
}

.btn-lg { margin-top: 0.75rem; }

.page-footer {
  text-align: center;
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.page-footer a {
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: none;
}

.page-footer a:hover { color: var(--primary-hover); }

.hint {
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 1rem;
  line-height: 1.45;
}

/* ── Admin layout ── */
.admin-body { min-height: 100dvh; }

.admin-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100dvh;
}

.sidebar {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-brand-text strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
}

.sidebar-brand-text span {
  font-size: 0.75rem;
  color: var(--muted);
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--muted);
  text-decoration: none;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.nav-link svg {
  width: 18px;
  height: 18px;
  opacity: 0.7;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(99, 102, 241, 0.12);
  color: var(--text);
}

.nav-link.active {
  color: var(--primary-hover);
}

.sidebar-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.sidebar-footer a {
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: none;
}

.admin-main {
  padding: 1.75rem 2rem 2.5rem;
  overflow-y: auto;
}

.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  gap: 1rem;
}

.admin-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.admin-header p {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 0.25rem;
}

.header-stats {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.stat-pill {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--muted);
}

.stat-pill strong { color: var(--text); }

.card {
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.login-card {
  max-width: 400px;
  width: 100%;
}

.login-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.35rem;
}

.login-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.login-hint {
  margin-top: 1rem;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
}

.login-card > p {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 1.25rem;
}

.form-group { margin-bottom: 1rem; }

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.92rem;
  font-family: inherit;
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.color-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.color-row input[type="color"] {
  width: 44px;
  height: 44px;
  padding: 2px;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
}

.color-row input[type="text"] { flex: 1; }

.result {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.result.success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #bbf7d0;
}

.result.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fecaca;
}

/* Logo upload */
.logo-upload {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.logo-preview {
  width: 96px;
  height: 96px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.7);
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logo-preview .placeholder {
  font-size: 2rem;
  opacity: 0.4;
}

.logo-upload-actions {
  flex: 1;
}

.logo-upload-actions p {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0.5rem 0 0.75rem;
}

.file-input-wrap {
  position: relative;
}

.file-input-wrap input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-input-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}

/* Notification preview */
.notif-preview {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.notif-preview-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.notif-mock {
  display: flex;
  gap: 0.75rem;
  background: #1a1a2e;
  border-radius: 12px;
  padding: 0.85rem;
  border: 1px solid rgba(255,255,255,0.06);
}

.notif-mock-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  flex-shrink: 0;
  overflow: hidden;
}

.notif-mock-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.notif-mock-body strong {
  display: block;
  font-size: 0.88rem;
  margin-bottom: 0.15rem;
}

.notif-mock-body span {
  font-size: 0.8rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notif-mock-meta {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

/* Devices table */
.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th, td {
  text-align: left;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 2.5rem !important;
}

.ua-cell {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.platform-badge.android { background: rgba(34,197,94,.15); color: #bbf7d0; }
.platform-badge.ios { background: rgba(59,130,246,.15); color: #93c5fd; }
.platform-badge.macos { background: rgba(148,163,184,.15); color: #e2e8f0; }
.platform-badge.windows { background: rgba(59,130,246,.15); color: #93c5fd; }
.platform-badge.linux { background: rgba(245,158,11,.15); color: #fde68a; }
.platform-badge.unknown { background: var(--surface2); color: var(--muted); }

@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }

  .sidebar {
    position: relative;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
  }

  .sidebar-brand {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
  }

  .sidebar nav {
    flex-direction: row;
    flex-wrap: wrap;
    flex: unset;
  }

  .sidebar-footer {
    border-top: none;
    padding-top: 0;
    margin-left: auto;
  }

  .admin-main { padding: 1rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .logo-upload { flex-direction: column; }
}
