:root {
  --bg: #f9f9fb;
  --chat-bg: #ffffff;
  --border: #e0e0e0;
  --user-bg: #dbeafe;
  --ai-bg: #f1f5f9;
  --text: #1c1c1e;
  --button-bg: #3b82f6;
}

body.dark {
  --bg: #1e1e1e;
  --chat-bg: #2c2c2c;
  --border: #444;
  --user-bg: #3b82f6;
  --ai-bg: #374151;
  --text: #f5f5f5;
  --button-bg: #2563eb;
}

body.dark #theme-toggle {
  color: #facc15;
}

body {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  height: 100vh;
}

header {
  background: var(--chat-bg);
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#brand {
  font-weight: bold;
  font-size: 18px;
}

#controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

select {
  font-size: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--chat-bg);
  color: var(--text);
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.5 5.5l6 6 6-6H1.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  padding-right: 36px;
  cursor: pointer;
  min-width: 100px;
}

#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  transition: all 0.4s ease-in-out;
}

#main.centered-layout {
  justify-content: center;
  align-items: center;
}

#main.centered-layout #systemPromptWrapper,
#main.centered-layout #chat {
  display: none;
}

#main.centered-layout #input-container {
  border-top: none;
  box-shadow: 0px 1px 35px 0px rgba(0, 0, 0, 0.1);
  border-radius: 27px;
  padding: 24px;
  background: var(--chat-bg);
  display: flex;
  flex-direction: row;
  align-items: center;
  min-width: 60%;
  max-width: 600px;
}

#systemPromptWrapper {
  display: none;
  padding: 12px 20px;
  background: var(--chat-bg);
  border-bottom: 1px solid var(--border);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

#systemPromptWrapper.visible {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

#sticky-footer {
//  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: var(--chat-bg); /* You can customize this color */
  color: var(--text); /* Footer text color */
  padding: 16px;
  text-align: center;
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
  z-index: 100;
  display: block;
}

#sticky-footer #footer-content {
  font-size: 9px;
}

#footer-content a {
  color: #808087;
  text-decoration: none;
}

.gradient-text {
  font-size: 11px;
  font-weight: bold;
  background: linear-gradient(90deg, #0096FA, #E562BE, #F8AB0A);
  background-clip: text;
  -webkit-background-clip: text; /* For Safari */
  color: transparent; /* Make the text color transparent so the gradient shows */
  display: inline-block;
  animation: gradient-animation 5s ease infinite;
  margin-bottom: 0 !important;
}

@keyframes gradient-animation {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

#chat {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  background: var(--chat-bg);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

#main:not(.centered-layout) #systemPromptWrapper,
#main:not(.centered-layout) #chat {
  opacity: 1;
  transform: translateY(0);
}

.message {
  padding: 12px 16px;
  margin: 8px 0;
  max-width: 80%;
  border-radius: 12px;
  line-height: 1.5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  animation: fadeInUp 0.3s forwards;
}

.user {
  background-color: var(--user-bg);
  align-self: flex-end;
}

.assistant {
  background-color: var(--ai-bg);
  align-self: flex-start;
}

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

#input-container {
  display: flex;
  padding: 16px;
  border-top: 1px solid var(--border);
  background: var(--chat-bg);
}

#input {
  flex: 1;
  font-size: 16px;
  padding: 12px;
  border: 0px solid var(--border);
  border-radius: 8px;
  margin-right: 8px;
}

#send {
  font-size: 16px;
  padding: 12px 20px;
  background-color: var(--button-bg);
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: #343434;
  border: 1px solid #454545;
  padding: 12px 24px 24px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  max-width: 90%;
  width: 400px;
  text-align: center;
  box-sizing: border-box;
}

.modal h2 {
  margin-bottom: 12px;
}

.modal input {
  width: 100%;
  padding: 10px 12px;
  margin: 10px 0;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
}

.modal button {
  padding: 10px 16px;
  margin: 6px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.modal .primary {
  background: #3b82f6;
  color: white;
}

.modal .secondary {
  background: #e0e0e0;
  color: #333;
}

/* media queries */

@media (min-width: 1200px) {
    .hide-xl {display: none !important;}
  }
@media (max-width: 1199px) {
    .hide-lg {display: none !important;}
  }
@media (max-width: 992px) {
    .hide-md {display: none !important;}
  }

@media (max-width: 768px) {
    
    .hide-sm {display: none !important;}
    #controls {
        flex-direction: row-reverse !important;
        align-items: stretch !important;
      }
    
    #chat {
        padding: 16px;
      }
    
    .message {
        max-width: 100%;
      }
    #sticky-footer {display: none !important;}
  }

@media (max-width: 480px) {
    
    .hide-xs {display: none !important;}
    select {border: none !important;}

  }
