/* =========================================================
   TEXTLY WEB - MODERN DARK UI & RESPONSIVE PWA STYLESHEET
   ========================================================= */

:root {
  --bg-main: #0d1117;
  --bg-surface: #161b22;
  --bg-surface-hover: #1f242c;
  --bg-card: #21262d;
  --border-color: #30363d;
  --border-subtle: rgba(255, 255, 255, 0.08);

  --text-main: #f0f6fc;
  --text-muted: #8b949e;
  --text-subtle: #6e7681;

  --primary: #00a8ff;
  --primary-hover: #0090db;
  --primary-light: rgba(0, 168, 255, 0.15);

  --accent-green: #238636;
  --accent-green-bright: #38ef7d;
  --danger: #da3633;
  --danger-hover: #b62324;

  --bubble-self: #0084ff;
  --bubble-other: #21262d;

  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-family);
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

input, textarea, button {
  font-family: inherit;
}

/* Helpers */
.hidden { display: none !important; }
.cursor-pointer { cursor: pointer; }
.mt-2 { margin-top: 8px; }
.pt-4 { padding-top: 16px; }
.border-top { border-top: 1px solid var(--border-color); }
.w-full { width: 100%; }

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Buttons */
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover {
  background: var(--bg-surface-hover);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-danger:hover {
  background: var(--danger-hover);
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.icon-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==================== GİRİŞ / KAYIT EKRANI ==================== */
.auth-screen {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at 50% 20%, #1a2230 0%, #0d1117 70%);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 32px 24px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-logo-box {
  text-align: center;
  margin-bottom: 24px;
}
.auth-icon-wrap {
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 168, 255, 0.3);
}
.auth-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.auth-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.auth-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
}

.auth-tabs {
  display: flex;
  background: var(--bg-main);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.auth-tab.active {
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.form-input {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text-main);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus {
  border-color: var(--primary);
}

.auth-error {
  background: rgba(218, 54, 51, 0.15);
  border: 1px solid var(--danger);
  color: #ff7b72;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  text-align: center;
}
.auth-submit-btn {
  margin-top: 6px;
  height: 46px;
}

/* ==================== ANA UYGULAMA LAYOUT ==================== */
.app-layout {
  display: flex;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg-main);
}

/* ==================== SIDEBAR ==================== */
.sidebar {
  width: 380px;
  min-width: 320px;
  height: 100%;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
}

.sidebar-header {
  height: 64px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background: rgba(22, 27, 34, 0.85);
  backdrop-filter: blur(10px);
}

.user-profile-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  transition: background 0.2s;
}
.user-profile-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.avatar-wrap {
  position: relative;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}
.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-card);
  display: block;
}
.avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #ffffff;
  font-size: 17px;
  border-radius: 50%;
  text-transform: uppercase;
  user-select: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}
.status-indicator {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--bg-surface);
  background: #6e7681;
}
.status-indicator.online {
  background: var(--accent-green-bright);
}

.user-name-box {
  display: flex;
  flex-direction: column;
}
.user-display-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-badge {
  font-size: 11px;
  color: var(--accent-green-bright);
}

.sidebar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Hikayeler Çubuğu */
.stories-bar {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-surface);
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
}
.stories-container {
  display: inline-flex;
  gap: 14px;
}

.story-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.story-ring {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  padding: 2.5px;
  background: linear-gradient(45deg, #00a8ff, #9b51e0, #ff4081);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, background 0.2s;
}
.story-ring:active {
  transform: scale(0.95);
}
.story-ring.unseen {
  background: linear-gradient(45deg, #00a8ff, #9b51e0, #ff4081) !important;
}
.story-ring.watched {
  background: #363d47 !important;
  opacity: 0.65;
}
.story-ring.my-story {
  background: transparent !important;
  border: 2px dashed var(--primary);
  padding: 0;
}
.story-ring.my-story.active {
  background: linear-gradient(45deg, #00a8ff, #9b51e0, #ff4081) !important;
  border: none;
  padding: 2.5px;
}
.story-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bg-surface);
}
.story-add-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 18px;
  height: 18px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  border: 2px solid var(--bg-surface);
}
.story-label {
  font-size: 12px;
  color: var(--text-muted);
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Arama Çubuğu */
.sidebar-search {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
}
.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
}
.search-icon {
  color: var(--text-muted);
}
.search-input-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 14px;
  outline: none;
}

/* Sohbet Listesi */
.chat-list {
  flex: 1;
  overflow-y: auto;
}
.chat-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.15s;
}
.chat-list-item:hover {
  background: var(--bg-surface-hover);
}
.chat-list-item.active {
  background: #1f2733;
}

.item-content {
  flex: 1;
  min-width: 0;
}
.item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.item-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item-time {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.item-preview {
  font-size: 13px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item-preview.typing {
  color: var(--primary);
  font-style: italic;
}
.unread-badge {
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.list-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
  gap: 12px;
}

/* ==================== SAĞ PANEL: CHAT PANE ==================== */
.chat-pane {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: var(--theme-bg, #090c10);
  position: relative;
  overflow: hidden;
}

/* 3 Nokta Açılır Menü */
.dropdown-wrap {
  position: relative;
}
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  background: #1c2128 !important;
  border: 1px solid #363d47;
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: fadeIn 0.15s ease-out;
}
.dropdown-menu.hidden {
  display: none !important;
}
.dropdown-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text-main);
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
}
.dropdown-item.text-danger {
  color: #ff5b5b;
}
.dropdown-item.text-danger:hover {
  background: rgba(255, 91, 91, 0.12);
}
.dropdown-item.text-warning {
  color: #f1b631;
}
.dropdown-item.text-warning:hover {
  background: rgba(241, 182, 49, 0.12);
}

/* Boş Durum */
.chat-empty-state {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
}
.empty-content {
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.empty-logo {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  opacity: 0.85;
}
.empty-content h2 {
  font-size: 24px;
  font-weight: 700;
}
.empty-content p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}
.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-subtle);
  font-size: 13px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 20px;
  margin-top: 8px;
}

/* Aktif Durum */
.chat-active-state {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
}

.chat-header {
  height: 64px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background: rgba(22, 27, 34, 0.85);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.mobile-only {
  display: none;
}
.chat-header-info {
  display: flex;
  flex-direction: column;
}
.chat-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
}
.chat-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}
.chat-subtitle.online {
  color: var(--accent-green-bright);
}
.chat-subtitle.typing {
  color: var(--primary);
  font-weight: 600;
}

.chat-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Mesajlar Alanı */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
}

.date-divider {
  align-self: center;
  background: rgba(33, 38, 45, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 8px 0;
}

.msg-row {
  display: flex;
  flex-direction: column;
  max-width: 70%;
  animation: msgPop 0.15s ease-out;
}
@keyframes msgPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.msg-row.self {
  align-self: flex-end;
}
.msg-row.other {
  align-self: flex-start;
}

.msg-sender-name {
  font-size: 12px;
  font-weight: 700;
  color: #58a6ff;
  margin-bottom: 3px;
  padding-left: 4px;
}

.msg-bubble {
  position: relative;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.45;
  word-break: break-word;
  user-select: text;
}

.msg-row.self .msg-bubble {
  background: var(--bubble-self);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.msg-row.other .msg-bubble {
  background: var(--bubble-other);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-bottom-left-radius: 4px;
}

.msg-reply-box {
  background: rgba(0, 0, 0, 0.25);
  border-left: 3px solid var(--primary);
  border-radius: 6px;
  padding: 5px 10px;
  margin-bottom: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.msg-reply-box:hover {
  background: rgba(0, 0, 0, 0.4);
}
.msg-reply-box .reply-author {
  font-weight: 700;
  color: #79c0ff;
}
.msg-reply-box .reply-snippet {
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Medya & Çıkartmalar */
.msg-media-img, .msg-media-video {
  max-width: 320px;
  max-height: 320px;
  border-radius: 10px;
  cursor: pointer;
  display: block;
}
.msg-sticker {
  width: 140px;
  height: 140px;
  object-fit: contain;
  cursor: pointer;
}
.msg-bubble.sticker-bubble {
  background: transparent !important;
  border: none !important;
  padding: 2px !important;
}

/* Sesli Mesaj Oynatıcısı */
.audio-player-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}
.audio-play-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.audio-waveform {
  flex: 1;
  height: 24px;
  display: flex;
  align-items: center;
  gap: 2px;
}
.audio-bar {
  width: 3px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 2px;
}
.audio-duration {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  font-variant-numeric: tabular-nums;
}

/* Mesaj Alt Bilgisi (Saat & Tikler) */
.msg-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 4px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
}
.msg-row.other .msg-meta {
  color: var(--text-muted);
}
.read-status.seen {
  color: var(--accent-green-bright);
}
.read-status.delivered {
  color: rgba(255,255,255,0.55);
}
.read-status:hover {
  opacity: 0.75;
}

.reaction-pill {
  position: absolute;
  bottom: -8px;
  right: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1px 6px;
  font-size: 12px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* ==================== YAZMA / GİRDİ ALANI ==================== */
.chat-input-area {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.reply-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border-radius: 8px;
  padding: 6px 12px;
}
.reply-line {
  width: 3px;
  height: 28px;
  background: var(--primary);
  border-radius: 2px;
}
.reply-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  font-size: 12px;
}
.reply-sender {
  font-weight: 700;
  color: var(--primary);
}
.reply-text {
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reply-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
}

.input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.action-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.input-wrap {
  flex: 1;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
}
.message-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 15px;
  outline: none;
  resize: none;
  max-height: 120px;
  line-height: 1.4;
}

.send-btn {
  background: var(--primary);
  color: #fff;
}
.send-btn:hover {
  background: var(--primary-hover);
  color: #fff;
}

/* Ses Kayıt Çubuğu */
.voice-recording-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 8px 16px;
  animation: fadeIn 0.2s ease;
}
.rec-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rec-dot {
  width: 10px;
  height: 10px;
  background: var(--danger);
  border-radius: 50%;
  animation: pulse 1s infinite alternate;
}
@keyframes pulse {
  from { opacity: 0.4; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1.1); }
}
.rec-timer {
  font-size: 14px;
  font-weight: 700;
  color: #ff7b72;
  font-variant-numeric: tabular-nums;
}
.rec-wave {
  display: flex;
  align-items: center;
  gap: 3px;
}
.rec-wave span {
  width: 3px;
  height: 14px;
  background: var(--primary);
  border-radius: 2px;
  animation: wave 0.8s infinite ease-in-out alternate;
}
.rec-wave span:nth-child(2) { animation-delay: 0.2s; height: 20px; }
.rec-wave span:nth-child(3) { animation-delay: 0.4s; height: 16px; }
.rec-wave span:nth-child(4) { animation-delay: 0.1s; height: 22px; }
.rec-wave span:nth-child(5) { animation-delay: 0.3s; height: 12px; }
@keyframes wave {
  from { transform: scaleY(0.4); }
  to { transform: scaleY(1.2); }
}

.rec-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.rec-cancel-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.rec-send-btn {
  background: var(--accent-green);
  color: #fff;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ==================== ÇIKARTMA PANELİ ==================== */
.sticker-panel {
  position: absolute;
  bottom: 74px;
  left: 20px;
  width: 340px;
  height: 360px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 100;
  backdrop-filter: blur(16px);
}
.sticker-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
}
.sticker-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}
.sticker-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.sticker-tab-btn.active {
  background: var(--primary-light);
  color: var(--primary);
}
.sticker-panel-content {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.sticker-item {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  cursor: pointer;
  border-radius: 8px;
  transition: transform 0.15s;
}
.sticker-item:hover {
  transform: scale(1.1);
  background: rgba(255,255,255,0.05);
}

/* ==================== MODALLAR ==================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}
.modal-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 85vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
}
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
}

.members-checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px;
}
.member-check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
}
.member-check-item:hover {
  background: var(--bg-surface-hover);
}

/* Profil & Ayarlar */
.settings-profile-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.settings-avatar-wrap {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  position: relative;
  cursor: pointer;
  overflow: hidden;
}
.settings-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.settings-avatar-edit-label {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s;
}
.settings-avatar-wrap:hover .settings-avatar-edit-label {
  opacity: 1;
}
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  font-size: 14px;
}

/* ==================== HİKAYE İZLEME ==================== */
.story-viewer-modal {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 2000;
  display: flex;
  flex-direction: column;
}
.story-progress-bar-container {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  position: absolute;
  top: var(--safe-top);
  left: 0;
  right: 0;
  z-index: 10;
}
.story-progress-bar {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  overflow: hidden;
}
.story-progress-fill {
  height: 100%;
  width: 0%;
  background: #fff;
}
.story-viewer-header {
  position: absolute;
  top: calc(var(--safe-top) + 24px);
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
}
.story-author-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.story-author-name {
  font-size: 14px;
  font-weight: 700;
}
.story-time {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  margin-left: 6px;
}
.story-close-btn, .story-delete-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  padding: 6px;
}
.story-delete-btn {
  font-size: 13px;
  color: #ff7b72;
  margin-right: 8px;
}
.story-content-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.story-content-area img, .story-content-area video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Lightbox */
.lightbox-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}
.lightbox-actions-top {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 10;
}
.lightbox-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}
.lightbox-close {
  position: static;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 20px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.lightbox-close:hover {
  background: rgba(218, 54, 51, 0.7);
  border-color: #da3633;
}
.lightbox-content img, .lightbox-content video {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
}

/* iOS Safari PWA Rehberi */
.ios-prompt {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  max-width: 400px;
  margin: 0 auto;
  background: #1c2128;
  border: 1px solid var(--primary);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  z-index: 5000;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.ios-prompt-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
}
.ios-prompt h4 {
  font-size: 15px;
  margin-bottom: 6px;
  color: var(--primary);
}
.ios-prompt p {
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.4;
}

/* ==================== SEKME GÖRÜNÜMLERİ & ALT BAR ==================== */
.tab-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}
.tab-view.hidden {
  display: none !important;
}

.bottom-nav-bar {
  height: 56px;
  background: rgba(22, 27, 34, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 4px calc(env(safe-area-inset-bottom, 0px) / 2);
  flex-shrink: 0;
  z-index: 5;
}

.nav-tab-btn {
  flex: 1;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 0;
  transition: color 0.15s;
  user-select: none;
}
.nav-tab-btn:hover {
  color: var(--text-main);
}
.nav-tab-btn.active {
  color: var(--primary);
  font-weight: 600;
}
.nav-icon-wrap {
  position: relative;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  background: #ff5252;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  border: 2px solid var(--bg-surface);
}
.nav-label {
  font-size: 11px;
  letter-spacing: 0.2px;
}
.nav-tab-add {
  flex: 0 0 54px;
}
.nav-add-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 300;
  box-shadow: 0 4px 12px rgba(0, 168, 255, 0.4);
  transition: transform 0.15s;
  margin-top: -8px;
}
.nav-tab-add:active .nav-add-icon {
  transform: scale(0.92);
}

/* ==================== KEŞFET (EXPLORE) EKRANI ==================== */
.view-header {
  height: 64px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background: rgba(22, 27, 34, 0.85);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}
.view-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.view-header-title h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}
.view-header-title p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}
.header-icon-accent {
  flex-shrink: 0;
}
.explore-content {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
}
.explore-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 4px;
}
.explore-item {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s;
}
.explore-item:active {
  transform: scale(0.98);
}
.explore-item img,
.explore-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.explore-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 40%, transparent 70%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10px;
  color: #fff;
  opacity: 1;
}
.explore-user-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
}
.explore-user-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}
.explore-video-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0,0,0,0.6);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 11px;
}

/* ==================== PROFİL & AYARLAR EKRANI ==================== */
.profile-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.profile-main-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px 16px 20px;
  text-align: center;
}
.profile-avatar-container {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}
.profile-large-avatar-wrap {
  width: 86px;
  height: 86px;
  max-width: 86px;
  max-height: 86px;
  border-radius: 50%;
  position: relative;
  background: var(--bg-surface);
  flex-shrink: 0;
}
.profile-large-avatar-wrap img,
.profile-large-avatar-wrap .avatar-img {
  width: 86px !important;
  height: 86px !important;
  max-width: 86px !important;
  max-height: 86px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  display: block;
}
.avatar-camera-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 28px;
  height: 28px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  border: 2px solid var(--bg-card);
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.profile-username {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}
.profile-bio-text {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 10px;
  max-width: 90%;
  margin-left: auto;
  margin-right: auto;
}
.profile-meta-row {
  display: flex;
  justify-content: center;
  gap: 8px;
}
.profile-birth-badge {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 6px 14px;
  display: flex;
  flex-direction: column;
}
.settings-card-title {
  font-size: 11.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.6px;
  padding: 8px 4px 6px;
  font-weight: 600;
  margin: 0;
}
.settings-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
}
.settings-action-row:last-child {
  border-bottom: none;
}
.settings-action-row:hover {
  background: rgba(255,255,255,0.02);
}
.action-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.action-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}
.action-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  display: block;
}
.action-desc {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
}
.action-arrow {
  font-size: 18px;
  color: var(--text-muted);
  padding-right: 4px;
}

.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  cursor: pointer;
}
.settings-toggle-row:last-child {
  border-bottom: none;
}
.toggle-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.toggle-icon {
  font-size: 17px;
  width: 24px;
  text-align: center;
}
.toggle-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  display: block;
}
.toggle-desc {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
}

.ios-switch {
  appearance: none;
  -webkit-appearance: none;
  width: 44px;
  height: 26px;
  background: rgba(255,255,255,0.18);
  border-radius: 13px;
  position: relative;
  cursor: pointer;
  outline: none;
  transition: background 0.25s;
  flex-shrink: 0;
}
.ios-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.25s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.ios-switch:checked {
  background: var(--accent-green-bright);
}
.ios-switch:checked::after {
  transform: translateX(18px);
}
.logout-card {
  padding: 14px;
}

/* ==================== 3 NOKTA MENÜSÜ ==================== */
.dropdown-wrap {
  position: relative;
  z-index: 1000;
}
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: #181d24 !important;
  border: 1px solid #384252 !important;
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.95), 0 4px 16px rgba(0, 0, 0, 0.6) !important;
  z-index: 99999 !important;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dropdown-menu.hidden {
  display: none !important;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  color: #edf1f7 !important;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}
.dropdown-item.text-danger {
  color: #ff5b5b !important;
}
.dropdown-item.text-danger:hover {
  background: rgba(255, 91, 91, 0.15) !important;
}
.dropdown-item.text-warning {
  color: #f1b631 !important;
}
.dropdown-item.text-warning:hover {
  background: rgba(241, 182, 49, 0.15) !important;
}

.sticker-item-wrap {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 10px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.15s, background 0.15s;
  padding: 6px;
  overflow: hidden;
}
.sticker-item-wrap:hover {
  transform: scale(1.08);
  background: rgba(255, 255, 255, 0.1);
}
.sticker-item {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  display: block;
}

.msg-row.highlight-glow .msg-bubble {
  animation: glowPulse 1.8s ease-out;
}
@keyframes glowPulse {
  0% { box-shadow: 0 0 0 0 var(--accent, #00a8ff); }
  30% { box-shadow: 0 0 0 8px var(--accent, #00a8ff); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ==================== TEMA SEÇİCİ MODAL ==================== */
.theme-modal-card {
  max-width: 520px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
}
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 10px;
  overflow-y: auto;
  padding: 14px 2px;
}
.theme-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 14px 10px 12px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
.theme-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}
.theme-card.active {
  border-color: var(--primary);
  background: rgba(0, 168, 255, 0.12);
}
.theme-color-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  margin: 0 auto 8px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.35);
}
.theme-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  display: block;
}
.theme-badge-check {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 4px;
  display: block;
}

/* ==================== ÇIKARTMA VE STICKER GELİŞTİRMELERİ ==================== */
.sticker-bubble {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 4px !important;
}
.msg-sticker {
  max-width: 165px;
  max-height: 165px;
  object-fit: contain;
  cursor: pointer;
  display: block;
  transition: transform 0.15s;
}
.msg-sticker:hover {
  transform: scale(1.04);
}
.sticker-panel-actions {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
}
.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 6px;
}

/* ==================== HİKAYE PAYLAŞMA MODALI ==================== */
.add-story-body {
  padding: 14px 0 4px;
}
.story-preview-area {
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 360px;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 12px;
  border: 1px solid var(--border-color);
}
.story-preview-media {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.story-preview-empty {
  color: var(--text-muted);
  font-size: 14px;
}
.story-pick-buttons {
  display: flex;
  gap: 10px;
}
.story-pick-buttons button {
  flex: 1;
}

/* ==================== ENGELLİ LİSTESİ ==================== */
.blocked-list {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 0;
}
.blocked-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}
.blocked-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

/* ==================== SOHBET TEMALARI CSS DİNAMİK DEĞİŞKENLERİ ==================== */
.chat-pane {
  background-color: var(--theme-bg, #090c10) !important;
  transition: background-color 0.25s;
}
.chat-pane .chat-header {
  background: var(--theme-surface, rgba(22, 27, 34, 0.85)) !important;
  border-bottom: 1px solid var(--theme-border, var(--border-color)) !important;
}
.chat-pane .chat-input-area {
  background: var(--theme-surface, var(--bg-surface)) !important;
  border-top: 1px solid var(--theme-border, var(--border-color)) !important;
}
.chat-pane .msg-row.self .msg-bubble {
  background-color: var(--theme-self-bubble, var(--bubble-self)) !important;
  color: var(--theme-self-text, #ffffff) !important;
}
.chat-pane .msg-row.other .msg-bubble {
  background-color: var(--theme-other-bubble, var(--bubble-other)) !important;
  color: var(--theme-other-text, var(--text-main)) !important;
  border-color: var(--theme-border, var(--border-subtle)) !important;
}

/* ==================== ÖZEL TEMA DUVAR KAĞITLARI & DESENLERİ ==================== */
.messages-container.theme-spiderman,
.messages-container.theme-spiderman-v2 {
  background-image: 
    radial-gradient(circle at 50% 50%, rgba(229, 57, 53, 0.16) 0%, transparent 70%),
    repeating-radial-gradient(circle at 50% 50%, transparent 0, transparent 22px, rgba(229, 57, 53, 0.12) 23px, transparent 24px),
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px) !important;
  background-size: 100% 100%, 100% 100%, 36px 36px, 36px 36px !important;
}

.messages-container.theme-hello-kitty,
.messages-container.theme-hello-kitty-v2 {
  background-image: 
    radial-gradient(circle at 50% 30%, rgba(255, 64, 129, 0.18) 0%, transparent 60%),
    radial-gradient(rgba(255, 128, 171, 0.14) 2.5px, transparent 2.5px),
    radial-gradient(rgba(255, 255, 255, 0.08) 1.5px, transparent 1.5px) !important;
  background-size: 100% 100%, 30px 30px, 15px 15px !important;
}

.messages-container.theme-kuromi,
.messages-container.theme-kuromi-v2 {
  background-image: 
    radial-gradient(circle at 50% 50%, rgba(142, 36, 170, 0.22) 0%, transparent 70%),
    radial-gradient(rgba(179, 136, 255, 0.12) 2px, transparent 2px),
    linear-gradient(135deg, rgba(123, 31, 162, 0.08) 25%, transparent 25%, transparent 50%, rgba(123, 31, 162, 0.08) 50%, rgba(123, 31, 162, 0.08) 75%, transparent 75%, transparent) !important;
  background-size: 100% 100%, 28px 28px, 40px 40px !important;
}

.messages-container.theme-batman {
  background-image: 
    radial-gradient(circle at 50% 25%, rgba(255, 214, 0, 0.12) 0%, transparent 50%),
    linear-gradient(180deg, rgba(6, 7, 9, 0.85) 0%, rgba(15, 18, 24, 0.95) 100%),
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px) !important;
  background-size: 100% 100%, 100% 100%, 42px 42px, 42px 42px !important;
}

.messages-container.theme-rick-and-morty {
  background-image: 
    radial-gradient(circle at 50% 50%, rgba(0, 230, 118, 0.18) 0%, rgba(0, 137, 123, 0.08) 50%, transparent 80%),
    radial-gradient(rgba(0, 230, 118, 0.12) 2.5px, transparent 2.5px),
    radial-gradient(rgba(118, 255, 3, 0.08) 1.5px, transparent 1.5px) !important;
  background-size: 100% 100%, 38px 38px, 19px 19px !important;
}

.messages-container.theme-spongebob {
  background-image: 
    radial-gradient(circle at 50% 30%, rgba(41, 182, 246, 0.18) 0%, transparent 70%),
    radial-gradient(circle, rgba(255, 214, 0, 0.1) 3.5px, transparent 4.5px),
    radial-gradient(circle, rgba(255, 255, 255, 0.1) 2px, transparent 3px) !important;
  background-size: 100% 100%, 48px 48px, 24px 24px !important;
}

.messages-container.theme-naruto {
  background-image: 
    radial-gradient(circle at 50% 50%, rgba(229, 57, 53, 0.2) 0%, transparent 65%),
    radial-gradient(rgba(255, 87, 34, 0.12) 2.5px, transparent 2.5px),
    radial-gradient(rgba(244, 67, 54, 0.08) 1.5px, transparent 1.5px) !important;
  background-size: 100% 100%, 32px 32px, 16px 16px !important;
}

.messages-container.theme-okyanus {
  background-image: 
    radial-gradient(circle at 50% 40%, rgba(58, 134, 255, 0.18) 0%, transparent 70%),
    linear-gradient(180deg, rgba(9, 17, 26, 0.7) 0%, rgba(13, 27, 42, 0.85) 100%),
    radial-gradient(rgba(58, 134, 255, 0.1) 2px, transparent 2px) !important;
  background-size: 100% 100%, 100% 100%, 30px 30px !important;
}

.messages-container.theme-orman {
  background-image: 
    radial-gradient(circle at 50% 50%, rgba(78, 155, 111, 0.16) 0%, transparent 70%),
    radial-gradient(rgba(78, 155, 111, 0.1) 2.5px, transparent 2.5px) !important;
  background-size: 100% 100%, 32px 32px !important;
}

.messages-container.theme-neon {
  background-image: 
    radial-gradient(circle at 50% 30%, rgba(189, 0, 255, 0.18) 0%, transparent 65%),
    linear-gradient(rgba(189, 0, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.08) 1px, transparent 1px) !important;
  background-size: 100% 100%, 32px 32px, 32px 32px !important;
}

.messages-container.theme-gunbatimi {
  background-image: 
    radial-gradient(circle at 50% 40%, rgba(217, 119, 54, 0.22) 0%, transparent 65%),
    linear-gradient(180deg, rgba(20, 14, 10, 0.75) 0%, rgba(32, 18, 12, 0.9) 100%) !important;
  background-size: 100% 100%, 100% 100% !important;
}

/* ==================== KİŞİ PROFİL KARTI ==================== */
.user-profile-card {
  max-width: 380px;
  text-align: center;
  padding: 24px 20px;
}
.user-profile-header {
  margin-bottom: 16px;
}
.user-profile-avatar-wrap {
  width: 84px;
  height: 84px;
  margin: 0 auto 12px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
.user-profile-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.user-profile-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
}
.user-profile-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}
.user-profile-info-box {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 14px;
  text-align: left;
  margin-bottom: 10px;
}
.info-box-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}
.info-box-text {
  font-size: 14px;
  color: var(--text-main);
  margin-top: 4px;
  word-break: break-word;
}
.user-profile-actions {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ==================== MEDYA ÖNİZLEME VE TEK GÖRÜNÜM ==================== */
.media-preview-card {
  max-width: 480px;
  padding: 16px;
}
.media-preview-display {
  width: 100%;
  max-height: 55vh;
  border-radius: 12px;
  background: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.media-preview-el {
  max-width: 100%;
  max-height: 55vh;
  object-fit: contain;
}
.view-once-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 10px;
}
.view-once-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.view-once-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-main);
}
.view-once-btn.active {
  background: rgba(0, 168, 255, 0.2) !important;
  color: #00a8ff !important;
  border-color: #00a8ff !important;
  box-shadow: 0 0 10px rgba(0, 168, 255, 0.35);
}
.view-once-icon {
  font-size: 16px;
  font-weight: 700;
}
.view-once-hint {
  font-size: 12px;
  color: var(--text-muted);
  flex: 1;
}
.modal-actions {
  display: flex;
  gap: 10px;
}
.modal-actions button {
  flex: 1;
}

/* ==================== TEK GÖRÜNÜM MESAJ BALONCUĞU ==================== */
.single-view-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}
.single-view-pill.unopened {
  background: rgba(0, 168, 255, 0.25);
  color: #58a6ff;
  border: 1px solid rgba(0, 168, 255, 0.4);
}
.single-view-pill.unopened:hover {
  background: rgba(0, 168, 255, 0.4);
  transform: scale(1.02);
}
.single-view-pill.opened {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  cursor: default;
}
.single-view-pill.sent-pill {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: default;
}

/* ==================== MESAJ BASILI TUTMA & TEPKİ MENÜSÜ ==================== */
.msg-action-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease-out;
}
.message-action-menu {
  width: 90%;
  max-width: 320px;
  background: #1c2128;
  border: 1px solid #363d47;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  animation: popScale 0.15s cubic-bezier(0.1, 0.9, 0.2, 1);
}
@keyframes popScale {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
.reaction-emoji-bar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 10px 8px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid #363d47;
}
.reaction-btn {
  background: transparent;
  border: none;
  font-size: 24px;
  padding: 4px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.12s;
}
.reaction-btn:hover, .reaction-btn:active {
  transform: scale(1.3);
}
.action-menu-list {
  display: flex;
  flex-direction: column;
  padding: 6px;
}
.msg-menu-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text-main);
  padding: 12px 14px;
  font-size: 14.5px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.msg-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
}
.msg-menu-item.text-danger {
  color: #ff5b5b;
}
.msg-menu-item.text-danger:hover {
  background: rgba(255, 91, 91, 0.12);
}

/* ==================== GRUP DETAYI VE YÖNETİMİ ==================== */
.group-info-card {
  max-width: 440px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 20px;
}
.group-info-avatar-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}
.group-avatar-circle {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  position: relative;
  background: var(--bg-surface);
}
.group-avatar-circle img {
  width: 74px !important;
  height: 74px !important;
  border-radius: 50%;
  object-fit: cover;
}
.form-label-sm {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: block;
}
.members-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}
.group-member-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-main);
  border: 1px solid var(--border-subtle);
  margin-bottom: 6px;
}
.group-member-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-badge {
  font-size: 10px;
  font-weight: 700;
  background: rgba(0, 168, 255, 0.2);
  color: #00a8ff;
  padding: 2px 6px;
  border-radius: 6px;
}
.kick-btn {
  background: transparent;
  border: 1px solid #da3633;
  color: #ff5b5b;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.kick-btn:hover {
  background: #da3633;
  color: #fff;
}

/* ==================== MOBİL UYUM (IPHONE & ANDROID) ==================== */
@media (max-width: 768px) {
  .app-layout {
    position: relative;
  }
  .sidebar {
    width: 100%;
    min-width: 100%;
  }
  .chat-pane {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.1, 0.9, 0.2, 1);
    z-index: 10;
  }
  .app-layout.in-chat .chat-pane {
    transform: translateX(0);
  }
  .mobile-only {
    display: flex;
  }
  .sticker-panel {
    width: calc(100vw - 32px);
    left: 16px;
  }
  .msg-row {
    max-width: 85%;
  }
}

/* ==================== ANDROİD MOBİL HIZLI İNDİR BUTONU ==================== */
.android-download-pill {
  position: fixed;
  top: max(14px, env(safe-area-inset-top, 14px));
  right: max(14px, env(safe-area-inset-right, 14px));
  z-index: 99999;
  display: flex;
  align-items: center;
  background: rgba(14, 18, 26, 0.95);
  border: 1px solid rgba(61, 220, 132, 0.45);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.65), 0 0 16px rgba(61, 220, 132, 0.22);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 32px;
  padding: 5px 8px 5px 12px;
  gap: 8px;
  animation: androidPillSlideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s;
}

.android-download-pill:active {
  transform: scale(0.97);
}

.android-download-pill.hidden {
  display: none !important;
}

/* Aktif sohbetteyken sağ üst butonları kapatmamak için gizle */
.app-layout.in-chat ~ .android-download-pill,
.app-layout.in-chat ~ #androidDownloadPill,
body.in-chat #androidDownloadPill {
  display: none !important;
}

.android-download-main {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: #ffffff;
}

.android-pill-icon {
  width: 28px;
  height: 28px;
  background: rgba(61, 220, 132, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3ddc84;
  flex-shrink: 0;
}

.android-pill-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.android-pill-title {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.2px;
  white-space: nowrap;
}

.android-pill-sub {
  font-size: 10px;
  font-weight: 600;
  color: #3ddc84;
  margin-top: 1px;
  white-space: nowrap;
}

.android-pill-badge {
  width: 20px;
  height: 20px;
  background: #3ddc84;
  color: #0b1117;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
  flex-shrink: 0;
  animation: androidPillPulse 2s infinite ease-in-out;
}

@keyframes androidPillPulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(2px); }
}

@keyframes androidPillSlideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.android-pill-close {
  background: transparent;
  border: none;
  color: #8b949e;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  border-radius: 50%;
  transition: color 0.15s, background-color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: 2px;
}

.android-pill-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.android-sidebar-btn {
  background: rgba(61, 220, 132, 0.12) !important;
  border: 1px solid rgba(61, 220, 132, 0.35) !important;
  color: #3ddc84 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

.android-sidebar-btn.hidden {
  display: none !important;
}
