/* Profil sayfası: kapak, avatar, formlar, sekmeler */
.profil-page {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  min-width: 0;
}

.profil-cover {
  height: 200px;
  background: var(--border);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 12px;
  margin-bottom: -50px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
}
.profil-cover-placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.profil-cover-actions {
  margin-top: auto;
  padding: 0.5rem 1rem;
  background: rgba(0,0,0,.4);
  border-radius: 0 0 12px 12px;
  display: flex;
  justify-content: flex-end;
}
.profil-cover:not([style*="background-image"]) .profil-cover-actions { background: var(--border); }
.profil-cover-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.profil-cover-form .profil-cover-edit { color: #fff; }
.profil-cover-form .btn { flex-shrink: 0; }
.profil-hidden-input { position: absolute; width: 0; height: 0; opacity: 0; }
.profil-cover-edit {
  cursor: pointer;
  color: var(--accent);
  font-size: 0.9rem;
}
.profil-cover-edit:hover {
  text-decoration: underline;
}

.profil-header {
  display: flex;
  gap: 1.5rem;
  padding: 1rem 0 1rem;
  flex-wrap: wrap;
  align-items: flex-start;
}
.profil-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.profil-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg-card);
  display: block;
  background: var(--border);
}
.profil-avatar-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 600;
  border: 4px solid var(--bg-card);
}
.profil-avatar-actions { width: 100%; }
.profil-avatar-form {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.profil-avatar-label { cursor: pointer; display: block; }
.profil-avatar-label:hover .profil-avatar { opacity: 0.9; }
.profil-avatar-label:hover .profil-avatar-placeholder { opacity: 0.9; }
.profil-upload-hint.error { text-align: center; }

.profil-info {
  flex: 1;
  min-width: 0;
  max-width: 100%;
}
.profil-username { margin: 0 0 0.25rem; font-size: 1.5rem; font-weight: 700; word-break: break-word; }
.profil-username-link { color: inherit; text-decoration: none; }
.profil-username-link:hover { color: var(--accent); text-decoration: underline; }
.profil-bio-block { margin: 0.5rem 0; }
.profil-bio-display {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.profil-bio { margin: 0; color: var(--text-muted); font-size: 0.95rem; line-height: 1.5; word-break: break-word; }
.profil-bio-edit {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 1rem;
  padding: 0 0.25rem;
  flex-shrink: 0;
}
.profil-bio-form textarea { width: 100%; max-width: 100%; padding: 0.5rem; border-radius: 8px; border: 1px solid var(--border); font: inherit; resize: vertical; }
.profil-bio-form-actions { margin-top: 0.5rem; display: flex; gap: 0.5rem; }
.profil-header-actions { margin-top: 0.75rem; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.profil-arkadas-inline { display: inline-block; margin-right: 0.5rem; }
.profil-arkadas-badge { color: var(--text-muted); font-size: 0.95rem; }
.profil-arkadas-pending { color: var(--text-muted); font-size: 0.95rem; }
.profil-arkadas-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0; }
.profil-arkadas-list-item { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.profil-arkadas-list-item:last-child { border-bottom: none; }
.profil-arkadas-list a { display: flex; align-items: center; gap: 0.5rem; color: var(--text); text-decoration: none; flex: 1; min-width: 0; }
.profil-arkadas-list a:hover { color: var(--accent); }
.profil-arkadas-actions { display: flex; gap: 0.35rem; flex-shrink: 0; }
.profil-arkadas-action-form { margin: 0; }
.profil-arkadas-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.profil-arkadas-placeholder { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; }
.profil-stats {
  display: flex;
  gap: 1.5rem;
  margin: 0.75rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.profil-stats strong {
  color: var(--text);
}

.profil-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.profil-tabs::-webkit-scrollbar { display: none; }
.profil-tab {
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  font-weight: 500;
  cursor: pointer;
  font-size: 1rem;
  flex-shrink: 0;
}
.profil-tab:hover {
  color: var(--text);
}
.profil-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.profil-content {
  min-height: 200px;
  min-width: 0;
  overflow-x: hidden;
}
.profil-pane {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}
.profil-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.profil-empty-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 0.5rem;
}
.profil-feed-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Profil şiir/yazı liste görünümü (taşma önleme) */
.profil-eser-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}
.profil-eser-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}
.profil-eser-list-item:last-child { border-bottom: none; }
.profil-eser-list-link {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  display: block;
  line-height: 1.4;
}
.profil-eser-list-link:hover { color: var(--accent); text-decoration: underline; }
.profil-eser-list-meta {
  flex-shrink: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  max-width: 50%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Hata mesajı (avatar/cover yükleme) */
.profil-upload-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}
.profil-upload-hint.error {
  color: #dc3545;
}

/* Profil engelli / sadece arkadaşlar mesajları */
.profil-engelli {
  padding-top: 2rem;
}
.profil-engelli-box {
  text-align: center;
  padding: 2rem;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
}
.profil-engelli-mesaj {
  margin: 0 0 1rem;
  color: var(--text-muted);
}
.profil-sadece-arkadaslar {
  padding: 1.5rem;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
}
.profil-sadece-arkadaslar-mesaj {
  margin: 0;
  color: var(--text-muted);
  text-align: center;
}

/* Künye: üyelik tarihi, son görülme */
.profil-kunye {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  color: var(--text);
}
.profil-uyelik { margin-bottom: 0.15rem; }
.profil-son-gorulme { margin-bottom: 0.5rem; font-weight: 500; }

/* Çevrimiçi / çevrimdışı göstergesi (avatar yanında kırmızı/yeşil yanıp sönen nokta) */
.profil-avatar-wrap { position: relative; }
.profil-online-dot,
.profil-offline-dot {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--bg-card);
  box-sizing: border-box;
  animation: profil-dot-blink 1.5s ease-in-out infinite;
}
.profil-online-dot {
  background: #22c55e;
  box-shadow: 0 0 0 2px #22c55e40;
}
.profil-offline-dot {
  background: #ef4444;
  box-shadow: 0 0 0 2px #ef444440;
}
@keyframes profil-dot-blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.1); }
}

.profil-gizlilik-note {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.profil-gizlilik-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  cursor: pointer;
  font-size: inherit;
  text-decoration: underline;
}
.profil-gizlilik-link:hover { color: var(--accent-hover); }

/* Mobil: taşma ve kaydırma düzeltmeleri */
@media (max-width: 768px) {
  .profil-page {
    padding: 0 0.75rem 1.5rem;
  }
  .profil-cover {
    height: 140px;
    margin-bottom: -40px;
    border-radius: 0;
  }
  .profil-cover-actions { border-radius: 0 !important; }
  .profil-cover:not([style*="background-image"]) .profil-cover-actions { border-radius: 0; }
  .profil-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem 0;
    gap: 1rem;
  }
  .profil-avatar-wrap {
    margin-top: 0.5rem;
  }
  .profil-avatar,
  .profil-avatar-placeholder {
    width: 96px;
    height: 96px;
    font-size: 2rem;
  }
  .profil-info {
    width: 100%;
    text-align: center;
  }
  .profil-header-actions {
    justify-content: center;
  }
  .profil-bio-display {
    justify-content: center;
  }
  .profil-stats {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }
  .profil-tabs {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
    padding-left: 0.75rem;
  }
  .profil-arkadas-list-item {
    flex-wrap: wrap;
  }
  .profil-arkadas-list a {
    min-width: 0;
  }
  .profil-arkadas-actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: 0.25rem;
  }
  .profil-pane {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
  .profil-eser-list {
    padding: 0;
    margin: 0;
    min-width: 0;
  }
  .profil-eser-list-item {
    flex-wrap: wrap;
    gap: 0.35rem;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    padding-left: 0;
    padding-right: 0;
  }
  .profil-eser-list-link {
    flex: 1 1 100%;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    box-sizing: border-box;
  }
  .profil-eser-list-meta {
    flex: 0 0 auto;
    font-size: 0.75rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
