/* Canlı destek — ayrı dosya (panel.css güncel olmasa da çalışır) */

.page-content:has(.support-page) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 1rem;
}

.support-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
  min-height: 0;
  height: calc(100vh - var(--header-h) - 2.5rem);
  max-height: calc(100vh - var(--header-h) - 2.5rem);
}

.support-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.15rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex-shrink: 0;
}

.support-toolbar .page-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

.support-toolbar a {
  color: var(--primary);
  text-decoration: none;
}

.support-layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 1rem;
  flex: 1;
  min-height: 0;
  align-items: stretch;
  overflow: hidden;
}

.support-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 0;
  max-height: 100%;
}

.support-ticket-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  width: 100%;
  text-align: left;
  padding: 0.8rem 0.85rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.support-ticket-item:hover {
  border-color: rgba(247, 147, 30, 0.2);
  transform: translateY(-1px);
}

.support-ticket-item.active {
  background: rgba(247, 147, 30, 0.1);
  border-color: rgba(247, 147, 30, 0.35);
}

.support-ticket-item strong {
  font-size: 0.9rem;
  line-height: 1.3;
}

.support-ticket-item small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.support-ticket-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.72rem;
  color: var(--muted);
}

.support-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--muted);
}

.support-chat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  height: 100%;
  overflow: hidden;
}

.support-chat-head {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: rgba(247, 147, 30, 0.04);
}

.support-chat-head strong {
  font-size: 1rem;
}

.support-chat-log {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--bg-elevated);
}

.support-chat-placeholder {
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  padding: 2rem;
  text-align: center;
  overflow-y: auto;
}

.support-msg {
  max-width: min(82%, 520px);
  padding: 0.75rem 0.95rem;
  border-radius: 14px;
  line-height: 1.5;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.support-msg.client {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.support-msg.admin {
  align-self: flex-end;
  background: rgba(247, 147, 30, 0.14);
  border: 1px solid rgba(247, 147, 30, 0.35);
  border-bottom-right-radius: 4px;
}

.support-msg.ai {
  align-self: flex-end;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.32);
  border-bottom-right-radius: 4px;
}

.support-msg-meta {
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.support-msg-body {
  font-size: 0.92rem;
  word-break: break-word;
}

.support-reply {
  display: flex;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border);
  align-items: flex-end;
  background: var(--bg-card);
  flex-shrink: 0;
}

.support-reply textarea {
  flex: 1;
  min-height: 72px;
  max-height: 160px;
  resize: vertical;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  padding: 0.7rem 0.8rem;
  font: inherit;
  line-height: 1.45;
}

.support-reply textarea:focus {
  outline: none;
  border-color: rgba(247, 147, 30, 0.5);
  box-shadow: 0 0 0 3px rgba(247, 147, 30, 0.12);
}

.support-reply .btn {
  flex-shrink: 0;
  min-width: 88px;
}

.support-closed-note {
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border);
  margin: 0;
  text-align: center;
  background: var(--bg-card);
  color: var(--muted);
  font-size: 0.88rem;
}

@media (max-width: 860px) {
  .support-page {
    max-height: none;
  }
  .page-content:has(.support-page) {
    overflow: visible;
  }
  .support-layout {
    grid-template-columns: 1fr;
    overflow: visible;
  }
  .support-sidebar {
    max-height: 200px;
  }
  .support-chat {
    min-height: min(55vh, 480px);
    max-height: min(55vh, 480px);
  }
}
