/* Define main UI colors */
:root {
  --main-color: #7aaed1f7;
  --main-color-sat: #2a8ed0f7;
  --main-color-dark: #2b4657c0;
  --accent-color: rgb(178, 90, 19);
  --menu-text: #ececec;   /* Off-white for menu items */
  --main-black: rgb(0, 0, 0);
  --bg-trans: rgba(0, 0, 0, 0.193); /* Black with more transparency */
  --bg-trans-dark: rgba(0, 0, 0, 0.6); /* Black with more transparency */
  --bg-trans-hover: rgba(96, 96, 96, 0.6);
}

body {
    font-family: Arial, sans-serif;
    background-color: rgb(0, 0, 0);
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100%;
    overflow-x: hidden;
    position: relative;
}

/* iOS-specific body fixes */
html.ios {
    height: 100%;
    overflow: hidden;
}

html.ios body {
    height: 100%;
    position: fixed;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
    width: 100vw;
}

/* Login UI */
#login-form {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}
#login-form input {
    flex-grow: 1;
    padding: 5px;
    color: rgb(225, 225, 225);
    border: 1px solid var(--main-color);
    border-radius: 1px;
    background-color: rgba(0, 0, 0, 0.2);
}
#login-form button {
    background-color: rgb(140, 72, 14);
    color: rgb(246, 246, 246);
    border: none;
    border-radius: 1px;
    padding: 5px 10px;
    cursor: pointer;
}
#login-form.hidden {
    display: none;
}
#landing-page.hidden {
    display: none;
}
.hidden {
    display: none;
}
/* Text */
h1 {
    position: absolute;
    color: rgba(145, 155, 161, 0.9);
    font-size: 30px; 
    font-family: 'Bruno Ace SC', cursive;
    font-weight: bold;
    padding: 6px;
    margin: 1px;
    top: 26%;  /* adjust as needed */
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}
h2 {
    color: rgba(145, 155, 161, 0.9);
    font-size: 16px; 
    font-family: 'Bruno Ace SC', cursive;
    font-weight: bold;
    padding: 4px;
}
/* chat message */
.message {
    font-family: Arial, sans-serif !important;
    font-size: 16px !important;
    line-height: 1.1 !important;
    margin: 8px 0;
    padding: 10px 12px;
    border-radius: 16px;
    max-width: 80%;
    position: relative;
    clear: both;
}

/* Message container styles with animations */
.message.traveler-message {
    float: right;
    background-color: var(--main-color-sat);
    color: var(--menu-text);
    margin-left: auto;
    border-bottom-right-radius: 2px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    animation: message-appear-right 0.4s ease-out;
}

.message.psimichael-message {
    float: left;
    background-color: var(--main-color-dark);
    color: var(--menu-text);
    margin-right: auto;
    border-bottom-left-radius: 2px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    animation: message-appear-left 0.4s ease-out;
}

@keyframes message-appear-right {
    from {
        transform: translateX(20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes message-appear-left {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Hide the sender name from within the bubble */
.message .sender-name {
    display: none;
}

/* Fix for cleared floats */
#chat-container::after {
    content: "";
    display: table;
    clear: both;
}

/* System messages should be centered */
.message.system-message {
    float: none;
    margin: 8px auto;
    background-color: rgba(29, 122, 124, 0.05);
    color: rgba(150, 150, 150, 0.8);
    font-style: italic;
    padding: 5px 8px;
    font-size: 0.9em;
    transition: opacity 0.5s ease;
    text-align: center;
}

.sender-name.traveler {
    color: var(--main-color);
    font-weight: bold;
}
.sender-name.psimichael {
    color: var(--accent-color);
    font-weight: bold;
}
#draggable-container {
    position: absolute;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    right: 20px;
    bottom: 20px;
    width: 400px;
    height: auto;
    max-height: calc(100vh - 100px);
}
#container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100vw !important;
    height: 100vh;
}
#app {
    position: relative;
    margin: 4px;
    margin-left: 0;
    background-color: rgba(255, 255, 255, 0.08);
    padding: 10px;
    border-radius: 4px;
    width: 90vw !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--main-color-dark);
}
#chat-container {
    border: 1px solid var(--main-color) !important;
    user-select: text;
    background-color: var(--main-black);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 2px;
    height: 260px;
    max-height: 260px;
    resize: none;
    padding: 10px 15px;
    overflow-y: scroll;
    margin-bottom: 10px;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Ensure proper spacing for the last message */
#chat-container::after {
    content: "";
    display: block;
    height: 8px;
}

#chat-form {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1em;
}
#chat-form button {
    background-color: var(--bg-trans);
    color: var(--menu-text);
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    margin-left: 5px
}
#send-button:hover {
    background-color: var(--bg-trans-hover);
}
#user-input {
    flex-grow: 1;
    padding: 5px;
    color: var(--menu-text);
    border: 1px solid var(--main-color-dark);
    border-radius: 3px;
    background-color: var(--bg-trans);
    margin-right: 0px
}
/* Generated image */
#image-box {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* background-size: 100% auto; */
    background-size: cover;
    transition-property: opacity;
    transition-duration: 5s;
    transition-timing-function: ease;
    background-repeat: no-repeat;
    background-position: top center !important;
    z-index: -1;
    transform-origin: center center;
    will-change: transform; /* Hint to browser to optimize transform performance */
}
#image-box.animate-zoom {
    animation: subtle-zoom 15s cubic-bezier(0.33, 0, 0.67, 1) forwards !important;
    /* Ensure animation overrides any inline transform by using !important */
    transform: scale(1.1) !important;
    animation-fill-mode: forwards !important;
}
@keyframes subtle-zoom {
    0% { transform: scale(1.1); }
    100% { transform: scale(1.5); }
}

/* Different fade speeds */
#image-box.fade-off {
    transition-duration: 0s !important; /* No transition */
}

#image-box.fade-slow {
    transition-duration: 6s; /* Doubled from 3s to 6s */
}

#image-box.fade-fast {
    transition-duration: 1.5s; /* Doubled from 0.7s to 1.5s */
}

#image-box.fade-default {
    transition-duration: 3s; /* Doubled from 1.5s to 3s */
}

/* New ultra-slow fade */
#image-box.fade-ultra-slow {
    transition-duration: 10s; /* New ultra-slow fade effect */
}

/* UI button elements */
#download-image-button {
    background-color: var(--bg-trans);
    color: var(--menu-text);
    text-align: left;
    padding: 6px 12px;
    border: 1px solid var(--main-color);
    border-radius: 2px;
    position: relative;
    top: 50px;
    width: 116px !important;
    transform: rotate(-90deg);
    transform-origin: center;
    font-size: 13px !important;
}

#generate-new-image-button {
    background-color: var(--bg-trans);
    color: var(--menu-text);
    text-align: left;
    padding: 6px 12px;
    border: 1px solid var(--main-color);
    border-radius: 2px;
    position: relative;
    top: 50px;
    width: 116px !important;
    transform: rotate(-90deg);
    transform-origin: center;
    font-size: 13px !important;
}

#generate-pdf-button {
    background-color: var(--bg-trans);
    color: var(--menu-text);
    text-align: left;
    padding: 6px 12px;
    border: 1px solid var(--main-color);
    border-radius: 2px;
    position: relative;
    top: 50px;
    width: 116px !important;
    transform: rotate(-90deg);
    transform-origin: center;
    font-size: 13px !important;
}

#generate-pdf-button,
#generate-new-image-button,
#download-image-button {
  position: static; /* Keep as static */
  transform: none;
  margin: 0 5px;
  padding: 5px 10px;
  background-color: rgba(0, 0, 0, 0.5);
  color: var(--menu-text);
  border: 1px solid var(--main-color);
  border-radius: 2px;
  font-size: 13px !important;
  min-width: 120px;
  width: auto !important;
  display: none !important; /* Hide by default */
}

/* Override the display property only when .hidden class is removed */
#generate-pdf-button:not(.hidden),
#generate-new-image-button:not(.hidden),
#download-image-button:not(.hidden) {
  display: flex !important;
}

#generate-pdf-button:hover,
#generate-new-image-button:hover,
#download-image-button:hover {
    background-color: var(--bg-trans-hover);
}

/* This affects the Generate PDF, Generate New Image, and Download Image buttons */
.navbar-buttons {
    display: flex !important;
    position: absolute;
    top: 11px; /* Vertically center in the navbar */
    right: 30px; /* Position from right edge */
    width: auto;
    justify-content: flex-end;
}

/* Landing Page Elements */
.landing-content-imagebox {
    width: 100%;
    height: 100vh;
    position: absolute;
    background-size: cover;
    background-position: center center;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: -2;
    transition: background-position 4s ease;
    transform-origin: center center;
    animation: landing-zoom 30s cubic-bezier(0.33, 0, 0.67, 1) forwards;
}

/* Animation for Landing Page */
@keyframes landing-zoom {
    0% { transform: scale(1.1); }
    100% { transform: scale(1.5); }
}

.landing-content-imagebox:hover {
    background-position: center bottom;
}

.landing-image img {
    max-width: 100%;
}
.landing-title{
    font-weight: normal !important;
    font-size: 40px !important;
    letter-spacing: 0.05em !important;
    color: var(--main-color) !important;
    position: absolute;
    top: 75%; /* Moved down from 45% to 65% */
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    white-space: nowrap; /* Keep the text on one line */
    background-color: rgba(0, 0, 0, 0.4); /* Semi-transparent background */
    padding: 7px 14px 12px 14px; /* Adjust top/bottom padding to center text better */
    border-radius: 2px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    border: 1px solid rgba(79, 186, 186, 0.3); /* Using actual teal color similar to var(--main-color) */
    animation: glow 3s infinite ease-in-out;
    display: flex; /* Use flexbox for better text centering */
    align-items: center; /* Center text vertically */
    justify-content: center; /* Center text horizontally */
    line-height: 0.9; /* Lower line height to adjust vertical position */
    height: 46px; /* Set explicit height */
    box-sizing: border-box; /* Include padding in height calculation */
    cursor: pointer; /* Show pointer cursor on hover */
    transition: all 0.2s ease; /* Smooth transition for hover effects */
}

.landing-title:hover {
    background-color: var(--bg-trans-hover) !important;
    border-color: var(--main-color) !important;
    box-shadow: 0 0 25px rgba(79, 186, 186, 0.5);
    transform: translate(-50%, -52%) !important; /* Ensure transform overrides the base one */
}

/* Glow animation for the landing title */
@keyframes glow {
    0% { box-shadow: 0 0 10px rgba(0, 0, 0, 0.5), 0 0 5px rgba(79, 186, 186, 0.1); }
    50% { box-shadow: 0 0 15px rgba(0, 0, 0, 0.5), 0 0 10px rgba(79, 186, 186, 0.4); }
    100% { box-shadow: 0 0 10px rgba(0, 0, 0, 0.5), 0 0 5px rgba(79, 186, 186, 0.1); }
}

/* Blinking cursor for landing page title */
.landing-title::after {
    content: "_";
    animation: cursor-blink 1s infinite;
    display: inline-block;
    opacity: 0;
    margin-left: 2px; /* Add a small space between text and cursor */
    position: relative;
    top: -3px; /* Adjust vertical position of cursor for better alignment */
}

/* Define cursor-blink animation if not already defined elsewhere */
@keyframes cursor-blink {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

#main-content {
    position: relative;
    height: 1000px; 
}
.container-fluid {
    position: relative;
}
#wrapper {
    position: relative;
}
#sidebar-wrapper {
    width: 300px;
    height: 100vh;
    position: fixed;
    /* background-color: var(--bg-trans-dark) !important; */
    border: none;
    border-right: 1px solid var(--main-color-dark) !important;
    color: white; 
    transition: transform 0.3s ease;
    z-index: 1000;
    left: 0; 
    top: 0; 
}
.sidebar-heading {
    color: var(--main-color);
    font-family: 'Bruno Ace SC', cursive;
    background-color: var(--main-black) !important;
    padding: 14px;
    font-size: 28px;
    text-align: left;
}
.sidebar-divider {
    margin-top: 0.1rem;
    margin-bottom: 1rem;
}
/* .username-display {
    color: var(--main-color) !important;  
    font-size: 16px !important;
    font-weight: normal !important;
} */
.explore-elysium {
    color: var(--menu-text) !important;
    font-size: 16px !important;
    font-weight: normal;
}
.explore-elysium:hover {
    color: var(--menu-text) !important;
    background-color: var(--bg-trans-hover) !important;
}
#main-content {
    margin-left: 300px;
    transition: margin-left 0.3s ease;
}
#wrapper.toggled #sidebar-wrapper {
    transform: translateX(-300px);
}
#wrapper.toggled #main-content {
    margin-left: 0;
}
#wrapper.toggled #menu-toggle {
    left: 12px;
}
.list-group-item {
    color: var(--menu-text);
    font-size: 16px !important;
    font-weight: normal;
    /* background-color: transparent !important; */
    /* background-color: var(--main-color) !important; */
    border-color: rgba(0,0,0,0.2);
}
a.bg-light:focus, a.bg-light:hover, button.bg-light:focus, button.bg-light:hover {
    background-color: var(--bg-trans-hover) !important;
}
.list-group-item:hover {
    color: var(--menu-text) !important;
    background-color: var(--bg-trans-hover) !important;
    border-color: var(--main-color-dark);
}
.bg-light {
    background-color: rgb(0, 0, 0) !important; 
}
.text-dark {
    color: #c3c2c2!important;
    font-size: 18px;
}
.footer {
    position: absolute;
    color: #b7b7b7; /* color of the text */
    background-color: #212121 !important;
    font-size: 12px !important;
    bottom: 0;
    width: 100%;
    height: 60px; /* Set the height of your footer */
    line-height: 60px; /* Vertically center the text */
    text-align: center;
}

#menu-toggle {
    position: fixed;
    background-color: var(--bg-trans-dark) !important;
    border: 1px solid var(--main-color);
    border-radius: 2px;
    top: 4px;
    left: 246px; /* change to match the sidebar width */
    z-index: 1001; /* set this value higher than sidebar */
    padding: 2px; /* Reduced from 2px */
    width: 42px; /* Added explicit width */
    height: 42px; /* Added explicit height */
    box-shadow: 0 0 8px rgba(21, 78, 82, 0.3);
}

.menu-icon {
    filter: invert(.8);
    /* filter: invert(0.7) sepia(1) saturate(1) hue-rotate(140deg); */
    width: 36px;
    height: 36px;
    transform: scale(0.7);
}

#menu-toggle:hover {
    background-color: var(--bg-trans-hover)!important;
    /* border-color: var(--main-color); */
    box-shadow: 0 0 12px rgba(29, 122, 124, 0.5);
}

.logo-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0px;
    background-color: var(--bg-trans-dark);
    border: 1px solid var(--main-color);
    border-radius: 2px;
    width: 34px;
    height: 34px;
    overflow: hidden;
}
.logo-wrapper:hover {
    /* box-shadow: 0 0 12px rgba(29, 122, 124, 0.5); */
    background-color: var(--bg-trans-hover);

}

.sidebar-logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    /* width: 100%;
    height: 100%; */
}

.sidebar-logo-link img {
    max-width: 90%; /* Make logo image smaller */
    max-height: 90%;
    object-fit: contain; /* Ensure image maintains proportions */
    object-position: center; /* Center the image */
}

.sidebar-logo-container {
    z-index: 50;
    /* background-color: #000000; */
    height: 2.5rem;
    width: 2.5rem;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center !important;
    transform: scale(1.2) !important;
    margin: 6px 5px 5px 12px !important;
    text-align: center;
    /* box-shadow: none; */
    overflow: hidden;
}

@media (max-width: 576px) {
    /* REVISED: Top row buttons for mobile - centered layout */
    .navbar {
        padding: 0.5rem 0;
    }
    /* affect three top buttons: Gen PDF... */
    .navbar-buttons {
        display: flex !important;
        position: absolute;
        top: 11px;
        right: 0;
        width: 100%;
        justify-content: flex-end;
        padding-right: 6px;
    }

    /* Force items to stay in a row */
    .navbar-buttons .navbar-nav {
        flex-direction: row !important;
    }
    
    .navbar-buttons .nav-item {
        margin: 0 2px;
    }
    
    #generate-pdf-button,
    #generate-new-image-button,
    #download-image-button {
        padding: 6px 8px;
        font-size: 11px !important;
        min-width: 50px;
    }

    .landing-content-imagebox {
        transition: background-position 4s ease;
        top: 30%; 
        height: 30%;
        right: 32px;
    }
    .sidebar-logo-container {
        transform: scale(.9) !important;
    }
    .logo-wrapper {
        top: 1px;
        width: 32px; /* Slightly smaller on mobile */
        height: 32px; /* Slightly smaller on mobile */
        justify-content: center;
    }
    #menu-toggle {
        top: 11px;
        padding: 2px; /* Reduced from 2px */
        width: 30px; /* Added explicit width */
        height: 30px; /* Added explicit height */
    }
    .menu-icon {
        transform: scale(0.5);
    }
    
    .sidebar-logo-container {
        display: flex;
        justify-content: center !important;
        align-items: center;
    }
    
    .sidebar-logo-link {
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .sidebar-logo-link img {
        max-width: 85%; /* Slightly smaller on mobile */
        max-height: 85%;
    }
}

@media (max-width: 1080px) {
    #sidebar-wrapper {
        transform: translateX(-100%);
        transition: transform 0.3s ease-out;
    }
    #menu-toggle {
        left: 12px;
    }
}

@media (max-width: 576px) {
    h1 {
        position: absolute;
        margin: 2px;
        font-size: 20px; 
        white-space: nowrap;
    }
    
    /* Make landing page title smaller on mobile */
    .landing-title {
        font-size: 24px !important;
        letter-spacing: 0.03em !important;
        top: 70%; /* Adjusted for mobile */
        padding: 4px 10px 6px 10px; /* Adjusted padding for mobile */
        height: 36px; /* Smaller height for mobile */
        line-height: 0.9; /* Maintain the line height ratio */
    }
    
    /* Adjust cursor position for mobile */
    .landing-title::after {
        top: -2px;
    }
    
    /* Center the chat window on mobile */
    #draggable-container {
        position: fixed !important;
        width: 100% !important;
        height: auto !important;
        bottom: 20px !important;
        left: 0 !important;
        right: 0 !important;
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 999 !important; /* Higher z-index to ensure visibility */
        transform: translateY(0) !important;
        transition: none !important;
        will-change: transform;
        -webkit-transform: translateZ(0); /* Hardware acceleration for iOS */
        -webkit-backface-visibility: hidden; /* Prevent artifacts */
        -webkit-perspective: 1000; /* Better performance on iOS */
        backface-visibility: hidden;
        perspective: 1000;
    }
    
    body.modal-open #draggable-container,
    html.ios #draggable-container,
    html.touch #draggable-container {
        position: fixed !important;
        bottom: 20px !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    #app {
        width: 100% !important;
        margin: 0 !important;
        max-width: 450px !important;
    }

    #wrapper.toggled #sidebar-wrapper {
        transform: translateX(0);
    }
    #wrapper.toggled #page-content-wrapper {
        margin-left: 300px;
    }
 
    #wrapper.toggled #menu-toggle {
        left: 224px;
    }

    .landing-content-imagebox {
        transition: background-position 4s ease;
        top: 30%; 
        height: 30%;
        right: 32px;
    }
}

/* For tablets and small laptops */
@media (min-width: 575px) and (max-width: 1080px) {
    .landing-title {
        font-size: 28px !important;
    }
    
    /* Add these rules to properly handle the sidebar toggle in tablet view */
    #wrapper.toggled #sidebar-wrapper {
        transform: translateX(0);
    }
    
    #wrapper.toggled #menu-toggle {
        left: 224px;
    }
}

/* Mission section styling */
.mission-content {
    font-size: 0.75rem;
    line-height: 1.4;
    color: rgba(200, 200, 200, 0.9) !important;
}

#mission-text {
    margin-bottom: 12px;
    padding: 8px;
    border-left: 2px solid #1d7a7c;
    background-color: rgba(29, 122, 124, 0.1);
}

.mission-controls {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.mission-controls .btn {
    background-color: rgba(29, 122, 124, 0.2);
    color: #1d7a7c;
    border: 1px solid #1d7a7c;
    font-size: 0.7rem;
    transition: all 0.2s ease;
}

.mission-controls .btn:hover {
    background-color: var(--bg-trans-hover);
    color: #22a5a8;
    box-shadow: 0 0 5px rgba(29, 122, 124, 0.5);
}

#reroll-mission {
    flex: 1;
    margin-right: 5px;
}

#accept-mission {
    flex: 1;
    margin-left: 5px;
}

/* Chat header and icons - completely revised rules */
.chat-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between; /* Change to space-between to push icons right */
    margin-bottom: 10px;
    padding-bottom: 8px;
    /* border-bottom removed */
}

/* Toggle icon styling */
.toggle-icon {
    position: relative;
    transition: all 0.2s ease;
}

.toggle-icon.active {
    background-color: var(--main-color);
}

.toggle-icon.active i {
    color: var(--main-color) !important;
}

.toggle-icon::after {
    content: "";
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: transparent;
    bottom: 1px;
    right: 1px;
    transition: all 0.2s ease;
}

.toggle-icon.active::after {
    background-color: #22a5a8;
}

.system-message {
    font-style: italic;
    color: rgba(150, 150, 150, 0.8);
    background-color: rgba(29, 122, 124, 0.05);
    padding: 5px 8px;
    border-radius: 3px;
    margin: 5px 0;
    font-size: 0.9em;
    transition: opacity 0.5s ease;
}

/* Resize handle at the top of the app */
.resize-handle {
    position: absolute;
    top: 0; /* Position at the very top */
    left: 0;
    right: 0;
    height: 6px;
    cursor: ns-resize;
    background-color: var(--main-color-dark);
    opacity: 0.2;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    z-index: 110; /* Make sure it's above other elements */
    transition: opacity 0.2s ease;
}

.resize-handle:hover {
    opacity: 0.6;
    background-color: var(--main-color);
    box-shadow: 0 0 4px rgba(29, 122, 124, 0.5);
}

/* Sidebar menu items: default off-white text, transparent black background */
.list-group-item.bg-light {
    background-color: transparent !important;
    color: var(--menu-text);
    border-color: rgba(29, 122, 124, 0.3);
    font-size: 0.8rem;
    padding: 0.6rem 1.25rem;
    transition: all 0.2s ease;
}
.list-group-item.bg-light:hover {
    background-color: var(--bg-trans-hover) !important;
    color: var(--menu-text) !important;
    border-color: var(--main-color-dark);
}

/* #sidebar-wrapper,  */
.sidebar-heading, .main-footer {
  background-color: var(--main-black) !important;
}

/* Off-white text for collapsed sections and their lists */
.py-2.px-4.bg-light.text-dark {
  color: var(--menu-text) !important;
  background-color: var(--bg-trans) !important;
}

/* Override any residual teal references */
.sidebar-heading,
.nav-icon-item.active i,
.mission-controls .btn,
/* .username-display, */
.chat-nav-icons .nav-icon-item.active,
.chat-nav-icons .nav-icon-item.active i {
  color: var(--main-color) !important;
}

/* Chat header title uses main color */
.chat-header h2,
.chat-header {
  color: var(--menu-text) !important;
}
.chat-header h2 {
  color: var(--main-color) !important;
}

/* Ensure all backgrounds use transparent black */
.bg-light,
#sidebar-wrapper .list-group-item,
#chat-container,
#app {
  background-color: var(--bg-trans-dark) !important;
}

#username-display.list-group-item {
    color: var(--main-color) !important;
    font-weight: normal !important;
    cursor: default;
}

/* Username display should not change background on hover since it's not clickable */
#username-display.list-group-item:hover {
    background-color: transparent !important;
    color: var(--main-color) !important;
    border-color: rgba(0,0,0,0.2);
}

/* Ensure "Explore Elysium" uses our standard styling */
#launch-session-button.explore-elysium,
.explore-elysium {
    color: var(--menu-text) !important;
    font-size: 16px !important;
    font-weight: normal;
}

#launch-session-button.explore-elysium:hover,
.explore-elysium:hover {
    color: var(--menu-text) !important;
    background-color: var(--bg-trans-hover) !important;
}

/* Override any residual teal references and ensure consistent styling */
.sidebar-heading,
.nav-icon-item.active i,
.mission-controls .btn,
/* .username-display, */
.chat-nav-icons .nav-icon-item.active,
.chat-nav-icons .nav-icon-item.active i {
    color: var(--main-color) !important;

}

/* Add styles to properly render the spinner in the accept mission button */
.mission-controls .btn .spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
    vertical-align: middle;
    display: inline-block;
}

/* Ensure the accept mission button has proper sizing to fit the spinner */
#accept-mission {
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ensuring the spinner is visible in the mission accept button */
.spinner-border-sm {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    vertical-align: text-bottom;
    border: 0.15em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border .75s linear infinite;
    margin-right: 5px;
}

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

/* Ensure the accept mission button has enough space and proper styling */
#accept-mission {
    min-height: 30px;
    min-width: 80px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(29, 122, 124, 0.2);
    transition: all 0.2s ease;
}

#accept-mission:hover {
    background-color: var(--bg-trans-hover);
}

#accept-mission .spinner-border-sm {
    color: var(--main-color);
}

/* Hide the footer inside the sidebar */
#sidebar-wrapper .footer {
    display: none;
}

/* Remove this rule that's hiding your navbar */
.navbar.navbar-expand-sm {
  display: block; /* Change from none to block */
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1000;
}

#sidebar-wrapper {
    border-right: 1px solid var(--main-color-dark);
}
        
/* The main elysium system title with black background */
#sidebar-wrapper .sidebar-heading {
    color: var(--main-color) !important;
    background-color: var(--main-black) !important;
    letter-spacing: 2px;
    font-size: 1.1rem;
    text-transform: uppercase;
    padding: 15px 10px;
    position: relative;
    text-align: left;
    border-top: 1px solid var(--main-color-dark);
    /* box-shadow: 0 0 5px rgba(29, 122, 124, 0.5); */
}
        
/* Add decorative elements to the title */
#sidebar-wrapper .sidebar-heading::before {
    content: "⟨⌘⟩";
    font-size: 0.6rem;
    position: absolute;
    top: 5px;
    left: 10px;
    color: var(--main-color);
    opacity: 0.7;
}

#sidebar-wrapper .sidebar-heading::after {
    content: "//sys.01";
    font-size: 0.6rem;
    position: absolute;
    bottom: 3px;
    right: 10px;
    color: var(--main-color);
    opacity: 0.7;
}

/* Menu items */
.list-group-item.bg-light {
    background-color: transparent !important;
    color: var(--menu-text);
    border-color: rgba(29, 122, 124, 0.3);
    font-size: 0.8rem;
    padding: 0.6rem 1.25rem;
    transition: all 0.2s ease;
}

.list-group-item.bg-light:hover {
    background-color: var(--bg-trans-hover) !important;
    color: var(--menu-text) !important;
    border-color: var(--main-color-dark);
}

/* Dropdown content */
#collapseAbout .bg-light,
#collapseGuide .bg-light,
#collapseUI .bg-light,
#collapseSuggestions .bg-light {
    background-color: rgba(0, 0, 0, 0.8) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0.8rem;
    font-size: 0.75rem;
    line-height: 1.4;
    border-left: 1px solid var(--main-color-dark);
}

.py-2.px-4.bg-light.text-dark {
    color: rgba(200, 200, 200, 0.8) !important;
    background-color: rgba(0, 0, 0, 0.7) !important;
}

/* Lists in sidebar */
.py-2.px-4.bg-light.text-dark ul {
    padding-left: 1rem;
}

.py-2.px-4.bg-light.text-dark li {
    margin-bottom: 0.3rem;
    font-size: 0.7rem;
}

/* Footer in sidebar */
.footer {
    color: rgba(180, 180, 180, 0.5);
    font-size: 0.65rem;
    padding: 0.8rem 1rem;
    border-top: 1px solid rgba(29, 122, 124, 0.2);
    margin-top: 1rem;
    text-align: center;
    background-color: #000000;
}


/* Nav icons container */
.nav-icons-container {
    display: flex;
    justify-content: space-around;
    padding: 5px 0;
    background-color: #000000;
    border-bottom: 1px solid rgba(29, 122, 124, 0.3);
}

/* Clean up any old nav-icons styling */
.nav-icons-container {
    display: none; /* Hide any remaining old containers */
}

/* Ensure the background of the chat app header is transparent */
.chat-header {
    background-color: transparent;
}

/* Make sure chat nav icons have proper transparency */
.chat-nav-icons {
    background-color: var(--bg-trans-dark);
    backdrop-filter: blur(2px);
}

/* Chat header and icons - completely revised rules */
.chat-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between; /* Change to space-between to push icons right */
    margin-bottom: 4px;
    padding-bottom: 2px;
}

.chat-header h2 {
    margin: 0;
    padding: 0;
    font-weight: normal;
    font-size: 14px;
    letter-spacing: 1px;
}

/* Icon item base styling */
.nav-icon-item {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    border: 1px solid rgba(29, 122, 124, 0.4);
    margin: 0 5px;
    background-color: rgba(0, 0, 0, 0.5);
    transition: all 0.2s ease;
}

.nav-icon-item:hover {
    border-color: #1d7a7c;
    box-shadow: 0 0 5px rgba(29, 122, 124, 0.5);
    background-color: rgba(29, 122, 124, 0.1);
}

.chat-nav-icons {
    display: flex;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    border-radius: 3px;
    border: 1px solid var(--main-color-dark);
    padding: 3px 5px;
    position: relative;
}

.chat-nav-icons::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 10%;
    width: 80%;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--main-color), transparent);
}

.chat-nav-icons .nav-icon-item {
    width: 22px;
    height: 22px;
    font-size: 11px;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-nav-icons .nav-icon-item:hover {
    border-color: var(--main-color);
    box-shadow: 0 0 8px var(--main-color);
    background-color: var(--main-color-dark);
    transform: translateY(-1px) scale(1.05);
}

.chat-nav-icons .nav-icon-item:active {
    transform: translateY(0) scale(0.95);
    box-shadow: 0 0 4px var(--main-color);
    transition: all 0.1s ease;
}

.chat-nav-icons .nav-icon-item i {
    transition: all 0.2s ease;
}

.chat-nav-icons .nav-icon-item:hover i {
    color: var(--main-color) !important;
    text-shadow: 0 0 5px var(--main-color);
    transform: scale(1.1);
}

.chat-nav-icons .orange-logo:hover i {
    color: var(--accent-color) !important;
    text-shadow: 0 0 5px var(--accent-color);
}

/* Add a subtle pulse effect to the orange logo icon */
@keyframes subtle-pulse {
    0% { opacity: 0.8; }
    50% { opacity: 1; }
    100% { opacity: 0.8; }
}

.chat-nav-icons .orange-logo i {
    animation: subtle-pulse 2s infinite ease-in-out;
}

/* Quantum Core active state styling */
.chat-nav-icons .orange-logo.active {
    border-color: var(--accent-color);
    box-shadow: 0 0 12px var(--accent-color);
    background-color: rgba(180, 100, 50, 0.2);
}

.chat-nav-icons .orange-logo.active i {
    color: var(--accent-color) !important;
    text-shadow: 0 0 8px var(--accent-color);
    animation: quantum-pulse 1.5s infinite ease-in-out;
}

@keyframes quantum-pulse {
    0% { opacity: 0.7; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.15); }
    100% { opacity: 0.7; transform: scale(0.9); }
}

/* Quantum effect for images */
@keyframes quantum-distortion {
    0% { 
        filter: hue-rotate(0deg) saturate(100%) brightness(100%);
        transform: scale(1) translate(0, 0); 
    }
    25% { 
        filter: hue-rotate(15deg) saturate(120%) brightness(110%);
        transform: scale(1.01) translate(-2px, 1px); 
    }
    50% { 
        filter: hue-rotate(0deg) saturate(130%) brightness(105%);
        transform: scale(1) translate(0, 0); 
    }
    75% { 
        filter: hue-rotate(-15deg) saturate(120%) brightness(110%);
        transform: scale(1.01) translate(2px, -1px); 
    }
    100% { 
        filter: hue-rotate(0deg) saturate(100%) brightness(100%);
        transform: scale(1) translate(0, 0); 
    }
}

.quantum-effect {
    animation: quantum-distortion 8s infinite ease-in-out !important;
    position: relative;
}

.quantum-effect::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, 
                  rgba(180, 100, 50, 0.1), 
                  rgba(180, 100, 50, 0), 
                  rgba(29, 122, 124, 0.1),
                  rgba(29, 122, 124, 0));
    mix-blend-mode: screen;
    animation: quantum-overlay 12s infinite ease-in-out;
    pointer-events: none;
    z-index: 10;
}

@keyframes quantum-overlay {
    0% { opacity: 0.2; }
    50% { opacity: 0.7; }
    100% { opacity: 0.2; }
}

/* Action buttons styling */
.btn-primary {
    background-color: #1d7a7c;
    border-color: #1d7a7c;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover {
    background-color: #176264;
    border-color: #176264;
    box-shadow: 0 2px 10px rgba(29, 122, 124, 0.3);
}

/* Button icon styling */
.button-icon {
    margin-right: 5px;
    width: 16px;
    height: 16px;
    stroke-width: 2;
    stroke: currentColor;
}

/* Top UI container style */
.navbar {
    background-color: var(--bg-trans);
    border-bottom: 1px solid var(--main-color-dark);
    padding: 0.8rem 1rem;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    height: 52px;
    display: flex;
    align-items: center;
}

/* Main footer styling - matched with navbar */
.main-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #000000;
    border-top: 1px solid rgba(29, 122, 124, 0.3);
    padding: 5px 0;
    text-align: center;
    font-size: 0.65rem;
    color: rgba(150, 150, 150, 0.7);
    z-index: 100;
}
        
/* More specific rules for sidebar items */
#sidebar-wrapper .list-group-item.bg-light:hover,
#accordionSidebar .list-group-item.bg-light:hover,
a.list-group-item.bg-light:hover {
    color: var(--menu-text) !important;
    background-color: var(--bg-trans-hover) !important;
    border-color: var(--main-color-dark);
}
        

