/* =============================================
   KOVAN REHBERİ - Stil Dosyası
   ============================================= */

/* ---- Değişkenler ---- */
:root {
  --amber-50:  #fffbeb;
  --amber-100: #fef3c7;
  --amber-200: #fde68a;
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --amber-700: #b45309;
  --amber-800: #92400e;
  --brown-50:  #fdf8f0;
  --brown-100: #f5e9d0;
  --white:     #ffffff;
  --gray-50:   #f9fafb;
  --gray-100:  #f3f4f6;
  --gray-200:  #e5e7eb;
  --gray-400:  #9ca3af;
  --gray-500:  #6b7280;
  --gray-700:  #374151;
  --gray-900:  #111827;
  --red-100:   #fee2e2;
  --red-600:   #dc2626;
  --green-100: #dcfce7;
  --green-700: #15803d;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow:    0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
  --radius:    12px;
  --radius-lg: 18px;
}

/* ---- Reset & Temel ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--amber-50);
  color: var(--gray-900);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

/* =============================================
   HEADER
   ============================================= */
.header {
  background: linear-gradient(135deg, var(--amber-500) 0%, var(--amber-600) 100%);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 2rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.logo-text h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
}

.logo-text p {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.85);
}

/* Limit Rozeti */
.limit-badge {
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 20px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--white);
  font-weight: 600;
  white-space: nowrap;
}

.limit-badge.warning {
  background: rgba(220, 38, 38, 0.25);
  border-color: rgba(220, 38, 38, 0.4);
}

.limit-badge.empty {
  background: rgba(220, 38, 38, 0.35);
  border-color: rgba(220, 38, 38, 0.6);
}

/* =============================================
   MAIN
   ============================================= */
.main {
  flex: 1;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  padding: 24px 16px 120px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---- Hoş Geldin Kartı ---- */
.welcome-card {
  background: linear-gradient(135deg, var(--amber-100) 0%, var(--amber-200) 100%);
  border: 1px solid var(--amber-200);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  box-shadow: var(--shadow);
}

.welcome-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.welcome-card h2 {
  font-size: 1.3rem;
  color: var(--amber-800);
  margin-bottom: 8px;
}

.welcome-card p {
  color: var(--amber-700);
  font-size: 0.9rem;
  max-width: 480px;
  margin: 0 auto;
}

/* ---- Hızlı Sorular ---- */
.quick-questions {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}

.quick-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.quick-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-btn {
  background: var(--amber-50);
  border: 1px solid var(--amber-200);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.82rem;
  color: var(--amber-700);
  cursor: pointer;
  transition: all 0.15s ease;
  font-weight: 500;
}

.quick-btn:hover {
  background: var(--amber-200);
  border-color: var(--amber-400);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.quick-btn:active { transform: translateY(0); }

/* ---- Sohbet Alanı ---- */
.chat-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Mesaj Baloncukları */
.message {
  display: flex;
  gap: 10px;
  animation: fadeIn 0.3s ease;
}

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

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

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.message.user .message-avatar {
  background: var(--amber-400);
}

.message.bot .message-avatar {
  background: linear-gradient(135deg, var(--amber-500), var(--amber-600));
}

.message-bubble {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.message.user .message-bubble {
  background: var(--amber-500);
  color: var(--white);
  border-bottom-right-radius: 4px;
}

.message.bot .message-bubble {
  background: var(--white);
  color: var(--gray-900);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}

/* Yazıyor Animasyonu */
.typing-bubble {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  border-bottom-left-radius: 4px;
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 5px;
  align-items: center;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: var(--amber-400);
  border-radius: 50%;
  animation: bounce 1.2s infinite;
}

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

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%            { transform: translateY(-8px); }
}

/* ---- Limit Uyarısı ---- */
.limit-warning {
  background: var(--red-100);
  border: 1px solid #fca5a5;
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.warning-icon { font-size: 1.5rem; }

.warning-content strong {
  display: block;
  color: var(--red-600);
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.warning-content p {
  color: #7f1d1d;
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.premium-btn {
  background: linear-gradient(135deg, var(--amber-500), var(--amber-600));
  color: var(--white);
  border: none;
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow);
}

.premium-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* ---- Premium Kart ---- */
.premium-card {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 2px solid var(--amber-400);
  border-radius: var(--radius);
  padding: 20px 24px;
}

.premium-header {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--amber-800);
  margin-bottom: 12px;
}

.premium-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.premium-features li {
  font-size: 0.88rem;
  color: var(--amber-700);
}

.premium-note {
  font-size: 0.82rem;
  color: var(--amber-600);
  font-style: italic;
}

/* ---- Input Alanı ---- */
.input-section {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 251, 235, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--amber-200);
  padding: 12px 16px 16px;
  z-index: 50;
}

.input-wrapper {
  max-width: 800px;
  margin: 0 auto;
  background: var(--white);
  border: 2px solid var(--amber-300);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: border-color 0.2s ease;
}

.input-wrapper:focus-within {
  border-color: var(--amber-500);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15), var(--shadow-md);
}

textarea {
  display: block;
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  padding: 14px 16px 8px;
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--gray-900);
  background: transparent;
  line-height: 1.5;
}

textarea::placeholder { color: var(--gray-400); }

.input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px 10px 16px;
}

.char-count {
  font-size: 0.75rem;
  color: var(--gray-400);
}

.send-btn {
  background: linear-gradient(135deg, var(--amber-500), var(--amber-600));
  color: var(--white);
  border: none;
  border-radius: 10px;
  padding: 8px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}

.send-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  background: linear-gradient(135deg, var(--amber-600), var(--amber-700));
}

.send-btn:active:not(:disabled) { transform: translateY(0); }

.send-btn:disabled {
  background: var(--gray-200);
  color: var(--gray-400);
  cursor: not-allowed;
  box-shadow: none;
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
  background: var(--amber-800);
  color: rgba(255,255,255,0.8);
  text-align: center;
  padding: 16px 20px;
  font-size: 0.8rem;
  line-height: 1.8;
}

.footer-note {
  color: rgba(255,255,255,0.5);
  font-size: 0.72rem;
}

/* =============================================
   YARDIMCI SINIFLAR
   ============================================= */
.hidden { display: none !important; }

/* =============================================
   MOBİL UYUM — Kapsamlı
   ============================================= */

/* ---- Küçük ekranlar (≤480px) ---- */
@media (max-width: 480px) {

  /* Header */
  .header-inner {
    padding: 10px 14px;
    gap: 8px;
  }
  .logo-icon { font-size: 1.5rem; }
  .logo-text h1 { font-size: 1rem; }
  .logo-text p { display: none; } /* Alt yazıyı gizle — yer kazanır */
  .limit-badge {
    font-size: 0.72rem;
    padding: 5px 9px;
    gap: 4px;
  }
  .limit-icon { display: none; }

  /* Ana içerik */
  .main {
    padding: 14px 12px 160px; /* Alt input için ekstra boşluk */
    gap: 14px;
  }

  /* Hoş geldin kartı */
  .welcome-card {
    padding: 18px 14px;
    border-radius: var(--radius);
  }
  .welcome-icon { font-size: 2rem; margin-bottom: 8px; }
  .welcome-card h2 { font-size: 1.1rem; }
  .welcome-card p { font-size: 0.82rem; }

  /* Hızlı sorular — yatay kaydırma */
  .quick-questions { padding: 12px 14px; }
  .quick-buttons {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    gap: 7px;
    /* Kaydırma çubuğunu gizle */
    scrollbar-width: none;
  }
  .quick-buttons::-webkit-scrollbar { display: none; }
  .quick-btn {
    font-size: 0.78rem;
    padding: 7px 13px;
    white-space: nowrap;
    flex-shrink: 0;
    /* Dokunma hedefi en az 44px */
    min-height: 36px;
    display: flex;
    align-items: center;
  }

  /* Mesajlar */
  .message { gap: 8px; }
  .message-avatar {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
    flex-shrink: 0;
  }
  .message-bubble {
    max-width: 84%;
    padding: 10px 13px;
    font-size: 0.875rem;
    line-height: 1.55;
  }

  /* Input alanı — sabit alt bar */
  .input-section {
    padding: 10px 12px;
    /* iPhone home bar için güvenli alan */
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }
  .input-wrapper { border-radius: 14px; }

  /* iOS'ta zoom yapmaması için 16px */
  textarea {
    font-size: 16px;
    padding: 12px 14px 6px;
    min-height: 44px;
  }

  .input-footer {
    padding: 4px 10px 8px 14px;
  }
  .char-count { font-size: 0.7rem; }

  /* Gönder butonu — büyük dokunma hedefi */
  .send-btn {
    padding: 10px 18px;
    font-size: 0.88rem;
    border-radius: 10px;
    min-height: 44px;
    min-width: 80px;
  }

  /* Footer'ı gizle — mobilde yer kaplıyor */
  .footer { display: none; }
}

/* ---- Orta ekranlar (481–768px — tablet) ---- */
@media (min-width: 481px) and (max-width: 768px) {
  .main { padding: 18px 16px 140px; }
  .message-bubble { max-width: 80%; }
  .logo-text p { font-size: 0.7rem; }
  .input-section {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
  textarea { font-size: 16px; } /* iOS zoom önleme */
  .quick-buttons {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .quick-buttons::-webkit-scrollbar { display: none; }
  .quick-btn { white-space: nowrap; flex-shrink: 0; }
}

/* ---- Yatay mod (landscape) ---- */
@media (max-width: 768px) and (orientation: landscape) {
  .welcome-card { display: none; } /* Yer kazanmak için */
  .main { padding-top: 10px; gap: 10px; }
  .header-inner { padding: 8px 14px; }
  .input-section {
    padding: 8px 12px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }
}

/* ---- iPhone X ve üstü (safe area) ---- */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .input-section {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
}
