/* Arkadaşlık eklentisi UI — sidebar tab, modallar, banner.
 * Sitenin açık tema design token'larını (style.css :root) kullanır. */

#tabFriends.active {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 8px;
  overflow-y: auto;
  background: var(--bg-white);
}

.friends-tab-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px 4px 8px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 6px;
}

.friends-tab-actions .btn {
  font-size: 12.5px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  background: var(--bg-light);
  color: var(--text-dark);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.friends-tab-actions .btn:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

.friends-list-host {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 2px;
}

.friend-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: var(--radius);
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.friend-row:hover {
  background: var(--bg-light);
  border-color: var(--border);
  box-shadow: var(--shadow-md);
}

.friend-avatar {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 14px;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

.friend-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.friend-name,
.friend-name-line {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.friend-name-line .nick-cosmetic-host {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}

.friend-status {
  font-size: 12px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 6px;
}

.friend-status::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-light);
  flex-shrink: 0;
}

.friend-status.is-online {
  color: var(--success);
}

.friend-status.is-online::before {
  background: var(--success);
  box-shadow: 0 0 0 2px rgba(67, 160, 71, 0.18);
}

.friend-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.friend-actions .btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-mid);
  border-radius: var(--radius-sm);
  padding: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.friend-actions .btn:hover {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}

.friend-actions .btn.btn-xs {
  padding: 5px 6px;
  font-size: 12px;
}

.friends-empty,
.friend-modal-empty {
  padding: 20px 12px;
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
  background: var(--bg-light);
  border-radius: var(--radius);
}

/* ===== Modal ===== */
.friend-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 46, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  padding: 16px;
}

.friend-modal {
  background: var(--bg-white);
  color: var(--text-dark);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  border: 1px solid var(--border);
}

.friend-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-white);
}

.friend-modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
}

.friend-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--text-mid);
  font-size: 22px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.friend-modal-close:hover {
  background: var(--bg-light);
  color: var(--text-dark);
}

.friend-modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  flex: 1;
}

.friend-modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--bg-light);
}

.friend-add-search input[type='text'] {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-white);
  color: var(--text-dark);
  font-size: 14px;
  margin-bottom: 12px;
  outline: none;
  transition: border-color 0.15s;
}
.friend-add-search input[type='text']:focus { border-color: var(--accent); }

.friend-add-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.friend-add-item,
.friend-request-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--bg-white);
  border: 1px solid var(--border-light);
}

.friend-add-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friend-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 500;
}

.friend-tag-ok {
  background: rgba(67, 160, 71, 0.12);
  color: var(--success);
}

.friend-request-info {
  flex: 1;
  min-width: 0;
}

.friend-request-info .friend-name {
  font-size: 14px;
}

.friend-request-msg {
  font-size: 12px;
  color: var(--text-mid);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friend-request-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.friend-tabs h4 {
  margin: 14px 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-light);
  font-weight: 600;
}
.friend-tabs h4:first-child { margin-top: 0; }

/* ===== Privacy form ===== */
.friend-privacy-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.friend-privacy-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-mid);
  font-weight: 500;
}

.friend-privacy-form select,
.friend-privacy-form input[type='date'] {
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-white);
  color: var(--text-dark);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

.friend-privacy-form select:focus,
.friend-privacy-form input[type='date']:focus {
  border-color: var(--accent);
}

.friend-checkbox {
  flex-direction: row !important;
  align-items: center;
  gap: 10px !important;
  color: var(--text-dark) !important;
  font-weight: 500;
}

.friend-checkbox input { margin: 0; }

/* ===== Banner ===== */
#friendUpcomingBanner {
  padding: 6px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.friend-banner-item {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.18), rgba(244, 114, 182, 0.18));
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text-dark);
  font-weight: 500;
}

/* ===== Context menu state ===== */
.context-menu-item-disabled {
  opacity: 0.6;
  pointer-events: none;
}

/* ===== Mobile ===== */
@media (max-width: 600px) {
  .friend-modal { max-height: 95vh; border-radius: var(--radius); }
  .friend-modal-overlay { padding: 6px; }
  .friend-row { padding: 8px 10px; gap: 10px; }
  .friend-avatar { width: 34px; height: 34px; min-width: 34px; font-size: 13px; }
  .friend-name { font-size: 13.5px; }
  .friends-tab-actions .btn { font-size: 12px; padding: 7px 8px; }
}
