@charset "UTF-8";

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* General styles for the page */
html, body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 98%;
}

/* Main chat container */
.chat-container {
    position: relative;
    height: 100vh;
    width: 100vw;
    border: 1px solid #ccc;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Chat window */
.chat-window {
    height: 95vh;
    margin-top: 1vh;
    padding: 2vh;
    flex-grow: 1;
    overflow-y: auto;           /* Enable scrolling */
    border: 2px solid black;  /* Black border */
    border-radius: 5px;
}

/* Bubble alignment */
.message-left, .message-right {
    display: flex;
    margin-bottom: 10px;
}

.message-left {
    justify-content: flex-start; /* Align to the left */
}

.message-right {
    justify-content: flex-end; /* Align to the right */
}

/* Bubble styling */
.message-bubble {
    max-width: 60%;
    padding: 10px;
    border-radius: 10px;
    position: relative;
    background-color: #e5e5e5;
    font-size: 14px;
}

/* Triangle for chat bubbles */
.left-bubble::before, .right-bubble::before {
    content: "";
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

/* Triangle for the left bubble */
.left-bubble::before {
    border-width: 10px 10px 10px 0;
    border-color: transparent #e5e5e5 transparent transparent;
    left: -10px;
    top: 10px;
}

/* Triangle for the right bubble */
.right-bubble::before {
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent #dff0d8;
    right: -10px;
    top: 10px;
}

/* Background color for right bubbles */
.message-right .message-bubble {
    background-color: #dff0d8;
}

/* Button styles */
.feedback-buttons button {
    border: 2px solid black;
    background-color: white;
    border-radius: 5px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.feedback-buttons button:hover {
    background-color: #f0f0f0;      /* Change background on hover */
    transform: scale(1.1);             /* Slightly enlarge */
}

.feedback-buttons button:active {
    background-color: #e0e0e0;      /* Darken background on click */
    transform: scale(1.05);
}

/* Tooltip styling */
.feedback-buttons button::after {
    content: attr(data-tooltip);
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: black;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;         /* Initially hidden */
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
    z-index: 100;
}

.feedback-buttons button:hover::after {
    opacity: 1;         /* Show tooltip */
}

/* Chat input field */
.chat-input {
    display: flex;
    border-top: 1px solid #ccc;
}

.chat-input textarea {
    flex-grow: 1;
    height: 6vh;
    min-height: 6vh;
    padding: 1vh;
    border: none;
    outline: none;
    resize: none;
}

.chat-input button {
    margin-left: 2vh;
    margin-right: 10vw; /* Add margins and adjust to avoid overlapping with the hamburger menu. */
    height: 6vh;
    padding: 1vh;
    background-color: #0084ff;
    color: white;
    border: none;
    cursor: pointer;
}

.chat-input button:hover {
    background-color: #006bbf;   /* Change color on hover */
}

/* Disabled button styles */
button:disabled {
    background-color: #cccccc;  /* Gray background */
    color: #666666;
    cursor: not-allowed;
    opacity: 0.7;
}

.hamburger-menu {
    position: absolute;
    top: 93.5vh;
    right: 0.5vw;
    display: flex;
    flex-direction: column;
}

.hamburger-icon {
    position: absolute;
    top: 0px;
    right: 0px;
    font-size: 12px;
    height: 6vh;
    width: 9vw;
    padding: 3vw;
    cursor: pointer;
    background-color: #0084ff;
    color: white;
    border-radius: 5px;
}

.menu-items {
    position: relative;
    display: none;
    flex-direction: column;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-top: -40px;
}

.menu-items a {
    padding: 10px;
    text-decoration: none;
    color: #333;
}

.menu-items a:hover {
    background-color: #f4f4f4;
}

/* When the hamburger menu is active. */
.hamburger-menu.active .menu-items {
    display: flex;
}

/* Loading screen */
#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Loading spinner */
.spinner {
    border: 16px solid #f3f3f3;
    border-top: 16px solid #3498db;
    border-radius: 50%;
    width: 120px;
    height: 120px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* chat history reset modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100vw;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-content {
    background-color: white;
    padding: 2vh;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 90vw;
    text-align: center;
    position: relative;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.warning-icon {
    width: 40px;
    height: 40px;
    margin-right: 15px;
}

.modal-footer {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
}

.yes-button {
    background-color: #3b82f6;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    width: 100px;
}

.no-button {
    background-color: transparent;
    color: #3b82f6;
    padding: 10px 20px;
    border: 2px solid #3b82f6;
    border-radius: 5px;
    cursor: pointer;
    width: 100px;
}

.yes-button:hover, .no-button:hover {
    opacity: 0.8;
}

/* feedback diaglog */
.dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 90vw;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.dialog-header {
    display: flex;
    justify-content: left;
    align-items: center;
    margin-bottom: 15px;
}

.header-icon {
    font-size: 28px;
    margin-right: 5px;
}

.dialog-header .close-button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    position: absolute;
    top: 5px;
    right: 10px;
    z-index: 1000;
    padding: 5px;
}

.dialog-content {
    margin-left: 10px;
    margin-bottom: 15px;
}

.dialog-content textarea {
    width: 90%;
    height: 60px;
    resize: none;
    margin-top: 5px;
    margin-left: 15px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.dialog-footer {
    text-align: right;
}

.dialog-submit-button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
}

.dialog-submit-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}
