/* Modern chat layout support for chat.html */
.chat-main {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.chat-container {
    flex: 1 1 auto;
    padding: 20px 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
    max-height: calc(100vh - 80px - 80px); /* header + input-container */
}

.input-container {
    padding: 20px 30px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    min-height: 80px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media screen and (max-width: 800px) {
    .chat-container {
        padding: 15px 20px;
        max-height: calc(100vh - 70px - 70px);
    }
    .input-container {
        padding: 15px 20px;
        min-height: 70px;
    }
}
/* Legacy Chat Styles - Enhanced for Modern Theme */
body {
    background: linear-gradient(135deg, #0F0F23 0%, #1A1A2E 25%, #16213E 50%, #0F3460 75%, #533A7B 100%);
    margin: 0;
    padding: 0;
}

/* Default theme body override for chat page */
body:not(.theme-light):not(.theme-darkest) {
    background: linear-gradient(135deg, #0F0F23 0%, #1A1A2E 25%, #16213E 50%, #0F3460 75%, #533A7B 100%);
}

#title {
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
    font-size: 8.5vh;
    margin: 0 auto;
    margin-bottom: -1%;
    text-align: center;
    background: linear-gradient(135deg, #64b5f6, #90caf9);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
form {
    width: 100%;
}
.topnav {
    text-decoration: none;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Styling for all anchor elements EXCEPT navbar elements */
a:not(.navbar-brand):not(.account-button):not(.nav-button) {
    text-decoration: none;
    padding: 10px 20px; /* Button padding */
    border-radius: 30px; /* Button border radius */
    transition: background-color 0.3s ease; /* Add a smooth hover effect */
}
a:not(.navbar-brand):not(.account-button):not(.nav-button):hover {
    text-decoration: none;
    background-color: #121213; /* Change the background color on hover */
}

.topnav a:hover {
    text-decoration: none;
    background-color: #121212;
    color: black;
}

/* Add a color to the active/current link */
.topnav a.active {
    background-color: #22c287;
    color: white;
}
#chat-box {
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    display: flex;
    height: 54vh;
    width: 80%;
    padding: 20px;
    margin: 0 auto;
    overflow: hidden;
    white-space: pre-line;
    position: relative;
}

#chat-container {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow-y: scroll; /* Add the scrollbar to this container */
    height: 100%; /* Fill the available height within #chat-box */
    width: 100%;
}

#chat-container::-webkit-scrollbar {
    width: 13px;
    background:
        linear-gradient(to right, #3A91F5 20%, #2D63D0 100%) border-box;
    border: 5px solid transparent;
    border-radius: 30px;
}

#chat-container::-webkit-scrollbar-thumb {
    background:
        linear-gradient(to right, #E4EBFF 20%, #E5D9FF 100%) border-box;
    border: 5px solid transparent;
    border-radius: 30px;
    box-shadow: 0 0 6px #bfbfbf;
}

.user-message {
    justify-content: flex-start;
    text-align: left !important;
    align-items: flex-start;
    display: inline-flex;
    background: linear-gradient(135deg, #2E7DD0 0%, #1B4B9A 100%);
    color: white;
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    border-radius: 18px;
    border-bottom-right-radius: 6px;
    font-weight: 500;
    padding: 12px 18px;
    width: 80%;
    margin: 8px;
    white-space: pre-wrap;
}

.ai-message {
    align-self: flex-end;
    flex-direction: row;
    justify-content: flex-start;
    display: flex;
    text-align: left;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 18px;
    border-bottom-left-radius: 6px;
    height: auto;
    padding: 12px 18px;
    font-size: 18px;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    width: 80%;
    margin: 8px;
    white-space: pre-wrap;
}

.user-message img, .ai-message img {
    text-align: left;
    width: 3%;
    height: width;
    margin: 0 auto;
    margin-right: 5px;
}

textarea::-webkit-scrollbar {
    width: 1em;
    border-radius: 20px;
    margin-left: 20px;
}

textarea::-webkit-scrollbar-track {
    -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
    border-radius: 20px;
    margin-left: 20px;
}

textarea::-webkit-scrollbar-thumb {
  background-color: darkgrey;
  outline: 1px solid slategrey;
  border-radius: 20px;
  margin-left: 20px;
}

#container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 8px;
    width: 80%;
    margin: 8px auto;
}

#user-input {
    font-family: 'Quicksand', sans-serif;
    background:
        linear-gradient(#212529 0 0) padding-box,
        linear-gradient(to right, #9BAEF2 20%, #C1A7FF 100%) border-box;
    border: 4px solid transparent;
    border-radius: 30px;            
    font-weight: 500;
    font-size: 18px;
    color: antiquewhite;
    height: 25px;
    width: 70%; /* Reduce slightly to make room for footer */
    padding: 0.8%;
    margin: 10px;
    resize: none;
    overflow-y: auto;
}

#send-button {
    background:
        linear-gradient(to right, #A6BCFF 20%, #C2A6FF 100%) border-box;
    border: 5px solid transparent;
    border-radius: 30px;
    margin: 8px;
    padding: 0.3%;
    border-radius: 40px;
    width: 10.5vh;
}
#send-button:hover {
    cursor: pointer;
}

#send-button img {
    width: 37px;
    height: 37px;
    display: block;
    margin: 0 auto;
}
.footer {
    color: white;
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: 2.5vh;
    background: linear-gradient(to right, #1CE1FF 0%, #F2B4CE 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0.5;
    margin-left: 10px; /* Add some spacing */
}

#buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

.button-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.my-button, small {
    display: inline-flex;
    vertical-align: top;
}
.my-button {
    margin: 5px;
    margin-right: 8px;
    padding: 12px 20px;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 2.5vh;
    background: linear-gradient(135deg, #2E7DD0 0%, #1B4B9A 100%);
    transition: all 0.3s ease;
    cursor: pointer;
}

.my-button:hover {
    background: linear-gradient(135deg, #1565C0 0%, #0D47A1 100%);
    transform: translateY(-2px);
}

small {
    font-family: 'Poppins', sans-serif;
    color: white;
    font-weight: 590;
    font-size: 3.7vh;
    display: flex;
    justify-content: center;
    margin: 0 auto;
    background: linear-gradient(135deg, #64b5f6, #90caf9);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Math Question Styling */
#mathQuestion {
    font-family: 'Poppins', sans-serif;
    font-size: 6vh;
    text-decoration: none;
    margin: 0 auto 30px auto;
    text-align: center;
    background: linear-gradient(135deg, #64b5f6, #90caf9);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 100%;
    animation: gradient-shift 3s ease-in-out infinite;
    font-weight: 700;
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* The container <div> - needed to position the dropdown content */
.dropdown {
    position: relative;
    display: inline-block;
}

/* Dropdown Content (Hidden by Default) */
.dropdown-content {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 18px;
    display: none; 
    position: fixed; /* Change 'absolute' to 'fixed' */
    top: 35vh; /* Center vertically at 50% of the screen */
    left: 50%; /* Center horizontally at 50% of the screen */
    transform: translate(-50%, -50%); /* Center the content */
    background-color: #f1f1f1;
    min-width: 250px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    background:
        linear-gradient(to right, #72A9E9 20%, #4F89CB 100%) border-box;
    border: 5px solid transparent;
    border-radius: 30px;
}

/* Links inside the dropdown */
.dropdown-content a {
    color: black;
    border-radius: 30px;
    border: 5px solid transparent;
    padding:8px 16px;
    text-decoration: none;
    display: block;
}

/* Change color of dropdown links on hover */
.dropdown-content a:hover {background-color: #eeee}

/* Show the dropdown menu (use JS to add this class to the .dropdown-content container when the user clicks on the dropdown button) */
.show {display:block;}

@media screen and (max-width: 1200px) {
    #container {
        align-items: center; /* Center elements vertically */
    }
    #chat-box {
        height: 30vh;
    }
    #user-input {
        width: 60%;
        font-size: 2.2vh;
        height: 2.8vh;
    }
    #send-button {
        padding: 4px;
        width: 25%
    }
    #send-button img {
        width: 50%;
        height: 50%;
    }
    .ai-message, .user-message {
        width: 70%;
        margin: 2px;
        margin-bottom: 5px;
        font-size: 2.5vh;
    }
    .my-button {
        font-size: 2.5vh;
        padding: 1vh 1.8vh;
    }
    h1 {
        font-size: 6vh;
    }
    small {
        font-size: 3vh;
    }
    .dropdown-content {
        top: 40.5vh; /* Center vertically at 50% of the screen */
        font-size: 1.9vh;
        font-weight: 700;
        padding: 0.9vh;
    }
    
}   