@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

:root {
    --sidebar-width: 250px;
    --primary-green: #1462a2;
    --light-gray: #F7F9FD;
    --border-color: #D5D8E5;
    --dark-gray: #343a40;
    --bg-color: #FBFDFF;
}

[data-bs-theme=dark] {
    --border-color: rgb(213 216 229 / 17%);
    --light-gray: rgb(247 249 253 / 6%)
}

.z-none {
    display: none !important;
}

a {
    text-decoration: none !important;
    color: inherit !important;
}

.btn-primary {
    background: #1462a2 !important;
    border-color: #1462a2 !important;
    color: white !important;
}

body {
    font-family: "Poppins", sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden !important;
}

body:not([data-bs-theme=dark]) {
    background-color: #fff;
    background-image: url(../image/background.webp);
    background-attachment: fixed;
    background-position: 50%;
    background-repeat: repeat;
    background-size: cover;
    -webkit-background-size: cover;
}

#loader {
    width: 100vw;
    height: 100vh;
    position: fixed;
    align-content: center;
    top: 0px;
    right: 0px;
    left: 0px;
    bottom: 0px;
    z-index: 9999;
    background: rgb(0 0 0 / 5%);
    backdrop-filter: blur(10px);
    display: none;
}

#loader .loader {
    width: 60px;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 8px solid #0000;
    border-right-color: #1462a2;
    position: relative;
    animation: loaderAnim 1s infinite linear;
    display: block;
    margin: auto;
}

#loader .loader:before,
#loader .loader:after {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: inherit;
    animation: inherit;
    animation-duration: 2s;
}

#loader .loader:after {
    animation-duration: 4s;
}

@keyframes loaderAnim {
    100% {
        transform: rotate(1turn);
    }
}

.Head_Top .logo {
    width: 100px;
    border-radius: 7px;
}

.logo {
    width: 150px;
    border-radius: 10px;
}

.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background-color: white;
    border-right: 1px solid var(--border-color);
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
}

[data-bs-theme=dark] .sidebar {
    background: transparent;
}

.sidebar-header {
    padding: 2rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    z-index: 2;
    position: relative;
    background: #ffffff;
}

[data-bs-theme=dark] .sidebar-header {
    background: #202529;
}

.sidebar-nav {
    padding: 1rem 0;
    position: absolute;
    top: 147px;
    bottom: 131px;
    overflow-y: auto;
    left: 0;
    right: 0;
}

.nav-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 0.375rem;
    margin: .75rem 0.5rem;
    display: block;
    border: 1px solid transparent;
    transition: all 0.3s ease-in-out;
}

.nav-item:hover,
.nav-item.active {
    background-color: var(--light-gray);
    border: 1px solid var(--border-color);
}

.nav-item.nav-item-divider {
    background: none !important;
    border: 0;
    border-top: 2px solid var(--border-color);
    margin: 20px 24px;
    padding: 0px;
    cursor: unset;
    border-radius: unset;
    transition: unset;
    opacity: 1;
}

.nav-item.nav-item-divider:hover, .nav-item.nav-item-divider.active {
    border-top: 1px solid var(--border-color);
}

.sidebar-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 18px 18px 10px 18px;
    border-top: 1px solid var(--border-color);
    z-index: 1;
    background: #FFFFFF;
}

[data-bs-theme=dark] .sidebar-bottom {
    background: #202529;
}

.add-new-btn {
    background-color: var(--primary-green);
    border: none;
    color: white;
    font-weight: 500;
    border-radius: 0.375rem;
    padding: 0.75rem 1rem;
    width: 100%;
    margin-bottom: 1rem;
    transition: background-color 0.2s;
}

.question-btn {
    background-color: var(--primary-green);
    border: none;
    color: white;
    font-weight: 500;
    border-radius: 0.375rem;
    padding: 8px 30px;
    margin-bottom: 1rem;
    transition: background-color 0.2s;
}

.dropdown-toggle {
    width: 100%;
    text-align: left;
    border: 1px solid var(--border-color);
    background-color: white;
    border-radius: 0.375rem;
    padding: 0.5rem;
    margin-bottom: 1rem;
}

[data-bs-theme=dark] .dropdown-toggle {
    background-color: transparent;
}

.user-profile {
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.img_user {
    width: 32px;
    border-radius: 50%
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #6c757d;
}

.Top_menu {
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.main-content {
    margin-left: var(--sidebar-width);
    padding: 5rem 5rem;
    /* min-height: 100vh;
    background: var(--bg-color); */
    transition: margin 0.3s ease-in-out;
    overflow-x: hidden;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 35px;
    margin: 0;
}

.create-btn,
.logs-btn,
.add-new-btn {
    background-color: var(--primary-green);
    border: none;
    color: white;
    font-weight: 400;
    border-radius: 0.375rem;
    padding: 8px 20px;
    transition: background-color 0.2s;
}

.logs-btn {
    padding: 8px 30px !important;
}


.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    background-color: var(--light-gray);
}

.search-input::placeholder {
    color: #959595;
}

.chatbot-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chatbot-item {
    background-color: var(--light-gray);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: box-shadow 0.2s;
}

.chatbot-item2 {
    padding: 12px;
    font-size: 14px !important;
}


.chatbot-name {
    font-weight: 400;
    font-size: 17px;
    color: #000;
    margin: 0;
}

.chatbot-name {
    font-size: 14px !important;
}

.chatbot-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.action-btn {
    background-color: #000;
    border: none;
    color: white;
    border-radius: 0.375rem;
    padding: 4px 15px;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}


.toggle-switch {
    position: relative;
    width: 48px;
    height: 24px;
    background-color: #ccc;
    border-radius: 24px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.toggle-switch.active {
    background-color: var(--primary-green);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
}

.toggle-switch.active::after {
    transform: translateX(24px);
}

.more-actions {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
}


.collapse-btn {
    position: absolute;
    top: 50%;
    right: -12px;
    transform: translateY(-50%);
    background-color: var(--primary-green);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1001;
    font-size: 14px;
    transition: right 0.3s ease-in-out;
}

.sidebar-open-btn {
    position: fixed;
    top: 10px;
    left: 10px;
    background-color: #000;
    color: white;
    border: none;
    border-radius: 0.375rem;
    width: 40px;
    height: 40px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.chat-preview {
    position: relative;
}

.chat-input-container {
    position: absolute;
    padding: 10px;

}

.chat-messages {
    padding-bottom: 70px;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
}

.sidebar-open-btn.show {
    display: flex;
}

/* Second page chat2 */
.main-content2 {
    margin-left: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-color);
}

[data-bs-theme=dark] .main-content2 {
    background: transparent;
}

.flex_chat {
    display: flex;
}

.Head_Top {
    height: 100vh;
    display: flex;
    background: #fff !important;
}

[data-bs-theme=dark] .Head_Top {
    background: transparent !important;
}

.circle {
    border-radius: 50%;
    border: 0;
    padding: 7px 15px;
    border: 1px solid var(--border-color);
}

.config-panel {
    height: 92vh;
    overflow-y: auto;
    flex: 1;
    padding: 2rem;
    border-right: 1px solid var(--border-color);
}

.chat-preview {
    height: 92vh;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 1rem 3.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: margin 0.3s ease-in-out;
}

.chatbot-selector {
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 2px 8px;
    border: 1px solid transparent;
    transition: all 0.3s ease-in-out;
}

.chatbot-selector:hover,
.chatbot-selector.active {
    background-color: var(--light-gray);
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.memory-info {
    font-size: 14px;
    color: #4C4C4C;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    background-color: #000;
    border: none;
    color: white;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.logs-btn,
.creat-btn,
.add-btn,
.delete-btn,
.install-btn {
    background-color: var(--primary-green);
    border: none;
    color: white;
    border-radius: 0.375rem;
    padding: 8px 30px;
    font-size: 15px
}

.add-btn,
.delete-btn,
.install-btn {
    font-family: 14px;
    padding: 6px 18px;
}

.chat-messages {
    flex: 1;
    padding: 3.5rem 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    max-width: 70%;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    word-wrap: break-word;
    font-size: 14px !important;
}

.message.user {
    align-self: flex-start;
    background-color: var(--light-gray);
    color: #000;
}

.message.bot {
    align-self: flex-end;
    background-color: white;
    color: #000;
}

.chat-input-container {
    padding: 1rem 1.5rem;
    display: flex;
    gap: 0.5rem;
}

.chat-input {
    flex: 1;
    padding: 25px 45px;
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

.send-btn {
    position: absolute;
    top: 38px;
    right: 70px;
}

.form-section {
    margin-bottom: 2rem;
}

.section-title {
    color: #4C4C4C;
    font-size: 16px;
    margin-bottom: 30px;
    text-transform: uppercase;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: #464646;
    font-size: 14px;
}

[data-bs-theme=dark] .form-label {
    color: unset;
}

.form-select {
    font-size: 14px;
    background-color: var(--light-gray);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: box-shadow 0.2s;
    padding: 12px;
}

.bi-dash-lg {
    position: absolute;
    top: 13px;
    right: 23px;
}

.form-select:hover {
    outline: none;
}

label {
    margin: 0px 8px;
}

.form-input {
    width: 100%;
    font-size: 14px;
    color: #464646;
    padding: 12px !important;
}

.form-textarea {
    width: 100%;
    min-height: 100px;
    resize: vertical;
    color: #464646;
    font-size: 14px;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
}

.file-upload {
    display: flex;
    border-radius: 0.375rem;
    background-color: var(--light-gray);
}

.file-upload-btn {
    padding: 0.75rem 1rem;
    cursor: pointer;
    background-color: white;
    border-top-left-radius: 0.375rem !important;
    border-bottom-left-radius: 0.375rem !important;
}

.file-upload-text {
    flex: 1;
    padding: 0.75rem 1rem;
    color: #6c757d;
    font-size: 0.875rem;
    border-top-right-radius: 0.375rem !important;
    border-bottom-right-radius: 0.375rem !important;
    border-left: 0px !important;
}

.toggle-switch {
    position: relative;
    min-width: 48px;
    width: 48px;
    height: 24px;
    background-color: #ccc;
    border-radius: 24px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: inline-block;
}

.toggle-switch.active {
    background-color: var(--primary-green);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
}

.toggle-switch.active::after {
    transform: translateX(24px);
}

.setting-item {
    display: flex;
    display: flex;
    justify-content: start;
    align-items: center;
    margin-bottom: 25px;
    gap: 35px;
}

.setting-label {
    font-size: 0.875rem;
    color: #4C4C4C;
}

.slider-container {
    margin-bottom: 1rem;
}

.slider-container:last-child {
    margin-bottom: 0px;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.slider-title {
    font-size: 0.875rem;
    color: #4C4C4C;
}

.slider-value {
    font-size: 0.875rem;
    color: #4C4C4C;
}

.slider {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background-color: #e9ecef;
    outline: none;
    appearance: none;
    position: relative;
}

.slider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--primary-green);
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--primary-green);
    cursor: pointer;
    border: none;
}

.scroll {
    padding-bottom: 115px;
    overflow: auto;
}

.scroll::-webkit-scrollbar {
    width: 2px;
}

.scroll::-webkit-scrollbar-track {
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
}

.scroll::-webkit-scrollbar-thumb {
    background-color: darkgrey;
    outline: 1px solid slategrey;
}

.th_1 {
    width: 25%;
    font-size: 14px;
    font-weight: 400;
    background: transparent;
}

.th_2 {
    width: 75%;
    font-size: 14px;
    font-weight: 400;
    background: transparent;
}

th,
td {
    background-color: transparent !important;
}

.app-card-row .col-md-6 {
    padding-right: 20px;
    padding-left: 20px;
    margin-top: 40px;
}

.settings-cards .card:not(:first-child) {
    margin-top: 40px;
}

.app-card-row .main_iframe {
    width: 100%;
    height: 80vh;
}

.settings-cards .card,
.app-card {
    box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;
    transition: all 0.19s ease-in-out;
    border: 0px;
    height: 100%;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: row;
}

[data-bs-theme=dark] .settings-cards .card,
[data-bs-theme=dark] .app-card {
    box-shadow: rgba(255, 255, 255, 0.1) 0px 4px 12px;
}

.app-card:hover {
    box-shadow: rgba(17, 17, 26, 0.05) 0px 4px 16px, rgba(17, 17, 26, 0.05) 0px 8px 32px;
}

[data-bs-theme=dark] .app-card:hover {
    box-shadow: rgba(255, 255, 255, 0.05) 0px 4px 16px, rgba(255, 255, 255, 0.05) 0px 8px 32px;
}

.app-card .card-img-top {
    border-radius: 8px;
    width: 215px;
}

.settings-cards .card .card-body,
.app-card .card-body {
    padding: 30px 25px 35px;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
}

.settings-cards .card .card-title,
.app-card .card-title {
    font-size: 24px;
    font-weight: 600;
}

.settings-cards .card .card-text,
.app-card .card-text {
    font-size: 13px;
    font-weight: 400;
}

.settings-cards .card .btn,
.app-card .btn {
    font-size: 18px;
    font-weight: 500;
    width: 100%;
}

.settings-cards .card .btn {
    width: fit-content;
}

.settings-cards form {
    border-top: 1px solid var(--border-color);
    padding-top: 25px;
}

.dropstart .dropdown-toggle::before {
    position: relative;
    top: -1px;
}

.passToggle {
    position: relative;
}

.passToggle input {
    padding-right: 30px;
    font-size: 14px;
}

.passToggle i {
    position: absolute;
    top: 4px;
    right: 7px;
    font-size: 19px;
    cursor: pointer;
}

.form-text {
    color: rgb(255 0 0 / 91%);
    font-size: 13px;
}

.dropdown-item.active, .dropdown-item:active {
    color: white !important;
    text-decoration: none;
    background-color: #1462a2 !important;
}

@media (max-width: 1268px) {
    .chat-input-container {
        position: sticky;
        z-index: 1050;
    }

    .main-content2 {
        height: 100%;
    }
}

@media (max-width: 768px) {
    .Top_menu {
        gap: 0px;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

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

    .main-content {
        padding: 2rem 20px;
        margin-left: 0;
    }

    .page-title {
        font-size: 30px;
    }

    .page-header {
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 10px;
    }

    .th_1 {
        width: 35px;
    }

    .th_2 {
        width: 65px;
    }

    .flex_chat {
        flex-direction: column;
    }

    .main-content2 {
        margin-left: 0;
        flex-direction: column;
    }

    .Head_Top {
        margin-left: 0;
        flex-direction: column;
        padding: 1rem 0 1rem 2rem;
    }

    .config-panel {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .chat-header {
        padding: 1rem 10px;
    }

    .sidebar-open-btn {
        position: fixed;
        top: 15px;
        left: 11px;
        width: 33px;
        height: 32px;
        top: 11px;
    }

    .logo {
        width: 130px;
    }

    .sidebar-header {
        padding: 1rem 1rem;
    }

    :root {
        --sidebar-width: 200px;
    }

    .nav-item {
        font-size: 14px;
        margin-bottom: 0px;
        margin-top: 5px;
    }

    body {
        font-size: 14px;
    }

    .chatbot-selector {
        font-size: 14px;
    }

    .form-select {
        padding: 6px;
        margin: 0px;
        margin: auto;
        font-size: 13px;
    }

    .add-btn, .delete-btn, .install-btn {
        padding: 3px 10px;
    }

    .section-title {
        margin-bottom: 15px;
        font-weight: 500;
    }

    .form-label {
        margin: 0px;
        margin-bottom: 5px;
    }

    .form-input {
        font-size: 13px;
        padding: 8px !important;
    }

    .form-textarea {
        min-height: 70px;
        font-size: 13px;
        padding: 8px;
    }

    .file-upload-text {
        padding: 8px;
        font-size: 13px;
    }

    .file-upload-btn {
        padding: 8px;
        font-size: 13px;
    }

    .form-group {
        margin-bottom: 15px;
    }

    .setting-label {
        font-size: 13px;
    }

    .setting-item {
        margin-bottom: 15px;
        gap: 15px;
    }

    .slider-container {
        margin-bottom: 10px;
    }

    .slider-label {
        margin-bottom: 0px;
    }

    .question-btn {
        margin-left: 8px;
    }

    .message {
        font-size: 12px !important;
        padding: 8px 10px;
    }

    .send-btn {
        top: 24px;
        right: 41px;
    }

    .chat-input {
        padding: 15px 13px;
        font-size: 13px;
    }

    .app-card .card-img-top {
        width: 100%;
    }

    .app-card {
        flex-direction: column;
    }

    .dropdown-item {
        font-size: 14px;
    }

    .settings-cards .card .card-title, .app-card .card-title {
        font-size: 20px;
    }
}