/* CSS Variables */
:root {
  --background-color: #f0f4f8;
  --chat-container-bg: #ffffff;
  --header-bg: #6246ea;
  --header-color: #ffffff;
  --user-message-bg: #6246ea;
  --user-message-color: #ffffff;
  --bot-message-bg: #f7f6fe;
  --bot-message-color: #2d3748;
  --input-bg: #ffffff;
  --input-border: #cbd5e0;
  --input-focus-border: #6246ea;
  --send-button-bg: #6246ea;
  --send-button-hover: #5438d5;
  --follow-up-button-bg: var(--user-message-bg);
  --follow-up-button-color: var(--user-message-color);
  --follow-up-button-hover: #5438d5;
  --link-color: #6246ea;
  --code-bg: #edf2f7;

  /* Avatar boyutları */
  --bot-avatar-size: 36px;
  --user-avatar-size: 36px;
  --header-avatar-size: 36px;
  --button-icon-size: 24px;
}

/* ---------- KÖK BOYUT ---------- */
html{font-size:16px;}
@media(max-width:575.98px){html{font-size:15px;}}
@media(max-width:400px){html{font-size:14px;}}

/* Basic Layout */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--background-color);
  margin: 0;
  padding: 0;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

@media (max-width:575.98px){
  body{
    display:block;     /* ortalama iptal */
    height:auto;       /* tarayıcı adres çubuğu yüksekliğiyle çakışma yok */
  }
}

.chat-container {
  background-color: var(--chat-container-bg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Header ayarları */
.header {
  background-color: var(--header-bg);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-title-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-header-avatar {
  width: var(--header-avatar-size);
  height: var(--header-avatar-size);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

h1 {
  color: var(--header-color);
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

#chat-window {
  flex-grow: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  display: flex;
  flex-direction: column;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

#chat-window::-webkit-scrollbar {
  display: none;
}

/* ---------- MESAJ BALONU ---------- */
.message{
  max-width:80%;
  padding:10px 14px;
  border-radius:18px;
  word-wrap:break-word;
  line-height:1.4;
}
@media(max-width:575.98px){
  .message{max-width:90%;padding:8px 12px;}
}

.user {
  background-color: var(--user-message-bg);
  color: var(--user-message-color);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.bot {
  background-color: var(--bot-message-bg);
  color: var(--bot-message-color);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  position: relative; /* For copy button positioning */
}

.message.bot p {
  margin: 0;
  padding: 0;
}

.message.bot p+p {
  margin-top: 10px;
}

.message.bot h1, .message.bot h2, .message.bot h3, .message.bot h4, .message.bot h5, .message.bot h6 {
  margin-top: 10px;
  margin-bottom: 5px;
}

.message.bot ul, .message.bot ol {
  margin-left: 20px;
  margin-bottom: 10px;
  padding-left: 0;
}

.message.bot pre {
  background-color: var(--code-bg);
  padding: 10px;
  border-radius: 4px;
  overflow-x: auto;
  margin: 10px 0;
}

.message.bot code {
  background-color: var(--code-bg);
  padding: 2px 4px;
  border-radius: 4px;
}

.message.bot a {
  color: var(--link-color);
  text-decoration: none;
}

.message.bot a:hover {
  text-decoration: underline;
}

/* ---------- STARTER & FOLLOW‑UP ---------- */
.starter-prompts,
.follow-up-prompts{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.starter-prompts .prompt-button,
.follow-up-prompts button{
  font-size:clamp(0.75rem, 1vw + 0.5rem, 0.9rem);
  padding:6px 12px;
}

.follow-up-prompts button {
  background-color: var(--follow-up-button-bg);
  color: var(--follow-up-button-color);
  border: none;
  border-radius: 16px;
  border-bottom-right-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.1s;
}

.follow-up-prompts button:hover {
  background-color: var(--follow-up-button-hover);
  transform: translateY(-1px);
}

/* ---------- INPUT ALANI ---------- */
.input-area {
  position: relative;
  padding: 15px;
  background: white;
  border-top: 1px solid #e9ecef;
}

.input-container{
  padding:6px 8px;
  gap:8px;
  display: flex;
  align-items: center;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  min-height: 44px;
}
#user-input{
  font-size:1rem;
  min-height:24px;
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px;
  outline: none;
  resize: none;
  max-height: 200px;
  line-height: 24px;
  font-family: inherit;
  overflow-y: hidden;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  align-self: center;
}
@media(max-width:575.98px){
  .input-container{padding:4px 6px;}
  #user-input{font-size:0.95rem;}
}

.upload-button, #send-button, .delete-attachment {
  background-color: var(--send-button-bg);
  color: white;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s, transform 0.1s;
  padding: 0;
  flex-shrink: 0;
}

.upload-button:hover, #send-button:hover, .delete-attachment:hover {
  background-color: var(--send-button-hover);
  transform: scale(1.05);
}

/* Loading Spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Thinking Animation */
.thinking {
  display: inline-block;
  text-align: center;
  margin: 0 auto;
}

.thinking .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--bot-message-color);
  margin: 0 2px;
  opacity: 0.6;
  animation: thinking 1.4s infinite ease-in-out both;
}

.thinking .dot:nth-child(2) {
  animation-delay: 0.2s;
}

.thinking .dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes thinking {
  0%, 80%, 100% { 
    transform: scale(0.6);
  } 
  40% { 
    transform: scale(1.0);
  }
}

/* ---------- KÜÇÜK DOKUNUŞLAR ---------- */
.generated-image{
  max-width:100%;
  border-radius:8px;
}

.attached-file {
  display: flex;
  align-items: center;
  background-color: #f0f0f0;
  border-radius: 8px;
  margin-bottom: 10px;
  position: relative;
}

.attached-file .file-info {
  display: flex;
  align-items: center;
  flex: 1;
}

.image-thumbnail {
  max-width: 50px;
  max-height: 50px;
  object-fit: cover;
}

.remove-attachment {
  background-color: rgba(255, 0, 0, 0.8);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: absolute;
  top: -8px;
  right: -8px;
  opacity: 0;
  transition: opacity 0.2s;
}

.attached-file:hover .remove-attachment {
  opacity: 1;
}

.remove-attachment:hover {
  background-color: rgba(255, 0, 0, 1);
}

.image-preview .file-info {
  width: 100%;
}

.message-attachment + .message-text {
  margin-top: 10px;
}

.message.user .message-attachment {
  margin-bottom: 8px;
}

.message.user .message-attachment:not(.image-preview) {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 8px 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: white;
}

.message.user .message-attachment.image-preview {
  overflow: hidden;
  border-radius: 8px;
}

.attached-file.image-preview {
  padding: 0;
  overflow: hidden;
}

.image-thumbnail {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  margin-right: 10px;
  object-fit: cover;
}

.message-attachment.image-preview {
  display: flex;
  justify-content: center;
  position: relative;
}

.message-attachment.image-preview img {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}

.message-attachment svg,
.message-attachment img {
  flex-shrink: 0;
  margin-right: 8px;
}

.file-info span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.9rem;
}

.reset-button {
  background: none;
  border: none;
  color: white;
  opacity: 0.8;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
}

.reset-button:hover {
  opacity: 1;
  text-decoration: underline;
}

.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

.upload-button {
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0;
  width: 38px;
  height: 38px;
  transition: opacity 0.3s;
}

.upload-button.visible {
  opacity: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.drop-zone {
  position: relative;
}

.drop-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(98, 70, 234, 0.1);
  border: 3px dashed var(--header-bg);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.drop-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.drop-overlay::before {
  content: 'Dosyanızı buraya bırakın';
  color: var(--header-bg);
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
  animation: pulse 1.5s infinite;
}

.drop-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.copy-button {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.1);
  border: none;
  border-radius: 4px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s;
  outline: none;
  overflow: hidden;
}

.message.bot {
  padding-right: 45px;
}

.message.bot:hover .copy-button {
  opacity: 1;
}

.copy-button:hover {
  background: rgba(0, 0, 0, 0.2);
}

.copy-button:active {
  animation: copyPress 0.2s ease forwards;
}

.copy-button.copied {
  background: #4CAF50;
}

@keyframes copyPress {
  0% { transform: scale(1); }
  50% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

.copy-button svg {
  fill: currentColor;
}

.copy-button .copied-text {
  position: absolute;
  font-size: 10px;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.2s;
}

.copy-button.copied .copied-text {
  opacity: 1;
  transform: translateY(0);
}

.generated-image-container {
  margin-top: 10px;
  margin-bottom: 10px;
}

.generated-image {
  max-width: 100%;
  border-radius: 8px;
}

.header-buttons {
  display: flex;
  gap: 10px;
}

.header-button {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.header-button:hover {
  opacity: 1;
}

#send-button {
  position: relative;
}

.input-container.multiline {
  align-items: flex-start;
}


