/* Speez — ana stil dosyası */

:root {
  --c-primary: #2B6947;      /* ana yeşil */
  --c-primary-dark: #1A402B; /* koyu yeşil */
  --c-accent: #4CBA7E;       /* canlı yeşil */
  --c-accent-light: #5DE399; /* açık yeşil */
  --c-teal: #398C5F;         /* orta ton */
  --c-blue: #1D9BF2;         /* yorum bölümü mavisi */
  --c-blue-dark: #1A8CD8;
  --c-blue-light: #4FB5F7;

  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f7faf8;
  --border: #e4e8e6;
  --text: #15201b;
  --text-muted: #6b7770;
  --header-bg: rgba(255, 255, 255, 0.85);
  --wave-bg: #c5d2cb;

  --radius: 24px;
  --radius-sm: 14px;
  --shadow: 0 2px 12px rgba(26, 64, 43, 0.06);
  --sidebar-w: 250px;
  --right-w: 300px;
}

/* Chirp benzeri font (sistem yığını ile yedeklenir) */
@font-face {
  font-family: 'Chirp';
  src: local('Chirp'), local('TwitterChirp');
  font-display: swap;
}

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

/* hidden özniteliği her zaman gizlesin (display kurallarını ezerek) */
[hidden] { display: none !important; }

/* ---------- Karanlık mod ---------- */
[data-theme="dark"] {
  --bg: #14201b;
  --surface: #1b2a23;
  --surface-2: #213029;
  --border: #2c3d34;
  --text: #e8efe9;
  --text-muted: #91a39a;
  --header-bg: rgba(20, 32, 27, 0.85);
  --wave-bg: #45564d;
  --shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
}
[data-theme="dark"] .alert-error { background: #3a1f1d; color: #f5b5b0; }
[data-theme="dark"] .alert-success { background: #1e3a2b; color: #9be3bd; }
[data-theme="dark"] .alert-info { background: #1d2b45; color: #b9cdf5; }
[data-theme="dark"] .btn-ghost { background: var(--surface); }
[data-theme="dark"] .brand-name { color: var(--c-accent-light); }

body {
  font-family: 'Chirp', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; }

/* ---------- Yerleşim ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--right-w);
  max-width: 1300px;
  margin: 0 auto;
  min-height: 100vh;
}

.sidebar { padding: 20px 16px; }

.sidebar-left {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
}

.sidebar-right {
  position: sticky;
  top: 0;
  height: 100vh;
  border-left: 1px solid var(--border);
}

.main {
  border-right: 1px solid var(--border);
  padding: 0 0 60px;
  min-width: 0;
}

/* ---------- Marka ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  margin-bottom: 16px;
}
.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(26, 64, 43, 0.18);
}
.brand-name { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; color: var(--c-primary-dark); }
.brand-center { justify-content: center; }

/* ---------- Navigasyon ---------- */
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  transition: background .15s;
}
.nav-link svg { width: 24px; height: 24px; }
.nav-link:hover { background: var(--surface-2); }
.nav-link.active { background: var(--c-primary); color: #fff; }

/* Bildirim rozetleri (kırmızı yuvarlak) */
.nav-badge,
.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e0245e;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.nav-badge { margin-left: auto; }
.unread-badge { margin-left: auto; }

.nav-user {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius);
}
.nav-user:hover { background: var(--surface-2); }
.nav-user-name { font-weight: 600; font-size: 14px; }
.nav-logout {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-weight: 600;
}
.nav-logout svg { width: 22px; height: 22px; }
.nav-logout:hover { background: var(--surface-2); color: var(--c-primary); }

.nav-auth { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }

/* Misafir karşılama kutusu */
.guest-cta {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.guest-cta p { font-size: 18px; color: var(--text-muted); margin-bottom: 12px; }
.guest-cta-actions { display: flex; gap: 10px; }

/* ---------- Sağ sidebar ---------- */
.lang-switch {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.lang-switch a { padding: 2px 4px; }
.lang-switch a.active { color: var(--c-primary); }
.lang-switch-center { justify-content: center; }

.ad-box {
  height: 320px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-label {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text-muted);
}

/* ---------- Sayfa başlığı ---------- */
.page-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.page-header h1 { font-size: 20px; font-weight: 800; }

/* ---------- Composer ---------- */
.composer {
  display: flex;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.composer-main { flex: 1; }
.composer-prompt { font-size: 19px; color: var(--text-muted); margin-bottom: 12px; }

.recorder-ui {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.btn-record {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  border-radius: 999px;
  background: var(--c-primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.btn-record:hover { background: var(--c-primary-dark); }
.btn-record.recording { background: #c0392b; }
.rec-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #fff;
}
.btn-record.recording .rec-dot { animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

.rec-timer { font-variant-numeric: tabular-nums; color: var(--text-muted); font-weight: 600; }
.rec-preview { height: 38px; }
.rec-actions { display: flex; gap: 8px; }
.rec-error { color: #c0392b; font-size: 14px; width: 100%; }

/* ---------- Akış / Post kartı ---------- */
.feed { display: flex; flex-direction: column; }
.post-card {
  display: flex;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.post-card:hover { background: var(--surface-2); }
.post-body { flex: 1; min-width: 0; }
.post-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.post-user { font-weight: 700; }
.post-time { color: var(--text-muted); font-size: 14px; }

/* Post üç nokta menüsü */
.post-menu { position: relative; margin-left: auto; }
.post-menu-btn svg { width: 20px; height: 20px; }
.post-menu-dropdown {
  display: none;
  position: absolute;
  top: 32px;
  right: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 28px rgba(26, 64, 43, 0.16);
  padding: 6px;
  z-index: 10;
}
.post-menu.open .post-menu-dropdown { display: block; }
.post-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  background: none;
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}
.post-menu-item:hover { background: var(--surface-2); }
.post-menu-report { color: #c0392b; }

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border-radius: 999px;
  font-size: 13px;
  transition: color .15s, background .15s;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { background: var(--surface-2); }
.like-btn:hover { color: #e0245e; }
.like-btn.active { color: #e0245e; }
.like-btn.active svg { fill: #e0245e; }
.save-btn:hover { color: var(--c-primary); }
.save-btn.active { color: var(--c-primary); }
.save-btn.active svg { fill: var(--c-primary); }

/* Post aksiyon çubuğu: üçü de sağda yan yana */
.post-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 10px;
}
.comment-btn:hover { color: var(--c-teal); }
.comment-btn.active { color: var(--c-teal); }

/* Yorum paneli (class ile aç/kapa) */
.comment-panel {
  display: none;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.comment-panel.open { display: block; }
.comment-composer {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.comment-composer .recorder-ui { flex: 1; }
.comment-list { display: flex; flex-direction: column; gap: 12px; }
.comment-item { display: flex; gap: 10px; }
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.comment-user { font-weight: 700; font-size: 14px; }
.comment-time { color: var(--text-muted); font-size: 13px; }
.comment-empty { color: var(--text-muted); font-size: 14px; padding: 4px 0; }

/* Yorum bölümü mavi tema */
.comment-panel .btn-record { background: var(--c-blue); }
.comment-panel .btn-record:hover { background: var(--c-blue-dark); }
.comment-panel .btn-record.recording { background: #c0392b; }
.comment-panel .btn-primary { background: var(--c-blue); }
.comment-panel .btn-primary:hover { background: var(--c-blue-dark); }
.comment-panel .spa-play { background: var(--c-blue); }
.comment-panel .spa-play:hover { background: var(--c-blue-dark); }
.comment-panel .speez-audio.playing .spa-play { background: var(--c-blue-light); }
.comment-btn.active { color: var(--c-blue); }
.comment-panel .comment-user { color: var(--c-blue-dark); }

/* ---------- Özel ses oynatıcı ---------- */
.speez-audio {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 460px;
  width: 100%;
  padding: 8px 14px 8px 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.speez-audio audio { display: none; }

.spa-play {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: var(--c-primary);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, transform .1s;
}
.spa-play:hover { background: var(--c-primary-dark); }
.spa-play:active { transform: scale(.94); }
.spa-play svg { width: 22px; height: 22px; fill: currentColor; }
.speez-audio.playing .spa-play { background: var(--c-accent); }

/* Oynat/Duraklat ikon geçişi */
.spa-ic-pause { display: none; }
.speez-audio.playing .spa-ic-play { display: none; }
.speez-audio.playing .spa-ic-pause { display: block; }

.spa-canvas {
  flex: 1;
  height: 34px;
  width: 100%;
  display: block;
  cursor: pointer;
}

.spa-time {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 78px;
  text-align: right;
}

/* ---------- Avatar ---------- */
.avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
  flex-shrink: 0;
}
.avatar-sm { width: 36px; height: 36px; }
.avatar-lg { width: 96px; height: 96px; }

/* ---------- Profil ---------- */
.profile-head {
  display: flex;
  gap: 20px;
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
}
.profile-info { flex: 1; }
.profile-name { font-size: 22px; font-weight: 800; }
.profile-stats { display: flex; gap: 18px; margin: 10px 0; color: var(--text-muted); font-size: 15px; }
.profile-stats strong { color: var(--text); }
.profile-bio { margin: 12px 0; }
.bio-label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; font-weight: 600; }
.profile-actions { display: flex; gap: 10px; margin-top: 12px; }

/* ---------- Butonlar ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-dark); }
.btn-primary.following { background: var(--surface); color: var(--c-primary); border: 1px solid var(--c-primary); }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-block { width: 100%; }

/* ---------- Kart / ayarlar ---------- */
.card {
  margin: 18px 20px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.card-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.settings-form { display: flex; flex-direction: column; gap: 16px; max-width: 420px; }
.settings-avatar { display: flex; align-items: center; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
.field input, .field select,
.auth-form input, .search-bar input {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  background: var(--surface);
}
.field input:focus, .field select:focus,
.auth-form input:focus, .search-bar input:focus {
  outline: none;
  border-color: var(--c-accent);
}
.current-bio { display: block; margin: 12px 0; max-width: 460px; }

/* ---------- Mesajlar ---------- */
.messages-layout { display: grid; grid-template-columns: 240px 1fr; min-height: 70vh; }
.convo-list { border-right: 1px solid var(--border); padding: 12px; }
.convo-title { font-size: 14px; text-transform: uppercase; color: var(--text-muted); padding: 8px; }
.convo-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: var(--radius-sm);
}
.convo-item:hover { background: var(--surface-2); }
.convo-item.active { background: var(--c-accent-light); }
.convo-name { font-weight: 600; font-size: 14px; }

.thread-panel { display: flex; flex-direction: column; }
.thread-head { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.thread-user { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.thread-body { flex: 1; padding: 18px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; max-height: 55vh; }
.msg { display: flex; flex-direction: column; gap: 4px; max-width: 70%; }
.msg-mine { align-self: flex-end; align-items: flex-end; }
.msg-other { align-self: flex-start; }
.msg-time { font-size: 12px; color: var(--text-muted); }
.thread-composer { border-top: 1px solid var(--border); padding: 14px 18px; }

/* ---------- Keşfet ---------- */
.search-bar { padding: 14px 20px; border-bottom: 1px solid var(--border); }
.search-bar input { width: 100%; }
.user-results { display: flex; flex-wrap: wrap; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border: 1px solid var(--border);
  border-radius: 999px; font-weight: 600;
}
.user-chip:hover { background: var(--surface-2); }

/* ---------- Durumlar ---------- */
.empty-state { padding: 40px 20px; text-align: center; color: var(--text-muted); }
.locked-state {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
}
.locked-state svg { width: 40px; height: 40px; margin-bottom: 12px; color: var(--c-primary); }
.locked-state p { max-width: 320px; margin: 0 auto; }

/* Ayarlardaki açık/kapalı alanı */
.toggle-field {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}
.toggle-field input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--c-primary); }
.toggle-field span { display: flex; flex-direction: column; }
.toggle-field small { color: var(--text-muted); font-weight: 400; }
.muted { color: var(--text-muted); }
.small { font-size: 14px; }

/* ---------- Auth ---------- */
.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--c-accent-light), var(--surface-2));
  padding: 20px;
}
.auth-wrap { width: 100%; max-width: 420px; }
.auth-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: 0 12px 40px rgba(26, 64, 43, 0.15);
}
.auth-tagline { text-align: center; color: var(--text-muted); margin-bottom: 12px; }
.auth-title { text-align: center; font-size: 22px; font-weight: 800; margin-bottom: 20px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
.auth-alt { text-align: center; margin-top: 14px; font-size: 14px; color: var(--text-muted); }
.auth-alt a { color: var(--c-primary); font-weight: 700; }

/* ---------- Uyarılar ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: 14px; }
.alert-error { background: #fdecea; color: #b3261e; }
.alert-success { background: #e7f6ee; color: var(--c-primary-dark); }
.alert-info { background: #eef4ff; color: #1a3b8b; word-break: break-all; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .app { grid-template-columns: 80px minmax(0, 1fr); }
  .sidebar-right { display: none; }
  .brand-name, .nav-link span, .nav-user-name, .nav-logout span { display: none; }
  .nav-link { justify-content: center; }
}
@media (max-width: 640px) {
  .app { grid-template-columns: 1fr; }
  .sidebar-left {
    position: fixed; bottom: 0; top: auto; left: 0; right: 0;
    height: auto; flex-direction: row; z-index: 20;
    border-top: 1px solid var(--border); border-right: none;
    background: var(--surface); justify-content: space-around; padding: 8px;
  }
  .brand, .nav-user, .nav-logout { display: none; }
  .nav { flex-direction: row; }
  .main { padding-bottom: 80px; }
  .messages-layout { grid-template-columns: 1fr; }
}
