/* ===== ChatGPT Tarzı (Kullanıcı Bubble + AI Düz) ===== */
:root {
  --color-bg: #212121;
  --color-surface: #2f2f2f;
  --color-surface-hover: #3e3e3e;
  --color-border: #4e4e4e;
  --color-text: #ececec;
  --color-text-muted: #adadad;
  --color-primary: #19c37d;
  --color-primary-hover: #1aa372;
  --color-user-bubble: #7c3aed;
  --color-user-bubble-text: #ffffff;
  --color-assistant-bg: #2a2a2a;
  --sidebar-w: 260px;
  --header-h: 52px;
  --bubble-max-w: 75%;
}

.theme-light {
  --color-bg: #ffffff;
  --color-surface: #f9f9f9;
  --color-surface-hover: #ececec;
  --color-border: #e5e5e5;
  --color-text: #0d0d0d;
  --color-text-muted: #676767;
  --color-user-bubble: #7c3aed;
  --color-user-bubble-text: #ffffff;
  --color-assistant-bg: #f9f9f9;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font: 14px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

/* LAYOUT */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* SIDEBAR */
.app-sidebar {
  width: var(--sidebar-w);
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 8px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  gap: 8px;
}

.sidebar-toggle {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--color-text);
  border-radius: 6px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.sidebar-toggle:hover {
  background: var(--color-surface-hover);
}

.btn-new-chat {
  flex: 1;
  height: 36px;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
}

.btn-new-chat:hover {
  background: var(--color-surface-hover);
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.sidebar-footer {
  padding: 8px;
  border-top: 1px solid var(--color-border);
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
}

.user-menu:hover {
  background: var(--color-surface-hover);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.user-avatar--text {
  background: var(--color-primary);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 13px;
}

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

.user-name {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-status {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* MAIN */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.main-header {
  height: var(--header-h);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--color-bg);
}

.model-selector {
  flex: 1;
}

.model-btn {
  height: 36px;
  border: none;
  background: transparent;
  color: var(--color-text);
  border-radius: 8px;
  padding: 0 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.model-btn:hover {
  background: var(--color-surface-hover);
}

.header-actions {
  display: flex;
  gap: 8px;
}

.btn-link-header {
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.btn-link-header:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

.btn-icon {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.btn-icon:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

/* CHAT CONTAINER */
.chat-container {
  flex: 1;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.chat-container::-webkit-scrollbar {
  width: 8px;
}

.chat-container::-webkit-scrollbar-track {
  background: transparent;
}

.chat-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.chat-messages {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  align-items: center;
  padding-inline: 16px;
}

/* MESSAGE GROUP */
.message-group {
  padding: 16px 24px;
  display: flex;
  width: 100%;
  max-width: var(--card-w);
  padding-left: 0;
  padding-right: 0;
  flex-direction: column;
}

/* KULLANICI MESAJI - Sağda Baloncuk */
.message-group--user {
  align-items: flex-end;
  background: transparent;
}

/* Görsel önizleme - mesaj balonunun ÜSTÜNDE */
.message-group--user .message-images {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.message-group--user .message-image-thumb {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--color-border);
}

.message-group--user .message-content {
  max-width: var(--bubble-max-w);
  background: var(--color-user-bubble);
  border-radius: 18px;
  padding: 12px 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message-group--user .message-text {
  color: var(--color-user-bubble-text);
  font-size: 15px;
  line-height: 1.5;
  word-wrap: break-word;
}

/* AI MESAJI - Solda Düz Arka Plan */
.message-group--assistant {
  align-items: flex-start;
  background: transparent !important;
  border-bottom: none !important;
}

.message-group--assistant .message-content {
  max-width: 100%;
  padding: 0;
}

.message-group--assistant .message-text {
  font-size: 16px;
  line-height: 1.75;
  color: var(--color-text);
  word-wrap: break-word;
}

/* TEXT FORMATTING */
.message-text p {
  margin: 0.75em 0;
}

.message-text p:first-child {
  margin-top: 0;
}

.message-text p:last-child {
  margin-bottom: 0;
}

.message-text a {
  color: inherit;
  text-decoration: underline;
  opacity: 0.9;
}

.message-text a:hover {
  opacity: 1;
}

.message-text strong {
  font-weight: 600;
}

.message-text ul,
.message-text ol {
  margin: 0.75em 0;
  padding-left: 1.5em;
}

.message-text li {
  margin: 0.4em 0;
}

.message-text code {
  background: rgba(0, 0, 0, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, monospace;
  font-size: 0.9em;
}

/* TYPING INDICATOR */
.typing-indicator {
  padding: 0;
  background: transparent !important;
  border-bottom: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-inline: 16px;
  margin-top: 16px;
}

.typing-indicator[hidden] {
  display: none !important;
}

.typing-indicator .message-group {
  width: 100%;
  max-width: var(--card-w);
  padding: 0;
  display: flex;
  align-items: flex-start;
}

.typing-indicator .message-content {
  max-width: 100%;
  padding: 0;
}

.typing-dots {
  display: flex;
  gap: 4px;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-text-muted);
  opacity: 0.6;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

/* COMPOSER */
.composer-wrapper {
  padding: 12px 0 24px;
  background: linear-gradient(180deg, transparent, var(--color-bg) 50%);
}

.composer {
  max-width: var(--card-w) !important;
  margin: 0 auto;
  padding: 0 24px;
}

.composer-inner {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  padding: 10px 12px 10px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.02),
    0 4px 12px rgba(0, 0, 0, 0.15);
  transition: border-color 0.2s;
}

.composer-inner:focus-within {
  border-color: var(--color-primary);
}

/* Görsel önizleme container - composer içinde thumbnail */
.image-preview-container {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.image-preview-container[hidden] {
  display: none !important;
}

.image-preview-wrapper {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  flex-shrink: 0;
}

.image-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: none;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s;
}

.image-remove:hover {
  background: rgba(239, 68, 68, 0.9);
}

.image-remove svg {
  width: 12px;
  height: 12px;
}

.composer-controls {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
}

.btn-upload {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-upload:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

.composer-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-size: 15px;
  line-height: 22px;
  resize: none;
  outline: none;
  max-height: 200px;
  padding: 0;
}

.composer-input::placeholder {
  color: var(--color-text-muted);
}

.composer-send {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--color-primary);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.composer-send:hover:not(:disabled) {
  background: var(--color-primary-hover);
  transform: scale(1.05);
}

.composer-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Sidebar Chat History */
.chat-history {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-item {
  position: relative;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-item:hover {
  background: var(--color-surface-hover);
}

.chat-item.active {
  background: var(--color-surface-hover);
}

.chat-item-content {
  flex: 1;
  min-width: 0;
}

.chat-item-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 4px;
}

.chat-item-date {
  font-size: 11px;
  color: var(--color-text-muted);
}

.chat-item-delete {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  border-radius: 6px;
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
  flex-shrink: 0;
}

.chat-item:hover .chat-item-delete {
  opacity: 1;
}

.chat-item-delete:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.chat-item-delete svg {
  width: 14px;
  height: 14px;
}

/* Mobile menu button */
.mobile-menu-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  border-radius: 8px;
  cursor: pointer;
  display: none;
  place-items: center;
  margin-right: 12px;
}

.mobile-menu-btn:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

/* RESPONSIVE */
@media (max-width: 768px) {
  :root {
    --bubble-max-w: 85%;
  }

  .mobile-menu-btn {
    display: grid;
  }

  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.2s;
  }

  .app-sidebar.is-open {
    transform: translateX(0);
  }

  .message-group {
    padding: 12px 16px;
  }

  .message-group--assistant .message-content {
    max-width: 100%;
  }

  .composer {
    padding: 0 16px;
  }
}

/* HATA YÖNETİMİ */
.message-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  margin-top: 8px;
  font-size: 13px;
  color: #ef4444;
}

.message-error-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.message-error-text {
  flex: 1;
}

.message-retry-btn {
  padding: 6px 12px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.message-retry-btn:hover {
  background: #dc2626;
}

.message-retry-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.message-timeout-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  margin-top: 8px;
  font-size: 13px;
  color: #f59e0b;
}

.message-sending {
  opacity: 0.6;
  position: relative;
}

.message-sending::after {
  content: '';
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--color-primary);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* MESAJ KOPYALAMA */
.message-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  opacity: 0;
  transition: opacity 0.2s;
}

.message-group:hover .message-actions {
  opacity: 1;
}

.message-action-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.2s;
}

.message-action-btn:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
  border-color: var(--color-text-muted);
}

.message-action-btn svg {
  width: 16px;
  height: 16px;
}

.message-action-btn.copied {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

/* Kullanıcı mesajları - sağda */
.message-group--user .message-actions {
  justify-content: flex-end;
}

.message-group--user .message-action-btn {
  border-color: rgba(124, 58, 237, 0.3);
}

.message-group--user .message-action-btn:hover {
  background: rgba(124, 58, 237, 0.1);
  border-color: var(--color-user-bubble);
  color: var(--color-user-bubble);
}

/* AI mesajları - solda */
.message-group--assistant .message-actions {
  justify-content: flex-start;
}
/* ===== MODEL SEÇİCİ DROPDOWN ===== */
.model-dropdown {
  position: relative;
}

.model-btn {
  height: 36px;
  border: none;
  background: transparent;
  color: var(--color-text);
  border-radius: 8px;
  padding: 0 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s;
}

.model-btn:hover {
  background: var(--color-surface-hover);
}

.model-icon {
  font-size: 18px;
}

.model-btn svg {
  transition: transform 0.2s;
}

.model-dropdown.is-open .model-btn svg {
  transform: rotate(180deg);
}

.model-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 320px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  z-index: 1000;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.model-menu[hidden] {
  display: none !important;
}

.model-dropdown.is-open .model-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.model-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
}

.model-option:hover {
  background: var(--color-surface-hover);
}

.model-option.active {
  background: var(--color-surface-hover);
}

.model-option-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: rgba(var(--color-primary-rgb, 25, 195, 125), 0.1);
  border-radius: 8px;
  flex-shrink: 0;
}

.model-option-info {
  flex: 1;
  min-width: 0;
}

.model-option-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 2px;
}

.model-option-desc {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.model-option-check {
  flex-shrink: 0;
  color: var(--color-primary);
  opacity: 0;
  transition: opacity 0.2s;
}

.model-option.active .model-option-check {
  opacity: 1;
}

/* Mobil uyumluluk */
@media (max-width: 768px) {
  .model-menu {
    min-width: 280px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
  }
  
  .model-dropdown.is-open .model-menu {
    transform: translateX(-50%) translateY(0);
  }
  
  .model-option-icon {
    width: 36px;
    height: 36px;
    font-size: 20px;
  }
}

/* Dark/Light tema değişkenleri */
:root {
  --color-primary-rgb: 25, 195, 125;
}

.theme-light {
  --color-primary-rgb: 124, 58, 237;
}

/* ===== CODE BLOCKS ===== */
.code-block-wrapper {
  margin: 1.5em 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: #1e1e1e;
}

.theme-light .code-block-wrapper {
  background: #f6f6f6;
  border-color: #e0e0e0;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #2d2d2d;
  border-bottom: 1px solid #3e3e3e;
}

.theme-light .code-block-header {
  background: #e8e8e8;
  border-bottom-color: #d0d0d0;
}

.code-lang {
  font-size: 11px;
  font-weight: 600;
  color: #858585;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.theme-light .code-lang {
  color: #666;
}

.code-copy-btn {
  padding: 4px 10px;
  background: transparent;
  border: 1px solid #4e4e4e;
  border-radius: 4px;
  color: #d4d4d4;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.code-copy-btn:hover {
  background: #3e3e3e;
  border-color: #5e5e5e;
}

.theme-light .code-copy-btn {
  border-color: #c0c0c0;
  color: #333;
}

.theme-light .code-copy-btn:hover {
  background: #ddd;
}

.code-block {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 16px;
  overflow-x: auto;
  margin: 0;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
}

.theme-light .code-block {
  background: #f6f6f6;
  color: #333;
}

.code-block code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-family: inherit;
}

.code-block::-webkit-scrollbar {
  height: 8px;
}

.code-block::-webkit-scrollbar-track {
  background: #2d2d2d;
}

.code-block::-webkit-scrollbar-thumb {
  background: #4e4e4e;
  border-radius: 4px;
}

.theme-light .code-block::-webkit-scrollbar-track {
  background: #e8e8e8;
}

.theme-light .code-block::-webkit-scrollbar-thumb {
  background: #c0c0c0;
}

/* Inline code */
.inline-code {
  background: rgba(255, 255, 255, 0.1);
  color: #f07178;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.theme-light .inline-code {
  background: rgba(0, 0, 0, 0.06);
  color: #c7254e;
  border-color: rgba(0, 0, 0, 0.1);
}

/* Mesaj metinlerinde satır aralığı kontrolü */
.message-text p {
  margin: 0.5em 0; /* 0.75em'den 0.5em'e düşür */
}

.message-text p:first-child {
  margin-top: 0;
}

.message-text p:last-child {
  margin-bottom: 0;
}

/* Liste elemanları arası boşluk */
.message-text ul,
.message-text ol {
  margin: 0.5em 0; /* 0.75em'den 0.5em'e düşür */
}

/* Başlıklar arası boşluk */
.message-text h1,
.message-text h2,
.message-text h3,
.message-text h4 {
  margin: 1em 0 0.5em; /* Üstteki boşluğu azalt */
}

.message-text h1:first-child,
.message-text h2:first-child,
.message-text h3:first-child,
.message-text h4:first-child {
  margin-top: 0;
}

/* Code block sonrası boşluk */
.code-block-wrapper {
  margin: 1em 0; /* 1.5em'den 1em'e düşür */
}

/* Sohbet item actions */
.chat-item-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.chat-item:hover .chat-item-actions {
  opacity: 1;
}

.chat-item-edit,
.chat-item-delete {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  border-radius: 6px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.chat-item-edit:hover {
  background: rgba(25, 195, 125, 0.1);
  color: var(--color-primary);
}

.chat-item-delete:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.chat-item-edit svg,
.chat-item-delete svg {
  width: 14px;
  height: 14px;
}

/* Başlık düzenleme input */
.chat-title-edit-input {
  width: 100%;
  background: var(--color-surface-hover);
  border: 1px solid var(--color-primary);
  border-radius: 4px;
  color: var(--color-text);
  font-size: 13px;
  font-weight: 500;
  padding: 4px 8px;
  outline: none;
  font-family: inherit;
}

/* ===== SETTINGS MODAL ===== */
.settings-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.settings-modal[hidden] {
  display: none !important;
}

.settings-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease-out;
}

.settings-panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  animation: slideUp 0.3s ease-out;
  z-index: 1;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border);
}

.settings-header h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: var(--color-text);
}

.settings-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  border-radius: 6px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.2s;
}

.settings-close:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

.settings-body {
  padding: 24px;
}

.settings-description {
  margin: 0 0 16px;
  color: var(--color-text-muted);
  font-size: 14px;
  line-height: 1.5;
}

.settings-textarea {
  width: 100%;
  padding: 12px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  min-height: 120px;
  transition: border-color 0.2s;
}

.settings-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

.settings-textarea::placeholder {
  color: var(--color-text-muted);
  opacity: 0.5;
}

.settings-examples {
  margin-top: 16px;
  padding: 12px;
  background: var(--color-bg);
  border-radius: 8px;
  font-size: 13px;
}

.settings-examples strong {
  display: block;
  margin-bottom: 8px;
  color: var(--color-text);
}

.settings-examples ul {
  margin: 0;
  padding-left: 20px;
  color: var(--color-text-muted);
}

.settings-examples li {
  margin: 4px 0;
}

.settings-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
}

.btn-primary,
.btn-secondary {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-surface-hover);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* Mobil */
@media (max-width: 768px) {
  .settings-panel {
    max-width: 100%;
    margin: 0;
    border-radius: 12px 12px 0 0;
    align-self: flex-end;
  }
  
  .settings-modal {
    align-items: flex-end;
    padding: 0;
  }
}