/* Hide scrollbar but still allow scrolling */
::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

* {
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

* {
    padding: 0;
    margin: 0;
    color: white;
    font-family: "Poppins", sans-serif;
}

@keyframes fadeInn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body {
    opacity: 0; /* start hidden */
    animation: fadeInn 0.3s ease-out forwards;
    background-color: black;
}

.big {
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    height: 100vh;
}
.logo {
    display: block;
    width: 300px;
    height: 200px;
    margin-top: 120px; /* pulls it upward to overlap */
    transition:
        height 0.5s ease,
        width 0.5s ease,
        margin 0.5s ease;
    display: block;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 500; /* stays under navbar */
}

button {
    margin-bottom: 15px;
    margin-top: 20px;
    margin-left: 15px;
    padding: 1%;
    border-radius: 30px;
    border: none;
    background-color: #c1008e;
    color: rgb(255, 255, 255);
    width: 100px;
    height: 50px;
    transition: transform 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

textarea {
    width: 600px;
    height: 60px;
    border: 0px;
    border-radius: 30px;
    background-color: rgb(20, 20, 20);
    color: rgb(255, 255, 255);
    transition: transform 0.3s ease;
    display: flex;
    align-items: center; /* vertical center */
    justify-content: center;
    overflow: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    resize: none;
    box-sizing: border-box;
    padding-top: 18px;
    padding-left: 20px;
    padding-right: 20px;
    margin-bottom: 15px;
    margin-right: 15px;
    margin-top: 20px;
}
textarea::placeholder {
    color: rgb(172, 172, 172);
    text-align: center;
}

textarea:focus {
    outline: none;
    border: none;
}

button:hover {
    transform: scale(1.05);
}

button:active {
    background-color: #c1008e;
}

textarea:hover {
    transform: scale(1.05);
    background-color: white;
    color: black;
}

.greyarea {
    height: 48vh; /* fixed height */
    width: 80%; /* fixed width */
    display: flex;
    flex-direction: column; /* stack messages */
    align-items: flex-start; /* left align messages */
    overflow-y: auto; /* enable scrolling */
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none; /* no horizontal scroll */
    padding: 10px;
    box-sizing: border-box; /* padding included in size */
    border-radius: 10px; /* optional rounded edges */
    margin-bottom: 20px;
}

.tagline {
    justify-self: center;
    align-self: center;
    margin-top: auto;
    margin-bottom: 40vh;
    font-size: 30px;
    letter-spacing: 2x;
    font-weight: 30;
    color: rgb(134, 134, 134);
}

.userq {
    display: inline-block;
    padding: 15px;
    border-radius: 20px;
    margin: 15px;
    background-color: transparent;
    white-space: pre-line; /* preserves line breaks and multiple spaces */
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.2;
    opacity: 0;
    transform: translateY(-20px);
    transition:
        opacity 0.5s ease,
        transform 0.5s ease;
    max-width: 80%;
}

.userq.show {
    opacity: 1;
    transform: translateY(0);
}

.one {
    align-self: flex-end;
    background-color: rgb(39, 39, 39);
}
.two {
    background-color: blueviolet;
    padding: 15px;
}
.two h1,
h2,
h3,
strong,
pre,
code,
p,
ul,
li,
ol,
a,
em,
table,
td,
tr,
th,
thead,
thead,
tbody,
tfoot,
caption,
mjx-math,
mjx-container,
mjx-c {
    background-color: transparent;
}

.two ul,
.two ol {
    list-style-position: outside;
    padding-left: 1em; /* adjust as needed */
    margin: 0; /* remove default margins if you want tight spacing */
}

.loader {
    width: 100%; /* full width of container or adjust as needed */
    height: 4px; /* thin line */
    background-color: #252525; /* light grey background */
    position: relative;
    overflow: hidden;
    display: none; /* hide by default */
    margin: 10px 0; /* optional spacing above/below */
}

/* animated inner bar */
.loader::before {
    content: "";
    position: absolute;
    top: 0;
    left: -40%; /* start off-screen */
    height: 100%;
    width: 40%;
    background-color: #c1008e; /* accent/purple */
    animation: loading 1s linear infinite;
}

@keyframes loading {
    0% {
        left: -40%;
    }
    100% {
        left: 100%;
    }
}

.submitarea {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%; /* let it stretch full width */
    max-width: 800px; /* limit on large screens */
    margin: 0 auto; /* center horizontally */
    padding: 0 10px; /* small side padding */
    box-sizing: border-box;
}

.navbar {
    position: absolute;
    display: flex;
    justify-content: space-between; /* pushes items to far ends */
    align-items: center; /* vertical centering */
    position: absolute;
    top: 40px;
    left: 20px;
    right: 20px;
    z-index: 1000;
    background-color: transparent;
    padding: 0 20px; /* optional: adds breathing room on left/right */
}

.logoutbtn,
.controlbtn,
.allcoursesbtn,
.addusersbtn,
.deletebtn,
.analyticsbtn {
    background-color: transparent;
    color: #a1a1a1;
    border: none;
    cursor: pointer;
    margin: 0;
}

.logoutbtn:active,
.controlbtn:active,
.allcoursesbtn:active,
.addusersbtn:active,
.deletebtn:active,
.analyticsbtn:active {
    background-color: transparent;
    color: white;
}

.logoutbtn:hover,
.controlbtn:hover,
.allcoursesbtn:hover,
.addusersbtn:hover,
.deletebtn:hover,
.analyticsbtn:hover {
    background-color: transparent;
    color: white;
}
.control {
    justify-self: flex-start;
}

/* Container for options icon + dropdown */
.options-menu {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}
img.options-icon {
    margin: 0px;
}

/* Options icon */
.options-icon {
    width: 28px;
    height: 28px;
    cursor: pointer;
    color: #a1a1a1;
    transition: transform 0.2s ease;
}

.options-icon:hover {
    transform: scale(1.2);
}

/* Dropdown menu */
.dropdown {
    display: flex; /* always flex */
    flex-direction: column;
    justify-content: center;
    align-items: center;

    position: absolute;
    right: 0;
    top: 40px;
    background-color: #111;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    padding: 8px 0;
    min-width: 140px;
    z-index: 2000;

    /* Hidden state */
    visibility: hidden;
    opacity: 0;
    transform: translateY(-10px);

    /* Animation */
    transition:
        opacity 0.3s ease,
        transform 0.3s ease,
        visibility 0.3s ease;
}

/* Show state */
.dropdown.show {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

/* Buttons inside dropdown */
.dropdown button {
    background-color: transparent;
    border: none;
    color: #aaa;
    text-align: left;
    width: 80%;
    font-size: 14px;
    cursor: pointer;
    transition:
        transform 0.2s ease,
        color 0.2s ease;
}

.dropdown button:hover {
    transform: scale(1.1);
    color: #c1008e;
}

.two pre {
    background: #1e1e1e; /* dark block background */
    color: #f8f8f2; /* light text */
    padding: 12px 16px;
    border-radius: 8px;
    margin: 12px 0;
    overflow-x: auto; /* scroll horizontally if needed */
    font-size: 14px;
    line-height: 1.5;
}

.two code {
    font-family: "Fira Code", monospace;
    white-space: pre-wrap; /* preserve formatting */
    background: transparent; /* avoid double background */
    color: #c0c0c0; /* softer inline code */
}

#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none; /* hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

#popup {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    background: #111;
    color: #fff;
    padding: 20px;
    border-radius: 12px;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

#popup h2 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #c1008e;
}

#popup p {
    font-size: 14px;
    line-height: 1.4;
    color: #ddd;
    text-align: left;
}

#popup button {
    width: fit-content;
    margin-top: 15px;
    padding: 10px 20px;
    border: none;
    border-radius: 30px;
    background: #c1008e;
    color: #fff;
    cursor: pointer;
    transition:
        transform 0.2s ease,
        background 0.3s ease;
}

#popup button:hover {
    transform: scale(1.05);
    background: #a0006d;
}

/* --- Responsive Fixes --- */

/* Make textarea fluid */
textarea {
    width: 90%;
    max-width: 600px;
    min-height: 50px;
    height: auto;
}

/* Logo scaling */
.logo {
    max-width: 70%;
    height: auto;
}

/* Grey chat area */
.greyarea {
    width: 90%;
    max-width: 800px;
    height: 48vh;
}

@media (max-width: 768px) {
    /* Smaller tablets / landscape */
    .greyarea {
        height: 50vh;
    }
    textarea {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    /* Phones */
    body {
        font-size: 14px;
    }
    .logo {
        max-width: 60%;
        margin-top: 5vh;
    }
    .tagline {
        font-size: 20px;
        margin-bottom: 25vh;
    }
    .greyarea {
        height: 45vh;
        width: 95%;
    }
    textarea {
        width: 95%;
        font-size: 13px;
        padding: 12px 15px;
    }
    button {
        width: auto;
        min-width: 80px;
        height: 40px;
        font-size: 14px;
        padding: 0 12px;
    }
    .dropdown {
        min-width: 120px;
        right: 0;
    }
    #popup {
        max-width: 90%;
    }
}
.logo.shrink {
    max-width: 15%;
    height: auto;
    margin-top: 20px;
}
