:root {
  --limit-dark: #1f1f1f;
  --limit-cyan: #00adef;
  --limit-cyan-light: #e0f7fa;

  --bg-color: #f0f2f5;
  --chat-bg: #efeae2;
  --user-msg-bg: var(--limit-cyan-light);
  --bot-msg-bg: #ffffff;
  --text-color: #111b21;
  --header-bg: var(--limit-dark);
  --accent-color: var(--limit-cyan);
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  background-color: #d1d7db;
  margin: 0;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.app-container {
  width: 100%;
  height: 100%;
  background-color: #9ec0d5e0;
  background-image: url("bg.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-blend-mode: overlay;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  /* Mobilde viewport height'ı doğru hesapla */
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height - mobil için */
}

@media (min-width: 768px) {
  .app-container {
    width: 400px;
    height: 90vh;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    border-radius: 0;
  }
}

.header {
  background-color: var(--header-bg);
  color: white;
  padding: 10px 15px;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  z-index: 10;
  flex-shrink: 0;
  border-bottom: 3px solid var(--accent-color);
}

.bot-avatar {
  width: 40px;
  height: 40px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  color: var(--accent-color);
  font-size: 20px;
}

.header-info h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.header-info span {
  font-size: 12px;
  opacity: 0.8;
}

.brand-limit {
  color: #fff;
}

.brand-ai {
  color: var(--accent-color);
}

.chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
  /* Mobilde scroll sorununu çöz */
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

.message {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14.2px;
  line-height: 1.4;
  position: relative;
  box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
  word-wrap: break-word;
}

.message.bot {
  align-self: flex-start;
  background-color: var(--bot-msg-bg);
  border-top-left-radius: 0;
}

.message.user {
  align-self: flex-end;
  background-color: var(--user-msg-bg);
  border-top-right-radius: 0;
  color: #111;
}

.message-time {
  font-size: 10px;
  color: #667781;
  text-align: right;
  margin-top: 4px;
  margin-bottom: -2px;
}

.input-area {
  background-color: #f0f2f5;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  border-top: 1px solid #ddd;
}

.input-box {
  flex: 1;
  background: white;
  border: 1px solid #ddd;
  padding: 12px 15px;
  border-radius: 25px;
  font-size: 15px;
  outline: none;
  transition: border 0.3s;
}

.input-box:focus {
  border-color: var(--accent-color);
}

.send-btn {
  background: var(--accent-color);
  color: white;
  border: none;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: 0.2s;
  box-shadow: 0 2px 5px rgba(0, 173, 239, 0.4);
}

.send-btn:active {
  transform: scale(0.95);
}

.dot {
  height: 7px;
  width: 7px;
  background-color: var(--accent-color);
  border-radius: 50%;
  display: inline-block;
  animation: bounce 1.3s linear infinite;
  margin-right: 2px;
}

.dot:nth-child(2) {
  animation-delay: -1.1s;
}

.dot:nth-child(3) {
  animation-delay: -0.9s;
  margin-right: 0;
}

@keyframes bounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
  }

  30% {
    transform: translateY(-4px);
  }
}

/* Ürün Listesi Stili */
.product-list {
  margin: 5px 0 0 0;
  padding-left: 0;
  list-style: none;
}

.product-list li {
  background: #f5f6f6;
  margin-bottom: 6px;
  padding: 10px 12px;
  border-radius: 4px;
  border-left: 4px solid var(--accent-color);
  font-size: 13.5px;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
}

.product-list li:hover {
  background-color: var(--limit-cyan-light);
  transform: translateX(3px);
}

.product-list li:active {
  transform: scale(0.98);
}

/* YATAY SAYFALAMA BUTONLARI */
.pagination-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid #eee;
}

.page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  background-color: #263238;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.2);
}

.page-btn:hover:not(.active) {
  background-color: #37474f;
}

.page-btn.active {
  background-color: var(--accent-color);
  cursor: default;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chat-area::-webkit-scrollbar {
  width: 6px;
}

.chat-area::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

/* YÜKLEME ANİMASYONU */
.typing-indicator {
  display: none;
  background: #263238;
  color: #fff;
  padding: 12px 20px;
  border-radius: 25px;
  border-top-left-radius: 0;
  font-size: 13px;
  font-weight: 500;
  align-self: flex-start;
  margin: 10px 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 5;
  animation: fadeInSlide 0.3s ease-out forwards;
}

@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.typing-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.loading-spinner {
  font-size: 16px;
  animation: spin 1s infinite linear;
  color: var(--accent-color);
}

.send-btn.loading {
  background-color: #ccc;
  cursor: not-allowed;
  transform: none;
}

.send-btn.loading i {
  animation: spin 0.8s infinite linear;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* SEPET SİSTEMİ STİLLERİ */

/* Header Sepet İkonu */
.cart-icon-wrapper {
  position: relative;
  cursor: pointer;
  margin-left: auto;
  padding: 8px;
  color: white;
  transition: transform 0.2s;
}

.cart-icon-wrapper:active {
  transform: scale(0.9);
}

.cart-icon-wrapper i {
  font-size: 22px;
  color: var(--limit-cyan);
}

.cart-badge {
  position: absolute;
  top: 0;
  right: 0;
  background-color: #ff3b30;
  color: white;
  font-size: 10px;
  font-weight: bold;
  height: 16px;
  min-width: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 1px solid #fff;
  transform: scale(0);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cart-badge.show {
  transform: scale(1);
}

/* Sepet Paneli (Slide-in Drawer) */
.cart-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  backdrop-filter: blur(2px);
}

.cart-overlay.active {
  opacity: 1;
  visibility: visible;
}

.cart-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 85%;
  max-width: 320px;
  height: 100%;
  background: #fff;
  z-index: 100;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
}

.cart-panel.active {
  transform: translateX(0);
}

.cart-header {
  background: var(--header-bg);
  color: white;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid var(--accent-color);
}

.cart-header h3 {
  margin: 0;
  font-size: 16px;
}

.close-cart-btn {
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
}

.empty-cart-msg {
  text-align: center;
  color: #999;
  margin-top: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* Sepet Öğesi Kartı */
.cart-item {
  background: #f8f9fa;
  border: 1px solid #eee;
  border-left: 4px solid var(--accent-color);
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 4px;
  position: relative;
  animation: slideInRight 0.3s ease;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.cart-item-image {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #ddd;
  background-color: #fff;
  flex-shrink: 0;
}

.cart-item-content {
  flex: 1;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.cart-item-title {
  font-size: 13px;
  font-weight: bold;
  color: #333;
  margin-bottom: 4px;
  padding-right: 20px;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  line-height: 1.3;
}

.cart-item-meta {
  font-size: 11px;
  color: #666;
  display: flex;
  justify-content: space-between;
}

.cart-item-price {
  color: var(--accent-color);
  font-weight: bold;
}

.remove-item-btn {
  position: absolute;
  top: 10px;
  right: 5px;
  background: none;
  border: none;
  color: #ff3b30;
  cursor: pointer;
  font-size: 14px;
  padding: 5px;
}

/* Alt Toplam Alanı */
.cart-footer {
  padding: 15px;
  background: #f8f9fa;
  border-top: 1px solid #ddd;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
  margin-bottom: 10px;
  font-size: 15px;
}

.checkout-btn {
  width: 100%;
  background: var(--limit-dark);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s;
}

.checkout-btn:hover {
  background: #333;
}

/* ADET (QUANTITY) BUTONLARI */
.cart-item-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.qty-wrapper {
  display: flex;
  align-items: center;
  background-color: #e9ecef;
  border-radius: 6px;
  padding: 2px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  background-color: #fff;
  border: 1px solid #ced4da;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: bold;
  color: #495057;
  font-size: 14px;
  transition: all 0.2s;
  user-select: none;
}

.qty-btn:active {
  background-color: #dee2e6;
  transform: scale(0.95);
}

.qty-val {
  width: 30px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #212529;
}

/* SES VE MİKROFON İKONLARI */
.mic-btn {
  background: #e9ecef;
  color: #54656f;
  border: none;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: 0.2s;
  margin-right: 5px;
}

.mic-btn:hover {
  background: #d1d7db;
}

.mic-btn.recording {
  background-color: #ff3b30;
  color: white;
  animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(255, 59, 48, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(255, 59, 48, 0);
  }
}

.speak-btn {
  background: none;
  border: none;
  color: #8da2ad;
  cursor: pointer;
  font-size: 14px;
  margin-left: 8px;
  padding: 0;
  transition: color 0.2s;
  float: right;
  margin-top: 2px;
}

.speak-btn:hover {
  color: var(--accent-color);
}

.speak-btn.playing {
  color: #ff3b30;
  animation: pulse 1s infinite;
}

/* 3 Nokta Yanıp Sönme Efekti */
.typing-cursor {
  display: inline-block;
  font-weight: bold;
  color: var(--accent-color);
  letter-spacing: 2px;
  animation: blink 1s infinite;
}

@keyframes blink {
  0% {
    opacity: 0.2;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.2;
  }
}

/* OTO SES (AUTO SPEAK) TOGGLE STİLİ */
.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 15px;
}

.auto-speak-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 8px;
  border-radius: 20px;
  transition: background 0.3s;
}

.auto-speak-wrapper:hover {
  background: rgba(255, 255, 255, 0.2);
}

.auto-speak-label {
  font-size: 11px;
  color: #fff;
  font-weight: 600;
  opacity: 0.8;
}

.toggle-switch {
  width: 30px;
  height: 16px;
  background-color: #555;
  border-radius: 15px;
  position: relative;
  transition: background-color 0.3s;
}

.toggle-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.3s;
}

.auto-speak-wrapper.active .toggle-switch {
  background-color: var(--limit-cyan);
}

.auto-speak-wrapper.active .toggle-switch::after {
  transform: translateX(14px);
}

.cart-icon-wrapper {
  margin-left: 0 !important;
}

/* --- SEPET ANİMASYONU --- */
@keyframes cart-shake {
  0% {
    transform: rotate(0deg) scale(1);
  }
  25% {
    transform: rotate(-15deg) scale(1.1);
  }
  50% {
    transform: rotate(15deg) scale(1.2);
    color: #ff3b30;
  } /* Anlık renk değişimi */
  75% {
    transform: rotate(-15deg) scale(1.1);
  }
  100% {
    transform: rotate(0deg) scale(1);
  }
}

.cart-added-anim i {
  animation: cart-shake 0.5s ease-in-out;
  color: #ff3b30 !important; /* Animasyon süresince ikon kırmızı olsun */
}

/* KULLANICI MENÜSÜ */
.user-menu-wrapper {
  position: relative;
}

.user-icon {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  color: white;
  font-size: 20px;
}

.user-icon:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  min-width: 240px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
}

.user-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-menu::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 10px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid white;
}

.user-menu-header {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-menu-header i {
  font-size: 32px;
  color: var(--limit-cyan);
}

.user-menu-name {
  font-size: 15px;
  font-weight: 700;
  color: #333;
  margin-bottom: 2px;
}

.user-menu-email {
  font-size: 12px;
  color: #666;
  word-break: break-all;
}

.user-menu-divider {
  height: 1px;
  background: #e0e0e0;
  margin: 0 12px;
}

.logout-btn {
  width: calc(100% - 24px);
  margin: 12px;
  padding: 12px;
  background: linear-gradient(135deg, #ff3b30 0%, #d32f2f 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.logout-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 59, 48, 0.4);
}

.logout-btn:active {
  transform: translateY(0);
}

@media (max-width: 768px) {
  .user-menu {
    right: -10px;
  }
}
