/* Ana Stiller */
:root {
  --primary-color: #333333;
  --primary-hover: #555555;
  --secondary-color: #888888;
  --light-color: #fff;
  --dark-color: #333;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --border-radius: 4px;
  --box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --navbar-height: 56px;
  --chat-input-height: 70px;
  --message-transition: all 0.2s ease;
  --sidebar-width: 260px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--dark-color);
  background-color: #fff;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  border-radius: var(--border-radius);
  font-weight: 500;
  transition: background-color 0.2s;
}

.btn-primary:hover, .btn-primary:focus {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

.text-primary {
  color: var(--primary-color) !important;
}

/* Kartlar */
.card {
  border-radius: var(--border-radius);
  border: 1px solid #eee;
}

/* App Container */
.container-fluid {
  padding: 0;
}

/* Sidebar stilleri */
.sidebar {
  width: var(--sidebar-width);
  background: #333;
  height: 100vh;
  transition: all 0.3s ease;
  z-index: 1030;
}

.sidebar-header {
  padding: 1rem;
  color: white;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  position: sticky;
  top: 0;
  background: #333;
  z-index: 1;
}

.sidebar-header h5 {
  font-weight: 600;
  margin-bottom: 0;
}

.sidebar-header .btn {
  background-color: white;
  color: #333;
  font-weight: 500;
  border-radius: var(--border-radius);
  border: none;
  padding: 0.25rem 0.5rem;
  transition: all 0.2s;
}

.sidebar-header .btn:hover {
  background-color: #f8f8f8;
}

#chatSessions {
  overflow-y: auto;
  max-height: calc(100vh - 60px);
}

.session-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  cursor: pointer;
  transition: background-color 0.2s;
  color: rgba(255,255,255,0.8);
}

.session-item:hover {
  background-color: rgba(255,255,255,0.1);
}

.session-item.active {
  background-color: rgba(255,255,255,0.15);
  border-left: 3px solid white;
}

.session-item .text-truncate {
  max-width: 170px;
  font-weight: 500;
}

.session-item .delete-session {
  color: rgba(255,255,255,0.6);
  transition: color 0.2s;
}

.session-item .delete-session:hover {
  color: white;
}

/* Navbar stilleri */
.navbar {
  height: var(--navbar-height);
  background-color: white;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.navbar-brand {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--dark-color);
}

.navbar-toggler {
  border: none;
  padding: 0.25rem;
  border-radius: var(--border-radius);
}

.navbar-toggler:focus {
  box-shadow: none;
}

.nav-link {
  font-weight: 500;
  color: var(--dark-color);
  padding: 0.5rem 0.75rem;
}

.dropdown-menu {
  border: 1px solid #eee;
  border-radius: var(--border-radius);
  padding: 0.25rem;
}

.dropdown-item {
  border-radius: var(--border-radius);
  padding: 0.5rem 0.75rem;
  font-weight: 500;
  transition: background-color 0.2s;
}

.dropdown-item:hover {
  background-color: #f8f8f8;
}

/* Chat alanı stilleri */
.chat-container {
  height: calc(100vh - var(--navbar-height));
  display: flex;
  flex-direction: column;
  position: relative;
  background: #fff;
}

#welcomeScreen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

#welcomeScreen i {
  font-size: 3.5rem;
  color: #333;
  margin-bottom: 1.5rem;
}

#welcomeScreen h2 {
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--dark-color);
}

#welcomeScreen p {
  color: var(--secondary-color);
  max-width: 500px;
  margin-bottom: 1.5rem;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Scroll bar stilleri */
.chat-messages::-webkit-scrollbar {
  width: 6px;
}

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

.chat-messages::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.message {
  padding: 1rem;
  border-radius: 10px;
  max-width: 80%;
  word-wrap: break-word;
  animation: fadeIn 0.3s ease-in-out;
  line-height: 1.5;
}

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

.message-user {
  background-color: var(--primary-color);
  color: white;
  border-radius: 10px;
  align-self: flex-end;
  margin-bottom: 1rem;
  max-width: 80%;
  padding: 0.75rem 1rem;
  animation: fadeIn 0.3s ease-in-out;
}

.message-bot {
  background-color: #f8f9fa;
  border-radius: 10px;
  align-self: flex-start;
  margin-bottom: 1rem;
  max-width: 85%;
  padding: 0.75rem 1rem;
  animation: fadeIn 0.3s ease-in-out;
}

/* Bot mesajlarında kod bloğu stilleri */
.message-bot pre {
  background-color: #f8f9fa;
  border-radius: 6px;
  overflow-x: auto;
  margin: 0.75rem 0;
  position: relative;
  border: 1px solid rgba(0,0,0,0.1);
}

.message-bot code {
  font-family: 'Fira Code', Monaco, Consolas, 'Courier New', monospace;
  font-size: 0.9rem;
  padding: 0;
}

/* Kod bloğu container ve başlık */
.code-wrapper {
  position: relative;
  margin: 1rem 0;
  border-radius: 6px;
  overflow: hidden;
}

.code-block {
  margin: 0 !important;
  padding: 0.75rem !important;
  border-radius: 0 !important;
  border: none !important;
  background-color: #f8f9fa !important;
}

.code-language {
  position: absolute;
  top: 0;
  right: 0;
  background: #e9ecef;
  color: #495057;
  font-size: 0.75rem;
  padding: 0.1rem 0.5rem;
  border-bottom-left-radius: 4px;
  font-family: sans-serif;
  z-index: 1;
}

/* Kopyalama butonu */
.copy-code-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(255,255,255,0.7);
  border: none;
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
  z-index: 2;
}

.copy-code-btn:hover {
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Tablo stilleri */
.message-bot table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.message-bot .table-responsive {
  overflow-x: auto;
  border-radius: 6px;
  border: 1px solid #e9ecef;
}

/* Liste stilleri */
.message-bot ul, .message-bot ol {
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
}

.message-bot li {
  margin-bottom: 0.25rem;
}

/* Vurgu ve blok alıntı */
.message-bot blockquote {
  border-left: 4px solid #e9ecef;
  padding-left: 1rem;
  margin-left: 0;
  margin-right: 0;
  color: #6c757d;
}

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

.message-bot em {
  font-style: italic;
}

/* Başlık stilleri */
.message-bot h1, .message-bot h2, .message-bot h3, 
.message-bot h4, .message-bot h5, .message-bot h6 {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  line-height: 1.3;
}

.message-bot h1 { font-size: 1.8rem; }
.message-bot h2 { font-size: 1.5rem; }
.message-bot h3 { font-size: 1.3rem; }
.message-bot h4 { font-size: 1.2rem; }
.message-bot h5 { font-size: 1.1rem; }
.message-bot h6 { font-size: 1rem; }

/* Mesaj içindeki görseller için özel stil */
.message-bot img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 0.5rem 0;
  cursor: pointer;
  display: block;
  border: 1px solid #eee;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: transform 0.2s ease;
}

.message-bot img:hover {
  transform: scale(1.02);
}

.message-error {
  background-color: #f8d7da;
  border-radius: 10px;
  color: #842029;
  align-self: flex-start;
  margin-bottom: 1rem;
  max-width: 85%;
  padding: 0.75rem 1rem;
  animation: fadeIn 0.3s ease-in-out;
}

.chat-input {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: white;
  border-top: 1px solid #eee;
  padding: 0.75rem 1rem;
  z-index: 10;
  height: var(--chat-input-height);
}

.chat-input form {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  height: 100%;
}

.chat-input input {
  border-radius: var(--border-radius);
  padding: 0.75rem 1rem;
  border: 1px solid #ddd;
  transition: border-color 0.2s;
}

.chat-input input:focus {
  box-shadow: none;
  border-color: #aaa;
}

.chat-input button {
  border-radius: var(--border-radius);
  padding: 0.75rem;
  height: 40px;
  width: 40px;
}

/* Dosya yükleme butonu */
.chat-input label[for="chatFileInput"] {
  cursor: pointer;
  color: #666;
  transition: color 0.2s;
}

.chat-input label[for="chatFileInput"]:hover {
  color: #333;
}

/* Hata mesajları için stil */
.alert {
  border-radius: var(--border-radius);
  padding: 0.75rem 1rem;
  margin: 1rem;
  border: 1px solid transparent;
}

.alert-warning {
  background-color: #fff8e1;
  border-color: #ffe57f;
  color: #856404;
}

/* Yükleme animasyonu */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-radius: 50%;
  border-top-color: #333;
  animation: spin 0.8s linear infinite;
}

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

/* Modal stilleri */
.modal-content {
  border: none;
  border-radius: var(--border-radius);
}

.modal-header {
  border-bottom: 1px solid #eee;
  padding: 1rem;
}

.modal-header .modal-title {
  font-weight: 600;
}

.modal-body {
  padding: 1rem;
}

.modal-footer {
  border-top: 1px solid #eee;
  padding: 1rem;
}

/* Oluşturulan görseller için stiller */
.generated-image {
  max-width: 100%;
  max-height: 300px;
  margin: 0.5rem 0;
  cursor: pointer;
  border: 1px solid #eee;
}

#modalImage {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
}

/* Modal düzenlemeleri */
.modal-dialog {
  max-width: 90%;
  margin: 1rem auto;
}

/* Responsive düzenlemeler */
@media (max-width: 1200px) {
  .message {
    max-width: 85%;
  }
  
  .message-bot h1 { font-size: 1.7rem; }
  .message-bot h2 { font-size: 1.4rem; }
  .message-bot h3 { font-size: 1.25rem; }
}

@media (max-width: 992px) {
  :root {
    --navbar-height: 56px;
    --chat-input-height: 65px;
  }
  
  .message {
    max-width: 90%;
  }
  
  .chat-input {
    padding: 0.5rem 0.75rem;
  }
  
  .sidebar {
    position: fixed;
    top: 0;
    left: -270px;
    height: 100vh;
    z-index: 1030;
    transition: left 0.3s ease;
    width: var(--sidebar-width);
    overflow-y: auto;
  }
  
  .sidebar.show {
    left: 0;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  }
  
  .session-item .text-truncate {
    max-width: 150px;
  }
  
  .navbar-toggler {
    display: inline-block;
  }
}

@media (max-width: 768px) {
  .message {
    max-width: 92%;
  }
  
  .message-bot img {
    max-height: 220px;
  }
  
  .modal-dialog {
    max-width: 95%;
  }
  
  .message-bot pre {
    font-size: 0.85rem;
  }
  
  .message-bot h1 { font-size: 1.5rem; }
  .message-bot h2 { font-size: 1.3rem; }
  .message-bot h3 { font-size: 1.15rem; }
  .message-bot h4, .message-bot h5, .message-bot h6 { font-size: 1rem; }
  
  .code-language {
    font-size: 0.7rem;
  }
}

@media (max-width: 576px) {
  .chat-messages {
    padding: 0.75rem;
  }
  
  .message {
    max-width: 95%;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
  }
  
  .message-bot pre code {
    font-size: 0.8rem;
  }
  
  .message-bot img {
    max-height: 180px;
  }
  
  .chat-input input {
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
  }
  
  .modal-dialog {
    max-width: 95%;
    margin: 0.5rem auto;
  }
  
  .modal-title {
    font-size: 1.1rem;
  }
  
  .btn {
    font-size: 0.9rem;
    padding: 0.375rem 0.5rem;
  }
  
  .message-bot table {
    font-size: 0.8rem;
  }
  
  .message-bot blockquote {
    font-size: 0.9rem;
    padding-left: 0.75rem;
  }
  
  .message-bot ul, .message-bot ol {
    padding-left: 1.2rem;
  }
  
  .message-bot h1 { font-size: 1.4rem; }
  .message-bot h2 { font-size: 1.25rem; }
  .message-bot h3 { font-size: 1.1rem; }
  .message-bot h4, .message-bot h5, .message-bot h6 { font-size: 1rem; }
  
  .session-item .text-truncate {
    max-width: 120px;
  }
  
  .user-info {
    padding: 12px;
  }
  
  .user-info .btn-logout {
    font-size: 0.9rem;
    padding: 6px 10px;
  }
}

/* Küçük mobil cihazlar (iPhone SE vb) */
@media (max-width: 375px) {
  .message {
    max-width: 98%;
    padding: 0.6rem;
    font-size: 0.9rem;
  }
  
  .chat-messages {
    padding: 0.5rem;
  }
  
  .message-bot img {
    max-height: 150px;
  }
  
  .message-bot pre code {
    font-size: 0.75rem;
  }
  
  .code-wrapper {
    margin: 0.5rem 0;
  }
  
  .copy-code-btn {
    top: 0.3rem;
    right: 0.3rem;
    padding: 0.15rem 0.35rem;
    font-size: 0.75rem;
  }
  
  .code-language {
    font-size: 0.65rem;
    padding: 0.05rem 0.4rem;
  }
  
  .message-bot h1 { font-size: 1.3rem; }
  .message-bot h2 { font-size: 1.2rem; }
  .message-bot h3, .message-bot h4, .message-bot h5, .message-bot h6 { font-size: 1rem; }
} 