*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
    --primary-bg: #f3f6ff;/* #dbe4f5;*/ 
    --primary-bg-select: #ffffff;
    --text-color: #1a1a1a;
    --border-color: #c5c6c7;
    --paper-shadow: 0 4px 24px rgba(0, 0, 0, 0.15), 0 8px 32px rgba(0, 0, 0, 0.12); 
    --text-color-regular: #545454;
    --text-color-special: #000000;
    --text-color-brighter: #626262;
}

body, html {
    display: flex;
    font-family: Verdana, sans-serif;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    position: relative;
    margin: 0;
    padding: 0;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    overflow: hidden; /* Prevent unnecessary scrollbars on the container itself */
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    align-items: center;   /* Centers items horizontally (cross-axis) */
    justify-content: flex-start; /* Aligns items to the top (main axis) */
}

.sliding-menu {
    position: fixed;
    top: 0;
    left: -256px;
    width: 256px;
    height: 100%;
    background-color: var(--primary-bg);
    transition: transform 0.3s ease-in-out;
    z-index: 1000;
    padding: 1rem;
    box-sizing: border-box;
}

.sliding-menu.open {
    transform: translateX(256px);
}

#main-content {
    display: flex;
    flex: 1;
    width: 100%;
    min-width: 100%;
    height: 100%;
    transition: transform 0.3s ease-in-out;
    background-color: var(--primary-bg);
    position: relative;
    z-index: 1;  /* Create new stacking context for main content */
    overflow: hidden;
    gap: 0;
    padding: 1rem;  /* Add consistent padding all around */
    box-sizing: border-box;
    margin: 0;
}

#main-content.menu-open {
    transform: translateX(256px);
}

.left-column {
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0;  /* change from 0% to 0 */
    flex-shrink: 0;
    /* min-width: 200px;  */
    background-color: var(--primary-bg);
    color: var(--text-color);
    padding: 0;  /* change from 0.5rem to 0 */
    box-sizing: border-box;
    /* Remove overflow: hidden from here */
    margin-top: 2rem;
    position: relative;  /* Add this to create stacking context */
}

/* Add overflow control to the content areas instead */
#sidebarChat {
    overflow: hidden;
}


.left-column.expanded {
    width: 33%;  /* one-third width when sidebar chat is active */
    padding: 0.5rem 0.5rem 0 0.5rem;  
}

.left-column .header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* padding: 1rem; */
    position: relative;
    /* z-index: 1000; */
}

.chat-container {
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: left center;
    width: 100%;
    background-color: white;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    border-radius: 12px;
    box-shadow: var(--paper-shadow);
    height: calc(100vh - 2rem);  /* Account for padding */
    margin: 0;  /* Remove all margins */
    padding: 0;  /* Remove all padding */
    background-attachment: local; /* Ensures it scrolls with the content */
    background-image: 
        linear-gradient(to right, rgba(0, 0, 255, 0.1) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 0, 255, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    background-repeat: repeat; /* Ensure the grid repeats */
    position: relative;
    z-index: 1;  /* Single z-index value */
    overflow: hidden;
    flex-direction: column;
}

.chat-container.shifted {
    width: 67%;  /* remaining space (2/3) when sidebar is expanded */
    transform: translateX(0);
}

#open-sidechat {
    position: absolute;
    left: 0px; /* Position it half-outside */
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    box-shadow: var(--paper-shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 21000;
}

#open-sidechat svg {
    width: 20px;
    height: 20px;
    color: var(--text-color-special);
    transform: rotate(0deg);
    transition: transform 0.3s ease;
}

/* Show button on hover and when active */
.chat-container:hover #open-sidechat {
    opacity: 1;
}

/* Rotate icon when expanded */
.chat-container.shifted #open-sidechat svg {
    transform: rotate(180deg);
}

#scroll-wrapper {
flex-grow: 1;
overflow-y: auto;
overflow-x: hidden;
display: flex;
flex-direction: column;
padding-right: 8px; /* scrollbar space */
width: 100%;
padding-top: 1rem;
}

.header {
    display: flex;
    align-items: center;
    gap: 1rem;  /* Add gap between elements */
    justify-content: flex-start;  /* Align items to the start */
    margin-bottom: 0.5rem;
    margin-top: 0;
    position: fixed;
    left: 1rem;
    top: 1rem;
    width: 30%; /*calc(100% - 2rem);*/
    z-index: 21000;
}

#tab-container {
    position: relative;
    width: 100%;
}

/* Replace the old #close-sidechat rules with these */
#close-sidechat {
    display: none;
    position: absolute;
    right: 0rem;
    top: -2.2rem;
    z-index: 22000;  /* Increase z-index to be above other elements */
    pointer-events: auto;  /* Ensure clicks are registered */
    cursor: pointer;
}

.left-column.expanded #close-sidechat {
    display: block;  /* Show when left column is expanded */
}

.logo {
    font-family: 'Caveat', cursive;
    font-size: 2rem;
    margin: 0;  /* Remove margins */
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;   
    position: relative;
    top: 2px;
}


.logo:hover {
    transform: scale(1.1);
    opacity: 0.8;    
    cursor: pointer;
}

.icon-button {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.5rem;
}

.icon-button:hover {
    background-color: rgba(26, 115, 232, 0.1);
    border-radius: 4px;
}

/* Update select inputs */
/* .language-select {
    width: 100%;
    padding: 0.8rem;
    background-color: white;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.language-select:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
    outline: none;
} */

.menu-nav {
    margin-top: 3rem;
}

.menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    text-align: left;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.menu-item:hover {
    border-radius: 4px;
    background-color: rgba(26, 115, 232, 0.1);
}

.menu-item svg {
    margin-right: 0.5rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

#username-display {
    font-size: 1.0em;
    color: var(--secondary-color);
    margin-left: 10px;
    text-decoration: none;
    cursor: pointer;
}
#username-display:hover {
    text-decoration: underline;
}


.assistant-message {
    font-size: 20px;
    color: #1a73e8;
    /* background-color: #ffffff; */
    justify-content: center;
    align-items: center;
} 

.user-message {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    font-size: 25px;
    padding: 10px;
    line-height: 1.5;
    padding-bottom: 10px;
    white-space: pre;
    font-family: 'Verdana', cursive;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    position: relative;
}

.before-equals, .after-equals {
    display: inline-block;
    text-align: right;
    flex: 1;
}

.equals {
    display: inline-block;
    text-align: center;
    width: 20px; /* Fixed width for equals sign */
    margin: 0 10px;
}

.before-equals {
    text-align: right;
    margin-right: 10px;
}

.after-equals {
    text-align: left;
    margin-left: 10px;
    display: inline-flex;
}

.equation-checkmark {
    color: green;
    margin-left: 12px; /* Space between the equation and the checkmark */
    /* font-size: 1.2em;  */
    display: inline-block;
    /* vertical-align: middle;  */
}


.restart-container {
    text-align: center;
    margin-top: 10px;
    margin-bottom: 10px;
}

.restart-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
    user-select: none;    /* prevents highlighting the text */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    caret-color: transparent; /* Hide the caret */
    outline: none; /* Remove the default focus outline */
}

.restart-button:hover {
    background-color: #45a049;
}

/* Optional: Scrollbar styling for webkit browsers */
.chat-container::-webkit-scrollbar {
    width: 8px; /* Thin scrollbar */
}

.chat-container::-webkit-scrollbar-track {
    background: #f1f1f1; /* Light background for the track */
}

.chat-container::-webkit-scrollbar-thumb {
    background: #888; /* Darker color for the scrollbar thumb */
    border-radius: 4px; /* Rounded corners for the thumb */
}

.chat-container::-webkit-scrollbar-thumb:hover {
    background: #555; /* Darker on hover */
}

.chat-container::-webkit-scrollbar-horizontal {
    height: 8px; /* Thin horizontal scrollbar */
}

.chat-container::-webkit-scrollbar-track-horizontal {
    background: #f1f1f1;
}

.chat-container::-webkit-scrollbar-thumb-horizontal {
    background: #888;
    border-radius: 4px;
}

/* Drop Here Area */
.empty-form-buttons {
    position: absolute;
    top: 90px; 
    display: flex;
    align-items: center; /* Vertically align icon and label */
    justify-content: center; /* Center content horizontally */
    align-items: center;
    gap: 16px;
    height: 80px;
    border: none;
    margin: 1rem auto; /* Center align */
    padding: 0.5rem;
}

/* Styling for each button */
.chat-box-area {
    position: relative;
    z-index: 1;
    display: flex; /* Set layout to flexbox */
    flex-direction: row; /* Align children in a row */
    align-items: center; /* Vertically align icon and label */
    justify-content: center; /* Center content horizontally */
    gap: 8px; /* Add spacing between icon and label */
    cursor: pointer;
    padding: 8px 16px; /* Add padding around the button */
    transition: background-color 0.2s;
    border: none; /* Remove default border */
    width: auto; /* Adjust size dynamically */
    height: auto; /* Adjust size dynamically */
}

/* Optional hover effect */
.chat-box-area:hover {
    background-color: rgba(26, 115, 232, 0.05);
}

.chat-box-button {
    border: none; /* Remove default border */
    border-radius: 8px; /* Optional: Rounded corners */
    flex-direction: row; /* Align children in a row */
    display: flex; /* Set layout to flexbox */
    width: auto; /* Allow button to stretch */
    /* min-width: 112px;  */
    height: 40px;
    align-items: center; /* Vertically align icon and label */
    justify-content: center; /* Center content horizontally */
    gap: 8px; /* Add spacing between icon and label */
    white-space: nowrap; /* Prevent text from wrapping */
    padding: 0 16px; /* Add horizontal padding */
    background-color: transparent;/* #eaddff;*/

}

/* Styling for the button SVG icon */
.chat-box-button svg {
    width: 24px; /* Icon size */
    height: 24px;
    stroke: var(--text-color-brighter); /* Set to your desired color */
    fill: var(--text-color-brighter); 
    transition: stroke 0.3s; /* Optional: Add a smooth transition for hover effects */
}

/* Styling for the button label */
.chat-box-button span {
    font-size: 14px; /* Text size */
    color: var(--text-color-brighter); /* Text color */
    text-align: left; /* Align text properly */
}

/* Hide elements with the 'hidden' class */
.hidden {
    display: none !important;
    overflow: hidden;  /* Hide anything outside the container */
  }

  .rocket {
    /* This parent .rocket div will move/animate */
    position: absolute;
    left: 50%;         /* center horizontally */
    top: 30%;       /* center vertically */
    transform: translate(0%, 0%) scale(0.5); /* Center rocket and scale */
    
    /* Pivot around the bottom-center of this .rocket block */
    transform-origin: bottom center;

    /* We'll animate both translation & scale in keyframes */
    animation: rocketFlight 4s infinite;

    z-index: 10000;
  }

  /* The actual rocket image */
  .rocket img {
    display: block;    /* remove inline spacing */
    width: 200px;      /* or set an explicit width that looks good */
    height: auto;
  }

  /* Rocket goes up (fire on), then down (fire off), repeat */
  @keyframes rocketFlight {
    /* Start on ground, scale down to 30%, angled 0 */
    0% {
      transform: translate(-50%, -50%) scale(0.3) rotate(0deg);
    }
    /* By 25%, rocket is fully up (still 0deg) */
    25% {
      transform: translate(-50%, -200px) scale(0.3) rotate(0deg);
    }
    /* Immediately after 25%, rocket at top, fire goes off but angle is same */
    26% {
      transform: translate(-50%, -200px) scale(0.3) rotate(0deg);
    }
    /* By 75%, rocket back to ground with the same angle */
    75% {
      transform: translate(-50%, -50%) scale(0.3) rotate(0deg);
    }
    /* Loop back to start */
    100% {
      transform: translate(-50%, -50%) scale(0.3) rotate(0deg);
    }
  }

  /* ====== 3. FIRE (FLAME) ====== */
  .fire {
    position: absolute;
    /* Place flame below rocket’s bottom center */
    left: 50%;
    bottom: -30px;       /* tweak so it sits nicely under the rocket base */
    transform: translateX(-50%);

    width: 20px;
    height: 40px;
    border-radius: 50%;
    background: radial-gradient(
      circle at 50% 20%,
      #ffa500 10%,           /* bright orange center */
      #ff4500 60%,           /* darker red/orange mid */
      rgba(255,69,0,0) 70%   /* fade to transparent */
    );
    z-index: -1;  /* behind the rocket image */

    /* Fire is visible from 0% to 25%, then disappears */
    animation: fireOnOff 4s infinite;
  }

  @keyframes fireOnOff {
    0%, 25% {
      opacity: 1;  /* fire visible */
    }
    26%, 100% {
      opacity: 0;  /* fire off */
    }
  }

/* Handle preview image */

.small-image-preview {
    position: absolute;
    top: 10px;
    right: 10px; /* Changed from left: 10px; */
    /* left: 10px;  -- removed */
    width: 150px; /* Small size */
    border-radius: 10px;
    border: 2px solid #ccc;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    background-color: white;
    transition: transform 0.3s ease-in-out, top 0.3s ease-in-out, right 0.3s ease-in-out;
    transform-origin: top right; /* Ensures scaling happens from top-right */
}

/* Zoom and move while staying within boundaries */
.small-image-preview:hover {
    transform: scale(1.5) translate(-20px, 20px); /* Moves diagonally to the left */
}

/* Handle assist button */
.assist-buttons-container {
    display: flex;
    justify-content: center; /* Equal spacing */
    align-items: center;
    /* gap: 10px;  */
    flex-wrap: wrap; /* Optional: wrap if not enough space */
    padding: 5px;
    border-radius: 8px;
    margin-top: 0px;
    color: var(--text-color-brighter);
}

#revision-number {
    font-size: 10px;
}