         body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    background-color: #f5f7fa;
    min-height: 100vh;
    overflow-x: hidden; /* allow vertical scroll */
}


 .chat-layout {
    display: flex;
    height: 100vh;
}




        .sidebar {
            width: 280px;
            background-color: #0d1117;
            color: #fff;
            padding: 20px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            height: 100vh;
            position: sticky;
            top: 0;
            overflow-y: auto;
        }

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: #1CC6B6;
    cursor: pointer;
    margin-right: 10px;
}


        .sidebar h5 {
            font-size: 18px;
            margin-bottom: 20px;
            font-weight: 600;
        }

        .chat-list div {
            padding: 10px 15px;
            margin-bottom: 10px;
            background: #1b1f24;
            border-radius: 8px;
            font-size: 14px;
            cursor: pointer;
            color: #ddd;
        }

        .chat-list div.active {
            background-color: #333;
            font-weight: bold;
        }

        .chat-content {
            flex: 1;
            display: flex;
            flex-direction: column;
            height: 100vh;
            overflow: hidden;
        }

        .chat-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 20px;
            color: #1CC6B6;
            font-weight: bold;
            font-size: 22px;
        }

        .chat-header i {
            margin-right: 10px;
            font-size: 24px;
        }

        .chat-messages {
            flex: 1;
            overflow-y: auto;
            padding: 20px;
        }

       .message-row {
  display: flex;
  margin-bottom: 10px;
  padding: 0 10px;
}

.message-row.user {
  justify-content: flex-end;
}

.message-row.bot {
  justify-content: flex-start;
}

.message-bubble {
  position: relative;
  padding: 10px 14px;
  border-radius: 18px;
  max-width: 80%;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);

}

.message-row.bot .message-bubble {
  background-color: #f0f0f0;
  color: #333;
  border-bottom-left-radius: 0;
}

.message-row.user .message-bubble {
  background-color: #1CC6B6;
  color: #fff;
  border-bottom-right-radius: 0;
}

/* Dark Mode Tweaks */
.dark-mode .message-row.bot .message-bubble {
  background-color: #1b1f24;
  color: #ddd;
}

.dark-mode .message-row.user .message-bubble {
  background-color: #1CC6B6;
  color: white;
}


        .chat-input {
            background: #fff;
            border: 1px solid #ccc;
            border-radius: 30px;
            padding: 10px 15px;
            display: flex;
            align-items: center;
            position: sticky;
            bottom: 0;
            margin: 10px 20px;
        }

        .chat-input input {
            flex: 1;
            border: none;
            outline: none;
            font-size: 15px;
        }

        .chat-input i {
            margin-left: 15px;
            font-size: 20px;
            color: #1CC6B6;
            cursor: pointer;
        }

        .centered-placeholder {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            border-radius: 16px;
            box-shadow: 0 0 10px rgba(0,0,0,0.05);
        }

        .center-message {
            font-size: 22px;
            font-weight: 600;
            color: #222;
            margin-bottom: 20px;
        }

        .user-initial {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background-color: #1CC6B6;
            color: #fff;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 16px;
            cursor: pointer;
            margin-right: 10px;
        }

        .user-box {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-direction: column;
            align-items: end;
        }

        .user-details {
            display: flex;
            flex-direction: column;
            align-items: end;
        }

        .dropdown-menu-custom {
            min-width: 200px;
        }

        .btn-outline-primary:hover {
            background-color: #1CC6B6;
            color: #fff;
            border-color: #1CC6B6;
        }

        .btn-success:hover {
            opacity: 0.9;
        }

        .btn-sm {
            font-size: 13px;
        }

        .dark-mode {
            background-color: #0d1117;
            color: #ddd;
        }

        .dark-mode .chat-content {
            background-color: #0d1117;
            color: #ddd;
        }

        .dark-mode .chat-messages,
        .dark-mode .centered-placeholder {
            background-color: #0d1117;
            color: #ddd;
        }

        .dark-mode .message-row.bot .message-bubble {
            background-color: #0d1117;
            color: #eee;
        }

        .dark-mode .message-row.user .message-bubble {
            background-color: #1CC6B6;
            color: #fff;
        }

        .dark-mode .chat-input {
            background-color: #1b1f24;
            border-color: #444;
        }

        .dark-mode input,
        .dark-mode .chat-input i {
            color: #eee;
        }

        .dark-mode .chat-input {
            background-color: #1b1f24;
            border: 1px solid #333;
            border-radius: 30px;
            padding: 10px 15px;
            display: flex;
            align-items: center;
        }

        .dark-mode .chat-input input {
            flex: 1;
            background-color: transparent;
            color: #fff;
            border: none;
            outline: none;
            padding: 8px 10px;
            font-size: 14px;
            font-family: 'Segoe UI', sans-serif;
        }

        .dark-mode .chat-input i {
            color: #1CC6B6;
            font-size: 20px;
            cursor: pointer;
        }

        .dark-mode .chat-input input::placeholder {
            color: #999;
        }
        .sidebar-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    align-self: flex-end;
    margin-bottom: 10px;
    cursor: pointer;
    display: none; /* Hidden by default on large screens */
}

/* For screens <= 991px (Tablets & Phones) */
@media (max-width: 991px) {
    .sidebar-close {
        display: inline-block;
    }
    .chat-layout {
        flex-direction: column;
        height: auto;
    }

   .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 97vh;
    width: 80%;
    max-width: 180px;
    background-color: #0d1117;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1050;
}

    

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: inline-block;
        background: none;
        border: none;
        font-size: 24px;
        color: #1CC6B6;
        cursor: pointer;
        padding: 10px;
        min-width: 44px;
    }

    .chat-header {
        position: fixed;
        top: 0;
        width: 100%;
        height: 60px;
        background-color: #ffffff;
        border-bottom: 1px solid #e0e0e0;
        display: flex;
        align-items: center;
        padding: 0 15px;
        z-index: 999;
    }

    .chat-title {
        margin-left: 10px;
        font-size: 18px;
        color: #1CC6B6;
        font-weight: 600;
    }

   .chat-content {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}


.chat-messages {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: calc(100vh - 140px); /* ← This is problematic */
    padding: 20px;
    padding-bottom: 90px;
    margin-top: 50px;
}






    .message-bubble {
        font-size: 14px;
        max-width: 90%;
        word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
    }

   .chat-input {
    position: relative;
    padding: 12px 16px;
    background: #fff;
    border-top: 1px solid #ddd;
}

@media (max-width: 991px) {
   .chat-input {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #ddd;
    padding: 10px 15px;
    z-index: 1000;
}

}
@media (max-width: 991px) {
  .chat-input.centered-start {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    max-width: none;
    padding: 10px 15px;
    border-top: 1px solid #ddd;
    z-index: 1000;
    border-radius: 0;
  }
}


    .chat-input input {
        font-size: 14px;
    }

    .center-message {
        font-size: 18px;
    }

    .chat-list {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .chat-list div {
        font-size: 13px;
        padding: 6px 10px;
        border-radius: 6px;
        white-space: nowrap;
    }

   

.dark-mode-toggle {
        justify-content: space-between;
        gap: 8px;
        padding: 0 5px;
    }

    .form-check-label {
        font-size: 12px;
        white-space: nowrap;
        margin-left: -50px;
    }
    .center-message {
    font-size: 22px;              /* Increased font size */
    font-weight: 600;
    color: #222;
    white-space: nowrap;         /* Prevents line break */
    text-align: center;
}

/* Center the empty state on screen */
.emptyState {
    display: flex;
    justify-content: center;
    align-items: center;
    height: calc(100vh - 120px); /* Adjust for header and input */
    text-align: center;
    padding: 20px;
}

    .center-message {
        font-size: 34px;
    }

}
@media (max-width: 767px) {
    /* Hide Signup button and Help dropdown in mobile view */
    a.btn-success,         /* Targets the green Signup button */
    .dropdown              /* Targets the Help button with dropdown */
    {
        display: none !important;
    }

    /* Optional: tighten Login button spacing */
    a.btn-outline-primary {
        padding: 6px 10px !important;
        font-size: 14px;
    }

}

.chat-address-box {
    padding: 10px;
    line-height: 1.5;
    background-color: #f5f5f5;
    color: #333;
    border-radius: 10px;
    margin-bottom: 10px;
}

/* Dark mode override */
.dark-mode .chat-address-box {
    background-color: #1b1f24;
    color: #eee;
}

.lightbox-modal {
  display: none;
  position: fixed;
  z-index: 99999;
  left: 0; top: 0; width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.lightbox-modal img {
  max-width: 90%;
  max-height: 80%;
  margin-bottom: 10px;
}
.lightbox-nav {
  color: white;
  font-size: 2rem;
  cursor: pointer;
  margin: 0 20px;
}
.lightbox-close {
  color: white;
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 2rem;
  cursor: pointer;
}


button.micbtn,
button#micBtn,
button#micBtnCentered {
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #00cba9 !important;
  padding: 8px 16px !important;
  border-radius: 6px !important;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

button.micbtn:hover,
button.micbtn:focus {
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  transform: scale(1.1);
}


/* Mic modal overlay */
.mic-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #1e1e1e;
  padding: 20px;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  width: 320px; /* Adjust as needed */
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.mic-modal-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.mic-modal.hidden {
  display: none;
}

/* Audio level meter */
.mic-meter {
  width: 100%;
  height: 8px;
  background: #444;
  border-radius: 4px;
  margin-bottom: 20px;
  overflow: hidden;
}
.mic-meter-inner {
  height: 100%;
  background: #00cba9;
  width: 0%;
  transition: width 0.1s ease-out;
  border-radius: 4px;
}

/* Buttons row */
.mic-buttons {
  display: flex;
  gap: 16px;
}

/* Confirm / Cancel buttons */
.mic-buttons .btn {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  transition: transform 0.2s ease;
}

.mic-buttons .btn:hover {
  transform: scale(1.1);
}

.mic-confirm-btn,
.mic-cancel-btn {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 10px;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.mic-confirm-btn {
  background: none;
  color: white;
}

.mic-cancel-btn {
  background: none;
  color: white;
}

.mic-confirm-btn:hover,
.mic-cancel-btn:hover {
  transform: scale(1.1);
}

#micCanvas {
  width: 100%;
  max-width: 320px;
  height: 80px;
  background: #1e1e1e;
  border-radius: 8px;
  box-shadow: inset 0 0 5px rgba(0,0,0,0.3);
}

.sidebar-backdrop {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.4);
  display: none;
  z-index: 998;
}
.sidebar.show + .sidebar-backdrop {
  display: block !important;
}

@media (max-width: 768px) {
  body {
    background-color: #ffffff !important;
  }

  .chat-layout {
    background-color: #ffffff !important;
  }

  .chat-content {
    background-color: #ffffff !important;
  }
}

@media (max-width: 768px) {
  .dark-mode .chat-content,
  .dark-mode .chat-messages {
    background-color: #0d1117 !important;
    min-height: calc(100vh - 60px); /* adjust based on header height */
  }

  .chat-messages {
    padding-top: 70px !important; /* header height + some spacing */
    flex: 1;
    overflow-y: auto;
    background-color: inherit;
  }

  .chat-content {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background-color: inherit;
  }
}

/* GLOBAL FIX */
html, body {
  max-width: 100vw;
  overflow-x: hidden;
}

/* Optional: prevent containers from overflowing */
.container, .chat-layout, .chat-content, .sidebar {
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

img, video, canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

* {
  box-sizing: border-box;
}


.chat-layout, .chat-content {
  min-height: 100svh; /* Supported on modern browsers */
}

.chat-layout, .chat-content {
  min-height: 100dvh; /* Modern fix */
  min-height: 100svh; /* For newer iOS */
  height: 100vh;
}


.chat-messages::-webkit-scrollbar {
  display: none;
}
.chat-messages {
  -ms-overflow-style: none;  /* IE/Edge */
  scrollbar-width: none;     /* Firefox */
}