/* AIMC Frontend Widget - mobile first */
#aimc-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2147483647;
  /* En üstte kalsın */
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: normal;
}

#aimc-widget * {
  box-sizing: border-box;
}

.aimc-panel {
  display: none;
  position: absolute;
  bottom: 75px;
  right: 0;
  width: 380px;
  height: min(600px, 80vh);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 12px 50px rgba(0, 0, 0, .25);
  overflow: hidden;
  flex-direction: column;
  border: 1px solid #e5e7eb;
  transition: all .3s ease;
}

#aimc-widget.is-open .aimc-panel {
  display: flex;
}

.aimc-head {
  padding: 16px 20px;
  background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#aimc-widget .aimc-bubble {
  width: 62px !important;
  height: 62px !important;
  border-radius: 50% !important;
  border: 0 !important;
  cursor: pointer !important;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.35) !important;
  background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%) !important;
  color: #fff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  transition: all .3s cubic-bezier(.175, .885, .32, 1.275) !important;
  margin: 0 !important;
}

#aimc-widget .aimc-bubble:hover {
  transform: scale(1.08) translateY(-2px) !important;
  box-shadow: 0 12px 28px rgba(79, 70, 229, 0.45) !important;
}

#aimc-widget .aimc-bubble-icon {
  width: 28px !important;
  height: 28px !important;
  color: #ffffff !important;
  stroke: #ffffff !important;
  fill: none !important;
  pointer-events: none !important;
  transition: opacity 0.3s ease, transform 0.3s ease !important;
}

#aimc-widget .aimc-bubble .aimc-icon-close {
  display: none !important;
  width: 26px !important;
  height: 26px !important;
}

#aimc-widget.is-open .aimc-bubble .aimc-icon-chat {
  display: none !important;
}
#aimc-widget.is-open .aimc-bubble .aimc-icon-close {
  display: block !important;
}

.aimc-title {
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
}

.aimc-title-icon {
  width: 20px;
  height: 20px;
  color: #ffffff;
  flex-shrink: 0;
}


.aimc-lang{
  display:flex;
  gap:4px;
  margin-left:auto;
  margin-right:8px;
  flex-shrink: 0;
}
#aimc-widget .aimc-langbtn{
  appearance:none !important;
  border:1px solid rgba(255,255,255,.4) !important;
  background: rgba(255,255,255,.15) !important;
  color:#ffffff !important;
  font-size:12px !important;
  font-weight:600 !important;
  padding:6px 8px !important;
  border-radius:8px !important;
  cursor:pointer !important;
  line-height:1 !important;
  transition:all 0.2s ease !important;
  margin: 0 !important;
}
#aimc-widget .aimc-langbtn:hover{
  background: rgba(255,255,255,.3) !important;
}
#aimc-widget .aimc-langbtn.is-active{
  background:#ffffff !important;
  border-color:#ffffff !important;
  color:#3b82f6 !important;
  font-weight:700 !important;
  box-shadow:0 2px 6px rgba(0,0,0,0.15) !important;
}
.aimc-close {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  padding: 0 5px;
}

.aimc-body {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #f8fafc;
}

.aimc-msgs {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.aimc-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  margin: 10px 0;
  font-size: 14px;
  line-height: 1.4;
  position: relative;
}

.aimc-msg.is-me {
  margin-left: auto;
  background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.15);
}

.aimc-msg.is-them {
  margin-right: auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  border-bottom-left-radius: 4px;
}

.aimc-identity {
  padding: 15px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.aimc-id-title {
  font-weight: 700;
  margin-bottom: 10px;
  font-size: 14px;
}

.aimc-identity input {
  width: 100%;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  margin-bottom: 10px;
  font-size: 14px;
  transition: all 0.2s;
}

.aimc-identity input:focus {
  border-color: #4f46e5;
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.aimc-id-save {
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.aimc-id-save:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.aimc-send {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.aimc-input {
  flex: 1;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  font-size: 14px;
  outline: none;
  resize: none;
  overflow: hidden;
  min-height: 44px;
  max-height: 180px; /* büyür, çok uzarsa içinde scroll */
}

.aimc-input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.aimc-sendbtn {
  padding: 10px 16px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.aimc-sendbtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

@media (max-width: 600px) {
  #aimc-widget {
    right: 15px;
    bottom: 15px;
  }

  /* WhatsApp vs butonu varsa üzerine gelmesin diye biraz yukarı alıyoruz */
  /* Genelde wp butonları 20px-20px civarı durur, biz 85px yukarı çıkabiliriz veya sağ/sol ayarı yapılabilir */

  .aimc-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    border: 0;
    z-index: 2147483647;
  }
}
#aimc-widget.is-rtl .aimc-head{direction:rtl;}
#aimc-widget.is-rtl .aimc-msg.is-me{margin-left:0;margin-right:auto;border-bottom-right-radius:16px;border-bottom-left-radius:4px;}
#aimc-widget.is-rtl .aimc-msg.is-them{margin-right:0;margin-left:auto;border-bottom-left-radius:16px;border-bottom-right-radius:4px;}
#aimc-widget.is-rtl .aimc-send{direction:rtl;}

/* Fiyat Listesi Butonu */
.aimc-price-list {
  padding: 10px 15px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.aimc-price-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #fff;
  text-decoration: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.aimc-price-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
  color: #fff;
}

.aimc-price-btn:active {
  transform: scale(0.98);
}
