/* AI Tercih Asistanı - Gelişmiş Neo-Brutalist Stil Dosyası (ai-style.css) */

/* Kapsayıcı Düzen */
#screen-ai {
  font-family: 'Nunito', sans-serif;
  color: var(--text-color);
  background-color: var(--bg-screen);
}

/* SIDEBAR (SOL PANEL) */
.ai-sidebar {
  width: 280px;
  height: 100%;
  border-right: var(--neo-border-thin);
  background: var(--bg-card-ui);
  display: flex;
  flex-direction: column;
  z-index: 50;
  box-sizing: border-box;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s, border 0.3s;
  flex-shrink: 0;
  overflow: hidden;
}

.ai-sidebar > * {
  min-width: 280px;
  box-sizing: border-box;
}

#screen-ai.sidebar-collapsed .ai-sidebar {
  width: 0;
  border-right: none;
  pointer-events: none;
}

/* Yeni Sohbet Butonu */
.ai-new-chat-btn {
  background: var(--color-lime) !important;
  color: #000 !important;
  border: var(--neo-border-thin);
  box-shadow: 2px 2px 0px #000;
  border-radius: 12px;
  padding: 12px;
  margin: 16px;
  font-family: inherit;
  font-weight: 900;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.1s, box-shadow 0.1s;
}

.ai-new-chat-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px #000;
}

.ai-new-chat-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0px #000;
}

/* Arama Kutusu */
.ai-search-container {
  padding: 0 16px 16px 16px;
  border-bottom: 1px dashed var(--border-color);
}

.ai-search-container input {
  width: 100%;
  padding: 10px 12px;
  border: var(--neo-border-thin);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--bg-screen);
  color: var(--text-color);
  box-sizing: border-box;
}

/* Sabitlenen Sohbetler Başlığı */
.ai-sidebar-group-title {
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 16px 6px 16px;
  margin: 0;
  display: none; /* Boşken gizlenecek */
}

/* Sohbet Kartı Listesi */
.ai-chats-list-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
}

.ai-chat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: var(--neo-border-thin);
  border-radius: 10px;
  background: var(--bg-card-ui);
  cursor: pointer;
  position: relative;
  transition: transform 0.1s, box-shadow 0.1s;
}

.ai-chat-item:hover {
  transform: translate(-1px, -1px);
  box-shadow: 2px 2px 0px #000;
}

.ai-chat-item.active {
  background: var(--bg-screen);
  border-color: var(--color-blue);
  box-shadow: 2px 2px 0px #000;
}

.ai-chat-item-icon {
  font-size: 1.1rem;
}

.ai-chat-item-details {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.ai-chat-item-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-chat-item-date {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 700;
  margin-top: 2px;
}

/* Sohbet Kartı Seçenek Menüsü Butonu */
.ai-chat-item-actions {
  display: none;
}

.ai-chat-item:hover .ai-chat-item-actions {
  display: block;
}

.ai-chat-item-menu {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px;
}

.ai-chat-item-menu:hover {
  color: var(--text-color);
}

/* Sidebar Footer */
.ai-sidebar-footer {
  padding: 12px 16px;
  border-top: var(--neo-border-thin);
  display: flex;
  gap: 8px;
  background: var(--bg-card-ui);
}

.ai-footer-btn {
  flex: 1;
  padding: 8px;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 900;
  border: var(--neo-border-thin);
  box-shadow: 1.5px 1.5px 0px #000;
  border-radius: 8px;
  background: var(--bg-screen);
  color: var(--text-color);
  cursor: pointer;
  text-align: center;
}

.ai-footer-btn:hover {
  transform: translate(-0.5px, -0.5px);
  box-shadow: 2px 2px 0px #000;
}

/* MAIN CHAT CONTAINER (ANA SOHBET ALANI) */
.ai-main-container {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Chat Header */
.ai-chat-header {
  padding: 14px 20px;
  border-bottom: var(--neo-border-thin);
  background: var(--bg-card-ui);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10;
}

/* Hamburger Menü / Sidebar Toggle Butonu */
#ai-sidebar-toggle {
  display: flex;
  background: var(--bg-card-ui);
  border: var(--neo-border-thin);
  box-shadow: 1.5px 1.5px 0px #000;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: transform 0.1s;
}

#ai-sidebar-toggle:hover {
  transform: translate(-0.5px, -0.5px);
  box-shadow: 2px 2px 0px #000;
}

/* Karşılama Ekranı */
.ai-welcome-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  margin: auto;
  max-width: 500px;
}

.ai-avatar-large {
  width: 64px;
  height: 64px;
  border: var(--neo-border-thin);
  box-shadow: 3px 3px 0px #000;
  border-radius: 50%;
  background: var(--color-lime);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
}

.ai-quick-prompts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
  width: 100%;
}

.ai-quick-card {
  background: var(--bg-card-ui);
  border: var(--neo-border-thin);
  box-shadow: 2px 2px 0px #000;
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 800;
  transition: transform 0.1s, box-shadow 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-quick-card:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px #000;
}

/* MESAJ BALONU VE AVATAR GRUBU */
.ai-message-wrapper {
  display: flex;
  gap: 14px;
  padding: 12px 20px;
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.ai-message-wrapper.user-wrapper {
  flex-direction: row-reverse;
}

.ai-chat-avatar {
  width: 36px;
  height: 36px;
  border: var(--neo-border-thin);
  box-shadow: 1.5px 1.5px 0px #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.ai-chat-avatar.user-avatar {
  background: var(--color-blue);
}

.ai-chat-avatar.ai-avatar {
  background: var(--color-lime);
}

/* Mesaj Hover Menüsü */
.ai-message-action-menu {
  position: absolute;
  bottom: -10px;
  display: none;
  background: var(--bg-card-ui);
  border: var(--neo-border-thin);
  box-shadow: 1.5px 1.5px 0px #000;
  border-radius: 8px;
  padding: 3px;
  gap: 4px;
  z-index: 10;
}

.ai-message-wrapper.user-wrapper .ai-message-action-menu {
  left: 20px;
}

.ai-message-wrapper.ai-wrapper .ai-message-action-menu {
  right: 20px;
}

.ai-message-wrapper:hover .ai-message-action-menu {
  display: flex;
}

.ai-msg-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  font-size: 0.72rem;
  border-radius: 4px;
}

.ai-msg-action-btn:hover {
  background: var(--bg-screen);
}

/* Düzenleme Textarea'sı */
.ai-edit-textarea {
  outline: none;
  font-family: inherit;
  resize: vertical;
}

/* FLOATING MENÜ POPUP (Sağ Tık / Seçenekler için) */
.ai-chat-item-menu-popup {
  position: absolute;
  background: var(--bg-card-ui);
  border: var(--neo-border-thin);
  box-shadow: 2px 2px 0px #000;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  padding: 4px;
  z-index: 1000;
}

.ai-chat-item-menu-popup button {
  background: none;
  border: none;
  text-align: left;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  color: var(--text-color);
  border-radius: 6px;
}

.ai-chat-item-menu-popup button:hover {
  background: var(--bg-screen);
}

/* ÖZEL MODAL ONAY EKRANI (Confirm) */
.ai-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.ai-modal-box {
  background: var(--bg-card-ui);
  border: var(--neo-border-thin);
  box-shadow: 4px 4px 0px #000;
  border-radius: 14px;
  padding: 20px;
  max-width: 360px;
  width: 90%;
  box-sizing: border-box;
}

.ai-modal-btn {
  padding: 8px 16px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 900;
  border: var(--neo-border-thin);
  box-shadow: 2px 2px 0px #000;
  border-radius: 8px;
  cursor: pointer;
}

.ai-modal-btn.confirm {
  background: var(--color-pink);
  color: #000;
}

.ai-modal-btn.cancel {
  background: var(--bg-screen);
  color: var(--text-color);
}

/* Durdur (Stop) butonu stil ve animasyonları */
#ai-stop-btn {
  background: var(--color-pink) !important;
  border: var(--neo-border-thin);
  box-shadow: 2px 2px 0px #000;
  border-radius: 12px;
  width: 44px;
  height: 44px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Karakter Sayacı */
#ai-char-counter {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-muted);
  position: absolute;
  right: 80px;
  bottom: 8px;
}

/* RESPONSIVE DÜZENLEMELER (MOBİL UYUMLULUK) */
#screen-ai.mobile-view {
  position: relative;
}

#screen-ai.mobile-view .ai-sidebar {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  z-index: 100;
  width: 280px !important;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#screen-ai.mobile-view:not(.sidebar-collapsed) .ai-sidebar {
  transform: translateX(0);
}

#screen-ai.mobile-view.sidebar-collapsed .ai-sidebar {
  width: 280px !important;
  transform: translateX(-100%);
}

#screen-ai.mobile-view .ai-quick-prompts-grid {
  grid-template-columns: 1fr;
}

@media (max-width: 768px) {
  #screen-ai {
    position: relative;
  }
  
  .ai-sidebar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    z-index: 100;
    width: 280px !important;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  #screen-ai:not(.sidebar-collapsed) .ai-sidebar {
    transform: translateX(0);
  }
  
  #screen-ai.sidebar-collapsed .ai-sidebar {
    width: 280px !important;
    transform: translateX(-100%);
  }
  
  .ai-quick-prompts-grid {
    grid-template-columns: 1fr;
  }
}
