/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body, html {
    height: 100%;
    width: 100%;
    overflow: hidden;
    background: #2c3e50;
}

/* Pop up message */
#popup {
    display: flex;
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    /* background: linear-gradient(to right, #F8E5C6, #D2D0D0); */
    background: rgb(225 223 225/ 80%);
    backdrop-filter: blur(6px);
    color: black;
    margin: 10px;
    padding: 15px;
    font-size: 15px;
    z-index: 1000;
    transition: opacity 0.5s ease;
    border-radius: 40px;
}

.popup-hidden {
    opacity: 0;
    pointer-events: none;
}

.popup-visible {
    opacity: 1;
    pointer-events: auto;
}

.popup-icon {
    width: 60%;
    align-content: center;
}

.profile-pic {
    width: 90%;
    margin-top: 8%;
}

.msg-header {
    display: flex;
    justify-content: space-between;
}

.msg-now {
    font-weight: lighter;
}

.message-name {
    text-align: left;
    font-weight: bold;
}

.msg-close-Btn {
    background: #E1DFE1;
    border: none;
    border-radius: 50%;
    box-shadow: 0 0 5px 1px gray;
    color: black;
    position: absolute;
    left: 0;
    top: 0;
    padding: 8px 3px 3px;
    cursor: pointer;
}

/* Cross in exit button */
.msg-close-Btn:after {
    font-size: 30px;
    line-height: 0;
    content: "\00d7";
}

.msg-close-Btn:hover {
    background: #C0BFC0;
}

/* Page layout */
.page-container {
    display: flex;
    width: 100%;
    height: 100%;
}

/* Chat area styles */
.chat-container {
    flex: 7;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Header */
.chat-header {
    display: flex;
    align-items: center;
    padding: 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.epa-logo {
    height: 60px;
    margin-top: -20px;
}

.chat-header h1 {
    text-align: center;
    flex: 1;
    color: white;
    font-size: 20px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.description {
    font-size: 13px;
    color: white;
}

/* Messages area */
.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 5px 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.5) transparent;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 3px;
}

.message {
    max-width: 70%;
    padding: 15px 20px;
    border-radius: 18px;
    position: relative;
    animation: messageAppear 0.3s ease-out forwards;
}

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

.user-message {
    align-self: flex-end;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border-bottom-right-radius: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.bot-message {
    align-self: flex-start;
    background: linear-gradient(to right, #4776E6, #8E54E9);
    color: white;
    border-bottom-left-radius: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.bot-message br + *:not(br) {
    margin-top: -0.5em;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 8px;
    display: block;
    text-align: right;
}

/* Input area */
.chat-input-container {
    margin-top: 20px;
    position: relative;
}

.chat-input {
    width: 100%;
    padding: 18px 60px 18px 25px;
    border-radius: 30px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 16px;
    outline: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.chat-input:focus {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    background: white;
}

.send-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(to right, #00c6ff, #0072ff);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0, 114, 255, 0.3);
}

.send-btn:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 114, 255, 0.4);
}

/* Typing indicator */
.typing-indicator {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.2);
    padding: 12px 20px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    margin-top: 10px;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    margin: 0 2px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    display: inline-block;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}

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

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

@keyframes typing {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0);
    }
}

/* Handout styles */
.handout {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0 15px 15px 15px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.5) transparent;
}

.handout::-webkit-scrollbar {
    width: 6px;
}

.handout::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 3px;
}

.handout h2 {
    color: white;
    font-size: 18px;
    border-top: solid rgba(255, 255, 255, 0.8);
    border-bottom: solid rgba(255, 255, 255, 0.8);
    padding: 15px 15px;
}

.handout-grid {
    flex-direction: column;
    gap: 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.5) transparent;
    padding-left: 10px;
    padding-right: 10px;
    display: flex;
}

.handout-cell {
}

.handout-cell h2 {
    display: flex;
    align-items: center;
}

/* Chevron Toggle Styles*/
/*
.handout-cell h2:hover {
    cursor: pointer;
}
*/

.chevron {
    display: inline-block;
    font-size: 60px;
    font-weight: lighter;
    line-height: 0;
    margin-right: 10px;
    margin-bottom: 13px;
}

.chevron.rotate {
    transform: rotate(90deg);
    margin-top: 10px;
}

.handout-cell p {
    max-height: 0;
    font-size: 16px;
    color: white;
    margin: 5px;
    pointer-events: none;
    opacity: 0;
}

.handout-cell p.show {
    max-height: 100vh;
    pointer-events: unset;
    opacity: unset;
}

/* Sidebar styles */
.sidebar-container {
    flex: 3;
    overflow-y: auto;
    min-height: unset !important;
    padding: 10px 20px 20px 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-container h2 {
    color: white;
    font-size: 16px;
    text-align: center;
    border-top: solid rgba(255, 255, 255, 0.8);
    border-bottom: solid rgba(255, 255, 255, 0.8);
    padding: 7px 5px;
    margin-bottom: 5px;
}

.sidebar-content {
    display: flex;
    height: auto;
    min-height: fit-content;
    gap: 10px;
    padding: 15px 0;
}

.exit-container {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.exit-container p {
    color: white;
    font-size: 16px;
    line-height: 1.4;
    text-align: center;
}

.opt-out-label {
    color: white;
}

.opt-out-container {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.opt-out-container p {
    margin-bottom: 0;
}

.exit-btn {
    background: #014076;
    color: white;
    border: none;
    padding: 8px 20px 10px 20px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
    border-radius: 3px;
    font-family: Poppins, Arial, sans-serif;
    font-size: 16px;
    text-align: center;
}

.exit-btn:hover {
    background: #01325d;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.exit-btn:active {
    background: #00172a;
}

.exit-btn:focus {
    background: #015ba9;
}

.exit-choice-btn {
    background: #014076;
    color: white;
    border: none;
    padding: 8px 20px 10px 20px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
    border-radius: 3px;
    font-family: Poppins, Arial, sans-serif;
    font-size: 16px;
    text-align: center;
}

.exit-choice-btn:hover {
    background: #01325d;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.exit-choice-btn:active {
    background: #00172a;
}

.exit-choice-btn:focus {
    background: #015ba9;
}

.revoke-btn {
    margin-bottom: 20px;
}

/* End Screen */
.end-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
}

.end-screen h1 {
    margin-bottom: 30px;
}

.debrief {
    font-size: 25px;
}

.id-container {
    font-size: 25px;
}

.record-container {
    display: flex;
}

.generic-btn {
    background: #014076;
    color: white;
    border: none;
    padding: 8px 20px 10px 20px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
    border-radius: 3px;
    font-family: Poppins, Arial, sans-serif;
    font-size: 16px;
    text-align: center;
}

.generic-btn:hover {
    background: #01325d;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.generic-btn:active {
    background: #00172a;
}

.generic-btn:focus {
    background: #015ba9;
}

/* Admin Screen */
.overview-screen {
    height: 100%;
    padding: 2% 3%;
    overflow-y: auto;
    color: white;
}

.overview-screen h1 {
    margin-bottom: 30px;
}

.exp-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.exp-name-div {
    display: none;
    gap: 10px;
}

.exp-name-div-show {
    display: flex;
}

.mng-exp-div {
    display: flex;
    gap: 10px;
}

.grp-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.current-entry {
    background-color: #00172a;
}

.grp-nav-entry {
    background-color: gray;
}

.mng-grp-div {
    display: flex;
    gap: 10px;
}

.idlist-entry {
    margin-bottom: 10px;
}

.idlist-grp {
    margin: 0 5px 0 5px;
    background-color: black;
}

.overview-btn {
    margin: 0 5px;
}

/* Creation Form */
.creation-form {
    margin-top: 20px;
}

.form-input {
    margin: 0 15px 0 5px;
}

.white-anchor {
    color: currentColor;
}

/* Responsive */
@media (min-width: 700px) {
    #popup {
        left: unset;
        margin: 15px;
        width: 50%;
    }
}

/* Locked Page */
.exit-container span {
    color: white;
}

@media (min-width: 1080px) {
    #popup {
        width: 40%;
    }
}

@media (min-width: 1200px) {
    #popup {
        left: unset;
        margin: 20px;
        width: 25%;
        font-size: 16px;
    }

    .popup-icon {
        width: 30%;
    }

    .profile-pic {
        width: 80%;
    }

    .chat-container {
        padding: 20px;
    }

    .chat-messages {
        padding: 15px;
        gap: 20px;
    }

    .chat-header h1 {
        font-size: 28px;
    }

    .description {
        margin-bottom: 20px;
        font-size: 16px;
    }

    .handout {
        padding-top: 15px;
    }

    .handout h2 {
        margin-left: 20px;
        margin-right: 20px;
    }

    .handout-grid {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .handout-cell {
        width: 48%;
    }

    .handout-cell p {
        font-size: 18px;
        margin: 15px;
    }

    .sidebar-container {
        padding: 50px 20px 20px 20px;
    }

    .sidebar-container h2 {
        font-size: 18px;
        padding: 15px 15px;
        margin-bottom: 20px;
    }

    .opt-out-container p {
        margin-bottom: 0;
    }

    .exit-container p {
        font-size: 18px;
        line-height: 1.6;
    }
}