/* Google Fonts: Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

/* Genel Font */
#chat-window, #chat-button {
    font-family: 'Poppins', sans-serif !important;
}

/* =========================
   CHAT BUTTON (PC + Mobil)
   ========================= */
#chat-button {
    width: 130px;
    height: 80px;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #224fe7;
    color: #fff;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: background-color .3s;
}

#chat-button:hover {
    background-color: #003fcc;
}

#chat-button .icon {
    font-size: 24px;
    line-height: 1;
}

#chat-button.pulse {
    animation: pulse 1.2s ease-in-out infinite;
}

/* =========================
        CHAT WINDOW
   ========================= */
#chat-window {
    position: fixed;
    bottom: 110px;
    right: 20px;
    width: 425px;
    max-height: 700px;
    background: #fff;
    border-radius: 0px;
    box-shadow: 0 8px 18px rgba(0,0,0,0.25);
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: all .3s ease;
    display: flex;
    flex-direction: column;
    z-index: 9998;
}

#chat-window.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* HEADER */
#chat-header {
    background: #224fe7;
    color: white;
    padding: 14px;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    position: relative;
}

#chat-header .chat-close {
    font-size: 20px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: .2s;
}

#chat-header .chat-close:hover {
    background: rgba(255,255,255,0.15);
}

/* =========================
       CHAT BODY
   ========================= */
#chat-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* BOT MESSAGE */
.bot {
    background: #eef2f5;
    padding: 10px 14px;
    border-radius: 10px;
    max-width: 100%;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    animation: fadeIn .3s ease;
    font-size: 15px;
    margin-bottom: 10px;
}

/* =========================
       OPTIONS BUTTONS
   ========================= */
#chat-options {
    padding: 12px 14px;
    border-top: 1px solid #e5e5e5;
    background: #fafafa;
}

#chat-options button {
    width: 100%;
    padding: 5px;
    background: #ebebeb;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 8px;
    transition: .2s;
}

#chat-options button:hover {
    background: #224fe7;
    color: white;
}

/* Suboptions Anim */
.suboptions {
    display: none;
    opacity: 0;
    transform: translateX(20px);
    transition: .25s ease;
}

.suboptions.show {
    display: flex;
    opacity: 1;
    transform: translateX(0);
}

/* Loader */
.loader {
    width: 26px;
    height: 26px;
    margin: 10px auto;
    border: 4px solid #ddd;
    border-top: 4px solid #224fe7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

/* =========================
    MOBILE FULLSCREEN MODE
   ========================= */
@media (max-width: 768px) {

  #chat-window {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    border-radius: 0 !important;
    max-height: none !important;
  }

  #chat-messages-container {
    max-height: calc(100vh - 140px) !important; /* 130px değil 140 daha ideal */
  }
}


@media (min-width: 769px) {
  #chat-messages-container {
    max-height: 600px !important;
  }
}


/* Mobilde gizleme için özel class */
#chat-button.hide-mobile {
    display: none !important;
}

@media (min-width: 769px) {
    /* PC'de bu class etkisiz olsun */
    #chat-button.hide-mobile {
        display: flex !important;
    }
}

/* ============================================
   🔧 Mobilde seçeneklerin TAMAMININ sığması için
   ultra minimal düzenlemeler
   ============================================ */
@media (max-width: 768px) {

  /* Bot ilk mesajını incelt */
  .bot {
    padding: 8px 10px !important;
    font-size: 14px !important;
    margin-bottom: 6px !important;
  }

  /* Header biraz daha ince olsun */
  #chat-header {
    padding: 10px 12px !important;
    font-size: 14px !important;
  }

  /* Seçenek butonları çok az küçülsün */
  #chat-options button {
    padding: 8px 10px !important;
    font-size: 13px !important;
    margin-bottom: 6px !important;
  }

  /* "Lütfen bir seçenek seçin" metnini biraz incelt */
  #chat-options p {
    margin-bottom: 6px !important;
    font-size: 13px !important;
  }

  /* Mesaj alanına fazladan yer kazandır */
  #chat-messages-container {
    max-height: calc(100vh - 160px) !important;
  }
}

@media (max-width: 768px) {
  #chat-window {
    height: 100dvh !important;
  }
  #chat-messages-container {
    max-height: calc(100dvh - 160px) !important;
  }
}