:root {
  --bg: #0b0d12;
  --bg-card: #131722;
  --bg-card-hover: #171c29;
  --bg-elevated: #1c2232;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f3f5f9;
  --text-muted: #98a2b3;
  --text-soft: #667085;
  --accent: #f97316;
  --accent-pink: #ec4899;
  --accent-violet: #8b5cf6;
  --green: #10b981;
  --danger: #ef4444;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 9px;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
}

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

html,
body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

.bg-glow {
  position: fixed;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  filter: blur(130px);
  opacity: 0.14;
  pointer-events: none;
  z-index: 0;
}

.bg-glow-1 {
  top: -180px;
  left: -120px;
  background: radial-gradient(circle, var(--accent), var(--accent-pink));
}

.bg-glow-2 {
  bottom: -200px;
  right: -120px;
  background: radial-gradient(circle, var(--accent-violet), var(--accent-pink));
}

.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 16px;
}

.hidden {
  display: none !important;
}

/* Üst Bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(11, 13, 18, 0.84);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top, 0px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 74px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.profile-block {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.avatar-ring {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(135deg, var(--accent), var(--accent-pink), var(--accent-violet));
  flex-shrink: 0;
}

.avatar-img,
.avatar-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bg);
}

.avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
}

.profile-meta {
  min-width: 0;
}

.profile-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.profile-title-row h1 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.verified-badge {
  color: #3897f0;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.profile-sub-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-top: 3px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.profile-sub-row a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}

.profile-sub-row a:hover {
  color: var(--text);
  text-decoration: underline;
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.24);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Butonlar */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
  text-decoration: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.58;
  cursor: wait;
}

.btn-primary {
  background: linear-gradient(135deg, #f97316, #ec4899);
  color: #fff;
  box-shadow: 0 6px 20px rgba(236, 72, 153, 0.26);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.07);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover:not(:disabled) {
  background: #252d42;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.spin {
  animation: spinAnim 0.85s linear infinite;
}

@keyframes spinAnim {
  to {
    transform: rotate(360deg);
  }
}

/* Ana İçerik */
.main-content {
  padding-top: 20px;
  padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px));
}

/* Link Paneli */
.link-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.link-form {
  display: flex;
  gap: 10px;
}

.link-form input,
.pin-form input {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  font-size: 0.92rem;
  outline: none;
}

.link-form input:focus,
.pin-form input:focus {
  border-color: var(--accent-pink);
}

.custom-post-wrap {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* Uyarı Çubuğu */
.alert-banner {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  padding: 12px 15px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 0.9rem;
}

/* Kart Izgarası */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

/* Gönderi Kartı */
.post-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease;
}

.post-card:hover {
  border-color: var(--border-strong);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.card-badges {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex-wrap: wrap;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}

.type-video {
  background: rgba(139, 92, 246, 0.18);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.35);
}

.type-carousel {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.34);
}

.type-image {
  background: rgba(59, 130, 246, 0.16);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.32);
}

.card-post-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  flex-shrink: 0;
}

.card-post-link:hover {
  color: var(--text);
}

/* Medya Sahnesi */
.media-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 4.6;
  background: #07090d;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-backdrop {
  position: absolute;
  inset: -16px;
  width: calc(100% + 32px);
  height: calc(100% + 32px);
  object-fit: cover;
  filter: blur(22px) brightness(0.42);
  transform: scale(1.06);
  pointer-events: none;
}

.media-preview-img,
.media-video-player {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.play-overlay-btn {
  position: absolute;
  z-index: 3;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: rgba(11, 13, 18, 0.68);
  backdrop-filter: blur(8px);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease;
}

.play-overlay-btn:hover {
  transform: scale(1.08);
  background: rgba(249, 115, 22, 0.88);
}

.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(11, 13, 18, 0.72);
  color: #fff;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.nav-prev {
  left: 10px;
}

.nav-next {
  right: 10px;
}

.nav-arrow:hover {
  background: rgba(11, 13, 18, 0.94);
}

.slide-counter-pill {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  background: rgba(11, 13, 18, 0.76);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Kaydırmalı Slayt Seçici Sekmeler */
.slide-pills-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.slide-pills-bar::-webkit-scrollbar {
  display: none;
}

.slide-pill {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.14s ease;
}

.slide-pill.active {
  background: rgba(236, 72, 153, 0.18);
  color: #fff;
  border-color: rgba(236, 72, 153, 0.55);
}

/* Kart Gövde, Kapak Yazısı (OCR) ve Açıklama */
.card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 13px 14px 15px;
  flex: 1;
}

.cover-text-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(249, 115, 22, 0.07);
  border: 1px solid rgba(249, 115, 22, 0.24);
}

.cover-text-content {
  margin: 0;
  font-size: 0.83rem;
  font-weight: 600;
  line-height: 1.4;
  color: #fed7aa;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: pointer;
  word-break: break-word;
}

.cover-text-content.expanded {
  -webkit-line-clamp: unset;
}

.caption-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-height: 36px;
}

.caption-text {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: #d0d5dd;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: pointer;
  word-break: break-word;
}

.caption-text.expanded {
  -webkit-line-clamp: unset;
}

.copy-caption-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 0.73rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
}

.copy-caption-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

/* İndirme Aksiyon Alanı */
.download-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 2px;
}

.primary-dl-row {
  display: flex;
  align-items: stretch;
  gap: 7px;
  width: 100%;
}

.btn-download-main {
  flex: 1 1 0;
  min-width: 0;
  padding: 10px 9px;
  font-size: 0.79rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-send-phone {
  flex: 0 0 auto;
  padding: 10px 10px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.btn-send-phone:hover:not(:disabled) {
  background: #252d42;
}

.carousel-bulk-row {
  display: flex;
  width: 100%;
}

.btn-bulk {
  width: 100%;
  padding: 9px 10px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
}

.btn-bulk:hover:not(:disabled) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
}

/* Yükleme İskeleti (Skeleton) */
.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: 460px;
  position: relative;
}

.skeleton-shimmer {
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.02) 25%,
    rgba(255, 255, 255, 0.06) 50%,
    rgba(255, 255, 255, 0.02) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Modal & Toast */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow);
}

.modal-card h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.modal-card p {
  margin: 0 0 16px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.pin-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 80;
  background: #18202f;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  white-space: nowrap;
  max-width: calc(100vw - 32px);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mobil Uyumluluk */
@media (max-width: 640px) {
  .topbar-inner {
    min-height: 66px;
  }

  .btn-ghost span {
    display: none;
  }

  .btn-ghost {
    padding: 10px 11px;
  }

  .posts-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .link-form {
    flex-direction: column;
  }
}
