/* ASCII-style SaaS Theme
   Inspired by terminal aesthetics and monospace design */

:root {
  /* --ascii-black: #2d2d2d; */
  --ascii-black: #2d2d2d;
  /* --ascii-black: ##1e1e2e; */
  --ascii-white: #f0f0f0;
  /* --ascii-white: ##cdd6f4; */
  --ascii-green: #33ff00;
  /* --ascii-green: ##a6e3a1; */
  --ascii-gray: #808080;
  /* --ascii-gray: ##7f849c; */
  --ascii-dark-gray: #404040;
  /* --ascii-dark-gray: ##45475a; */
  --ascii-border: #606060;
  /* --ascii-border: ##89b4fa; */
  --mono-font: 'DM Sans';
  /* --mono-font: 'Courier New', Courier, monospace; */
  --container-width: 1200px;
}

/* Base Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--ascii-black);
  color: var(--ascii-white);
  font-family: var(--mono-font);
  line-height: 1.6;
  padding: 20px;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--mono-font);
  margin-bottom: 1rem;
  font-weight: normal;
}

h1::before {
  /* content: "# "; */
  color: var(--ascii-green);
}

h2::before {
  /* content: "## "; */
  color: var(--ascii-green);
}

h3::before {
  /* content: "### "; */
  color: var(--ascii-green);
}

/* Links */
a {
  color: var(--ascii-green);
  text-decoration: none;
  border-bottom: 1px solid var(--ascii-green);
}

a:hover {
  background-color: var(--ascii-green);
  color: var(--ascii-black);
}

/* Container */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Navigation */
nav {
  border-bottom: 1px solid var(--ascii-border);
  padding: 1rem 0;
  margin-bottom: 2rem;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
}

nav ul li::before {
  content: "> ";
  color: var(--ascii-green);
}

/* Buttons */
.btn {
  background-color: transparent;
  border: 1px solid var(--ascii-green);
  color: var(--ascii-green);
  padding: 0.5rem 1rem;
  font-family: var(--mono-font);
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn:hover {
  background-color: var(--ascii-green);
  color: var(--ascii-black);
}

/* .btn::before { */
/*   content: "[ "; */
/* } */

/* .btn::after { */
/*   content: " ]"; */
/* } */


.btn-disabled {
  background-color: var(--ascii-green);
  border: 1px solid var(--ascii-green);
  color: var(--ascii-black);
  padding: 0.5rem 1rem;
  font-family: var(--mono-font);
}


/* .btn-disabled::before { */
/*   content: "[ "; */
/* } */

/* .btn-disabled::after { */
/*   content: " ]"; */
/* } */


/* Cards */
.card {
  border: 1px solid var(--ascii-border);
  padding: 1rem;
  margin-bottom: 1rem;
}

.card::before {
  /* content: "+--------------------+"; */
  display: block;
  color: var(--ascii-border);
  margin-bottom: 0.5rem;
}

.card::after {
  /* content: "+--------------------+"; */
  display: block;
  color: var(--ascii-border);
  margin-top: 0.5rem;
}

/* Forms */
input,
textarea {
  background-color: var(--ascii-dark-gray);
  border: 1px solid var(--ascii-border);
  color: var(--ascii-white);
  padding: 0.5rem;
  font-family: var(--mono-font);
  width: 100%;
  margin-bottom: 1rem;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--ascii-green);
}


input[type="file"] {
  display: none;
}


/* Progress Bar Styles */
progress {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 20px;
  margin: 1rem 0;
  background-color: var(--ascii-dark-gray);
  border: 1px solid var(--ascii-border);
}

progress::-webkit-progress-bar {
  background-color: var(--ascii-dark-gray);
}

progress::-webkit-progress-value {
  background-color: var(--ascii-green);
  transition: width 0.3s ease;
}

progress::-moz-progress-bar {
  background-color: var(--ascii-green);
}

.htmx-indicator {
  opacity: 0;
  /* transition: opacity 500ms ease-in; */
}

.htmx-request .htmx-indicator {
  opacity: 1;
}

.htmx-request.htmx-indicator {
  opacity: 1;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

th,
td {
  border: 1px solid var(--ascii-border);
  padding: 0.5rem;
  text-align: left;
}

th {
  background-color: var(--ascii-dark-gray);
}

/* Loading Animation */
.loading::after {
  content: "";
  animation: loading 1s infinite;
}

@keyframes loading {
  0% {
    content: "|";
  }

  25% {
    content: "/";
  }

  50% {
    content: "-";
  }

  75% {
    content: "\\";
  }

  100% {
    content: "|";
  }
}

/* Code Blocks */
pre {
  background-color: var(--ascii-dark-gray);
  padding: 1rem;
  border: 1px solid var(--ascii-border);
  overflow-x: auto;
}

code {
  font-family: var(--mono-font);
  color: var(--ascii-green);
}

/* Alerts */
.alert {
  border: 1px solid var(--ascii-border);
  padding: 1rem;
  margin: 1rem 0;
}



.alert.success {
  border-color: var(--ascii-green);
}

.alert.success::before {
  content: "[SUCCESS] ";
  color: var(--ascii-green);
}

.alert.error {
  border-color: #ff0000;
}

.alert.error::before {
  content: "[ERROR] ";
  color: #ff0000;
}


/* Responsive Design */
@media (max-width: 768px) {
  nav ul {
    flex-direction: column;
    gap: 1rem;
  }

  .container {
    padding: 0 10px;
  }
}

.flex-list {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  max-width: 100%;
  margin-bottom: 2rem;
  padding-bottom: 0.5rem;
}

.exam-box {
  border: 1px solid var(--ascii-border);
  min-width: 250px;
  padding: 1rem;
  /* margin: 1rem 0; */
  flex-shrink: 0;
}

.exam-buttons {
  display: flex;
  gap: 10px;
}

.filebox {
  border: 1px solid var(--ascii-green);
  width: 150px;
  min-height: 200px;
  overflow: visible;
  /* Make sure it can grow */
  white-space: normal;
  /* Allows text wrapping */
  word-wrap: break-word;
  /* Breaks long words */


  background-color: var(--ascii-black);
  margin: 0.75rem;
}


#file-icon {
  z-index: 1;
}

#image-stack {
  position: relative;
  height: 145px;
}

#image-stack img button {
  position: absolute;
  top: 0;
  left: 0;
  /* width: 100%; /* or fixed size */
  height: auto;
}

.delete-btn {
  background-color: var(--ascii-black);
  border: 1px solid #ff0000;
  color: var(--ascii-green);
  font-family: var(--mono-font);
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 2;
  padding: 0.5rem 1rem;
}

.delete-btn-pos {
  position: absolute;
  left: 5px;
  top: 5px;
}


.delete-btn:hover {
  background-color: #ff0000;
  color: var(--ascii-black);
}

.file-container {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  /* left to right */
  align-content: flex-start;
  overflow-y: auto;
  /* vertical scrolling */
  height: 400px;
  /* or whatever height you need */
  /* gap: 8px; /* optional spacing between items */
  border: 1px solid var(--ascii-border);
  background-color: var(--ascii-dark-gray);
  margin-bottom: 5rem;
}

#chat {
  flex: 1;
  border: 1px solid var(--ascii-border);
  background-color: var(--ascii-dark-gray);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  /* vertical scrolling */
}

#chatbox {
  height: 600px;
  display: flex;
  flex-direction: column;
}

#chat>div {
  flex: 0;
}

.tab-menu {
  display: flex;
  justify-content: space-evenly;
  align-items: stretch;
  height: 2rem;
  margin-bottom: 2rem;
}

.tab-menu>button {
  flex: 1;
}

.message {
  margin: 1rem;
  background-color: var(--ascii-black);
  border: 1px solid var(--ascii-border);
  width: fit-content;
  padding: 0.5rem;
}

.assistant {
  text-align: left;
  align-self: flex-start;
}


.user {
  text-align: right;
  align-self: flex-end;
}

.session {
  display: flex;
  outline: 1px solid var(--ascii-border);
  justify-content: space-between;
  align-items: center;
}

#session-box {
  height: 600px;
  width: 300px;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
}


#sessions-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  /* vertical scrolling */
  border: 1px solid var(--ascii-border);
}


ul {
  list-style-position: inside;
}

ol {
  list-style-position: inside;
}

/***** MODAL DIALOG ****/
#modal {
  /* Underlay covers entire screen. */
  position: fixed;
  top: 0px;
  bottom: 0px;
  left: 0px;
  right: 0px;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;

  /* Flexbox centers the .modal-content vertically and horizontally */
  display: flex;
  flex-direction: column;
  align-items: center;

  /* Animate when opening */
  animation-name: fadeIn;
  animation-duration: 150ms;
  animation-timing-function: ease;
}

#modal>.modal-underlay {
  /* underlay takes up the entire viewport. This is only
	required if you want to click to dismiss the popup */
  position: absolute;
  z-index: -1;
  top: 0px;
  bottom: 0px;
  left: 0px;
  right: 0px;
}

#modal>.modal-content {
  /* Position visible dialog near the top of the window */
  margin-top: 10vh;

  /* Sizing for visible dialog */
  width: 80%;
  max-width: 600px;

  /* Display properties for visible dialog*/
  border: solid 1px var(--ascii-border);
  /* box-shadow: 0px 0px 20px 0px rgba(0,0,0,0.3); */
  background-color: var(--ascii-black);
  padding: 20px;

  /* Animate when opening */
  animation-name: zoomIn;
  animation-duration: 150ms;
  animation-timing-function: ease;
}

#modal.closing {
  /* Animate when closing */
  animation-name: fadeOut;
  animation-duration: 150ms;
  animation-timing-function: ease;
}

#modal.closing>.modal-content {
  /* Animate when closing */
  animation-name: zoomOut;
  animation-duration: 150ms;
  animation-timing-function: ease;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

@keyframes fadeOut {
  0% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@keyframes zoomIn {
  0% {
    transform: scale(0.9);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes zoomOut {
  0% {
    transform: scale(1);
  }

  100% {
    transform: scale(0.9);
  }
}
