

/* ================= FULLSCREEN EMBED FIX ================= */

html, body {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: hidden !important;
}






/* iframe ke background ko white rakho */
body {
  font-family: Arial, sans-serif;
  background: transparent !important;
  margin: 0;
}





/* ================= MOBILE FULL SCREEN CHAT ================= */
@media (max-width: 768px) {



  .chat-box {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;          /* 🔥 keyboard-safe height */
    max-height: 100dvh;
    border-radius: 0;
    
  }

  
  .chat-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .chat-footer {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* Landscape safety */
@media (orientation: landscape) {
  .chat-box {
    height: 100dvh;
  }
}



/* Floating Button */
#chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #25D366;
    color: white;
    font-size: 24px;
    padding: 14px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 999;
}

/* ================= CHAT BOX (EMBED + FULLSCREEN) ================= */
.chat-box {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  background: #fff;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  z-index: 1000;
}




/* Header */
.chat-header {
    background: #075E54;
    color: white;
    padding: 10px;
    display: flex;
    justify-content: space-between;
}

/* ================= CHAT BODY (WHATSAPP BG) ================= */
.chat-body {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    font-size: 14px;
    background: #efeae2; /* WhatsApp light bg */
}


/* ================= CHAT FOOTER ================= */
.chat-footer {
    padding: 8px;
    border-top: 1px solid #ddd;
    background: #f0f0f0;
}

/* INPUT BAR */
.input-row {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 25px;
    padding: 4px 8px;
    gap: 6px;
}

/* MESSAGE INPUT */
.input-row textarea {
    flex: 1;
    resize: none;
    height: 36px;
    border: none;
    outline: none;
    font-size: 14px;
    padding: 6px;
}

/* ATTACH BUTTON */
.attach-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: transparent;
    border: none;
    font-size: 16px;
    cursor: pointer;
}






.message {
    max-width: 75%;
    padding: 8px 10px;
    margin-bottom: 8px;
    border-radius: 8px;
    font-size: 13px;
    position: relative;
    line-height: 1.4;
}

.message.client {
    background: #dcf8c6;
    margin-left: auto;
    border-top-right-radius: 0;
}

.message.admin {
    background: #ffffff;
    margin-right: auto;
    border-top-left-radius: 0;
}


.message .time {
    font-size: 10px;
    color: #666;
    text-align: right;
}

.message .seen {
    font-size: 10px;
    color: #4fc3f7;
    margin-left: 4px;
}

#unread-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: red;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 50%;
}


/* ================= INPUT ROW ================= */
.input-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ================= ATTACH BUTTON (WHATSAPP STYLE) ================= */
.attach-btn {
    width: 28px;          /* 🔽 chhota size */
    height: 28px;
    border-radius: 50%;
    background: #f2f2f2;
    border: none;
    font-size: 13px;      /* 📎 icon chhota */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.attach-btn:hover {
    background: #e6e6e6;
}

/* ================= MESSAGE INPUT ================= */
.input-row textarea {
    flex: 1;
    resize: none;
    height: 36px;
    border-radius: 20px;   /* ✅ WhatsApp pill shape */
    padding: 8px 12px;
    border: 1px solid #ccc;
    font-size: 13px;
}





/* ================= IMAGE MESSAGE ================= */
.message img {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 4px;
}

/* ================= IMAGE GROUP (MULTIPLE IMAGES) ================= */

.media-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
}

.media-item {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;   /* 🔥 square tiles */
    overflow: hidden;
}

.media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

/* 🔥 +N overlay (5th, 6th image etc.) */
.media-item.overlay .more {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: 22px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}



/* ================= SEND BUTTON (WHATSAPP) ================= */
.send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #25D366;
    border: none;
    color: white;
    font-size: 16px;    
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* ================= IMAGE VIEWER (CLIENT) ================= */

.image-viewer {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.image-viewer.hidden {
    display: none;
}

.image-viewer img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

/* CLOSE */
.image-viewer .close {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 32px;
    color: #fff;
    cursor: pointer;
}

/* SLIDER BUTTONS */
.image-viewer .nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
}

.image-viewer .nav.left {
    left: 20px;
}

.image-viewer .nav.right {
    right: 20px;
}



.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


/* ================= EMBED MODE =================  dubble button*/
body.embed-mode #chat-toggle {
    display: none !important;  
}


/* 🔥 Chat open hone par floating button hide */
/* .chat-box.open ~ #chat-toggle {
    display: none !important;
} */
