body {
    background: linear-gradient(to bottom, #F0F0F0, #E3EDFF);
    /* background-image: url('../chatbotbg.jpg'); */
    /* width: 100%; */
    /* height: 100%; */
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 30px !important;
    /* padding: 3px; */
    /* height: 100vh; */
    /* width: 100vw; */
    /* display: flex; */
    flex-direction: row;
    overflow: hidden;
    background-position: 38% 20%;
}

.form-group {
    margin-bottom: 20px;
    width: 100%;
    text-align: left;
    box-sizing: border-box;
}

.form-group label {
    display: block;
    padding-bottom: 5px;
    /* Adjust as needed */
}

.form-group input {
    width: 330px;
    padding: 12px 14px;
    border: 1.5px solid #eeeeee;
    border-radius: 6px;
    font-size: 1em;
    background: #fafbfc;
    transition: border 0.2s;
    box-sizing: border-box;
}

.form-group input:focus {
    border-color: #1976d2;
    outline: none;
}




/* Main full-width header */
.main-header {
    width: 100% !important;
    /* background: #fff; */
    color: #222;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #eeeeee;
    /* position: fixed; */
    /* top: 0; */
    /* left: 0; */
    /* z-index: 100; */
    /* height: 48px; */
    box-sizing: border-box;
    font-size: 20px;
    font-weight: bold;
}

.main-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.datasetsection {
    height: 520px;
    overflow: auto;
}


.main-content {
    display: flex;
    flex-direction: row;
    height: calc(100vh - 140px);
    /* margin-top: 48px; */
    width: 100%;
    /* Ensure it fills the viewport width */
    box-sizing: border-box;
}

.sidebar-right {
    width: 520px;
    background: #fff;
    height: 100%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-radius: 0px 0px 20px 0px;
}

.center-container {
    flex: 1 1 0;
    /* This makes it expand to fill remaining space */
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    background: transparent;
    padding: 0;
    border-right: 0.5px solid #e0e0e0;
    /* Add this for a divider */
}

.chat-widget {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    background: #fff;
    border-radius: 0px 0px 0px 20px;
    margin: 0;
    max-width: none;
}

.chat-header {
    background: #fff;
    color: #222;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    font-size: 1.2em;
    min-height: 0;
    flex-shrink: 0;
    border-bottom: 1.5px solid #eeeeee;
    /* <-- Add this line */
}

.bot-icon {
    width: 28px;
    height: 28px;
    margin-right: 10px;
    border-radius: 50%;
    background: #fff;
    object-fit: cover;
}

.chat-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #fff;
}

.chat-bubble {
    max-width: 75%;
    padding: 12px;
    border-radius: 16px;
    font-size: 16px;
    word-break: break-word;
    display: inline-block;
    /* box-shadow: 0 1px 4px rgba(0,0,0,0.03); */
}

.user-bubble {
    background: #EDF6FF;
    /* semi-grey background for user */
    color: #52769B;
    align-self: flex-end;
    border-radius: 15px 15px 0px 15px;
}

.bot-bubble {
    background: transparent;
    color: #000;
    align-self: flex-start;
    border: none;
    padding: 10px 0px;
    /* margin: 0 0 18px 0; */
    /* box-shadow: none; */
    font-size: 16px;
    border-radius: 18px;
    margin-left: 8px;
}

/* Chat input area */
.chat-input-area {
    display: flex;
    align-items: center;
    padding: 12px;
    flex-shrink: 0;
    gap: 10px;
    box-shadow: 0 0px 15px #bde2ff;
    background: #ffffff;
    border-radius: 50px;
    width: 90%;
    margin: 0 auto;
    margin-bottom: 20px;
}

/* Input: rounded, fills available space */
.chat-input-area input[type="text"] {
    flex: 1;
    padding: 18px 24px;
    border: none;
    border-radius: 50px;
    outline: none;
    font-size: 15px;
    background: #fff;
    transition: border 0.2s;
    margin-right: 0;
    height: 46px;
    box-sizing: border-box;
}

/* Send icon button: circular, blue, icon centered */
.send-icon {
    background: transparent;
    border: none;
    color: #fff;
    border-radius: 50%;
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    padding: 0 !important;
    margin-left: 12px;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.08);
}

.send-icon svg {
    width: 22px;
    height: 22px;
    fill: #fff;
    /* White arrow */
    stroke: none;
    display: block;
}


.error {
    color: #c00;
}

.section-header {
    background: #fff;
    color: #222;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    font-size: 20px !important;
    border-bottom: 1px solid #eeeeee;
    font-weight: 600 !important;
    /* letter-spacing: 0.5px; */
    /* Make sure it stays at the top of its section */
}

.main-title {
    font-weight: 700;
    font-size: 1.15em;
}

.custom-label {
    display: block;
    padding-bottom: 20px;
    /* Adjust as needed */
}

/* === Typing Indicator Bubble === */
.typing-bubble {
    background-color: #EDF6FF;
    color: #2360c3;
    align-self: flex-start;
    border-radius: 18px;
    padding: 10px 14px;
    max-width: fit-content;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    margin-left: 12px;
}

.typing-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background-color: #2360c3;
    border-radius: 50%;
    display: inline-block;
    animation: blink 1.2s infinite ease-in-out both;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes blink {

    0%,
    80%,
    100% {
        transform: scale(0.8);
        opacity: 0.3;
    }

    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

button:disabled {
    opacity: 0.6;
    /* filter: blur(1px); */
    cursor: not-allowed;
    filter: none !important;
}


.whitecard {
    background: #fff;
    border-radius: 25px;
    box-shadow: 2px 3px 6px #c8e7ff;
}

.btnicon {
    height: 44px;
    margin-right: 20px;
}

.smallicon {
    height: 40px;
    margin-right: 10px;
}
.chatsection {
    width: 99% !important;
}


@media (max-width: 768px) {
.chatsection {
    width: 100% !important;
}

    .sidebar-right {
        width: 100%;
        height: auto;
        max-height: 250px;
        border-left: none;
        border-top: 1px solid #eeeeee;
    }

    .chat-widget {
        padding: 10px;
        flex: 1;
        overflow-y: auto;
    }

    .chat-input-area {
        display: flex;
        flex-direction: row;
        gap: 8px;
        margin-top: auto;
    }

    .chat-input-area input[type="text"] {
        flex: 1;
    }


    button[type="submit"] {
        font-size: 1em;
        padding: 14px 10px;
    }

    .smallicon {
        height: 30px;
    }

    .dataset-toggle-btn {
        display: block;
    }

    .sidebar-right {
        display: none;
        width: auto !important;
    }

    .sidebar-right.active {
        display: flex;
        flex-direction: column;
    }

    body {
        margin: 10px !important;
    }

    .chat-input-area input[type="text"] {
        height: 25px;
        padding: 15px 24px;
    }
    .btnicon {
    height: 40px;
    margin-right: 0px;
}
}


.dataset-toggle-btn {
    display: none;
    width: 100%;
    padding: 12px;
    background-color: #175078;
    color: white;
    border: none;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
}

/* Dataset button in chat header - mobile only */
.mobile-dataset-icon {
  display: none;
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
}

@media (max-width: 768px) {
  .mobile-dataset-icon {
    display: block;
  }

  /* Hide main sidebar-right on mobile completely */
  .sidebar-right {
    display: none !important;
  }

  /* Slide-in panel */
  .mobile-dataset-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 90%;
    max-width: 400px;
    height: 100%;
    background: #fff;
    box-shadow: -2px 0 8px rgba(0,0,0,0.2);
    z-index: 2000;
    transition: right 0.3s ease-in-out;
    display: block;
    flex-direction: column;
  }

  .mobile-dataset-panel.active {
    right: 0;
  }

  .mobile-dataset-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.4);
    z-index: 1999;
    display: none;
  }

  .mobile-dataset-overlay.active {
    display: block !important;
  }

  .mobile-dataset-close {
    font-size: 24px;
    padding: 10px;
    margin-left: auto;
    border: none;
    background: none;
    cursor: pointer;
  }
  
}

@media (min-width: 769px) {
  #datasetOverlay,
  #mobileDatasetPanel {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    top: -9999px !important;
    left: -9999px !important;
  }
}

/* #dataset-container div{
    padding: 8px !important;
    font-size: 14px !important;
    outline-offset: 2px !important;
    background: #eee !important;
    border-radius: 8px !important;
    margin: 12px !important;
} */

.dataset-highlight {
    background: #EDF6FF !important;
    color: #52769B !important;
}
