@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
  --foreground-rgb: 0, 0, 0;
  --background-rgb: 255, 255, 255;
  --background-start-rgb: 255, 255, 255;
  --background-end-rgb: 255, 255, 255;
  --header-gradient: linear-gradient(to bottom, rgba(255,255,255,100%), rgba(255,255,255,90%), rgba(255,255,255,0%));
  --grey-rgb: 220, 220, 220;
  --grey-rgb-dark: 10, 10, 10;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* --foreground-rgb: 255, 255, 255; */
    --foreground-rgb: 255, 255, 255;
    --background-rgb: 0, 0, 0;
    --background-start-rgb: 0, 0, 0;
    --background-end-rgb: 0, 0, 0;
    --header-gradient: linear-gradient(to bottom, rgba(0,0,0,100%), rgba(0,0,0,90%), rgba(0,0,0,0%));
    --grey-rgb: 100, 100, 100;
    --grey-rgb-dark: 245, 245, 245;
  }
}

body {
  color: rgb(var(--foreground-rgb));
  background-color: rgb(var(--background-rgb));
  width: 100%;
  height: 100%;
}

@layer utilities {
  .text-balance {
    text-wrap: balance;
  }
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-inter), sans-serif;
}

h3 {
  font-size: 1.2em;
}
h4 {
  font-size: 1.0em;
}

table {
  border: 0.1em solid rgb(var(--foreground-rgb)); 
  margin: 0.625em;
  width: 100%;
}
th {
  border: 0.05em solid rgb(var(--foreground-rgb));
  padding-left: 0.625em;
  padding-right: 0.625em;
}
td {
  border: 0.05em solid rgb(var(--foreground-rgb));
  padding-left: 0.625em;
  padding-right: 0.625em;
}

.iconContainer {
  position: fixed;
  top: 50px;
  left: 0;
  right: 0;
  /* background: var(--header-gradient); */
  justify-content: center;
  height: 150px;
  padding: 30px;
}

.icon {
	border-radius: 50%;
	margin: 10px;
	height: 50px;
	width: 50px;
	box-shadow: 0 0 0 0 rgba(0, 0, 0, 1);
}

.icon-animate {
  transform: scale(1);
	animation: pulse 1s infinite;
}

@keyframes pulse {
	0% {
		transform: scale(0.95);
		box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.7);
	}

	70% {
		transform: scale(1);
		box-shadow: 0 0 0 10px rgba(0, 0, 0, 0);
	}

	100% {
		transform: scale(0.95);
		box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
	}
}

.chatMessage {
  border: 0.05em solid rgb(var(--foreground-rgb));
  padding-left: 0.625em;
  padding-right: 0.625em;
}

.mainContainer {
  display: flex;
  flex-direction: column;
  left: 0;
  right: 0;
  bottom: 0;
  top: 0;
  position: fixed;
  background-color: rgb(var(--background-rgb));
}

.title {
  text-align: center;
  background: var(--header-gradient);
  padding-top: 0.5em;
  padding-bottom: 0.8em;
}


.chatMessageContainer {
  padding-top:10px;

  max-height:100%;
}

.chatContainer {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow-y: scroll;
  overflow-x: hidden;
  margin-bottom: 20px;
  padding-left: 10px;
  padding-right: 10px;
  background-color: #F9F9FA;
  scrollbar-color: rgb(var(--grey-rgb)) rgb(var(--background-rgb)); /* Two valid colors*/
}

.inputContainer {
  padding: 0.625em;
  position: fixed;
  left:0;
  bottom:0;
  right:0;
  /* height: 120px; */
}

.textInputBox {
  border-radius: 0.8em;
  padding: 0.6em;
  line-height: 1.2em;
  font-size: 1.2em;
  height: 2.6em;
  border: 2px solid rgb(var(--foreground-rgb));
  background-color: rgb(var(--background-rgb));
  width: 100%;
  padding-right: 50px; /* Adjust padding to make space for the button */
}

.textInputContainer {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 50px;
}

.sendButton {
  position: absolute;
  margin-right: 10px;
  right: 10px;
  width: 50px;
  height: 50px;
}

.micButton {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}

.iconMessage {
  margin-right: 5px;
}

.chatMessage {
  padding: 10px 15px;
  margin-bottom: 8px;
  border-radius: 15px;
  border: none;
}

/****** Agent *******/
.agentMessageContainer {
  width: 100%;
  display: flex;
  justify-content: flex-start;  
}
.agentMessage {
  color: rgb(var(--grey-rgb-dark));
  background-color: #F15950; /*rgb(var(--grey-rgb));*/
  text-align: left;
  max-width: 80%
}

/****** User *******/
.userMessageContainer {
  width: 100%;
  display: flex;
  justify-content: flex-end;
}

.userMessage {
  color: rgb(var(--background-rgb));
  background-color: rgb(var(--foreground-rgb));
  text-align: right;
  max-width: 80%
}

/****** Widget *******/
.widgetMessageContainer {
  /* margin-top: 10%; */
  overflow: scroll;
  /* Existing: */
  width: 100%;
  display: flex;
  justify-content: center;
}

.widgetMessage {
  color: rgb(var(--foreground-rgb));
  text-align: center;
  margin-top: 10px;
  margin-bottom: 20px;
  margin-top: 30px;
}

#speechDetection {
  height: 50px; /* Increased height to match the send button */
  color: rgb(var(--foreground-rgb));
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  position: relative;
}

.voiceIndicator {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.speechControls {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.225em;
  width: 100%;
}

.widget-button {
  color: rgb(var(--background-rgb)); 
  background-color: #F15950;
  border-color: #F15950;
  border-radius: 10px;
  /* border-width: 2px;
  border-style: solid; */
  margin: 5px;
  padding: 8px;
  font-weight: 400;
  font-size: 0.9em;
}

.enter-button {
  color: rgb(var(--background-rgb)); 
  background-color: #F15950;
  border-color: #F15950;
  border-radius: 10px;
  font-weight: 400;
}

.button {
  display:flex;
  padding: 0.4em;
  margin-left: 0.4em;
  margin-right: 0.4em;
  justify-content: center;
  flex-direction: column;
  align-items: center;
  font-size: 0.8em;
  width: 100px;
}

.button-selected {
  color: rgb(var(--foreground-rgb));
  background-color: #F15950;
}

.modeButton {
  width: 220px;
  margin: 0 auto;
  border-color: #F15950;
  border-radius: 10px;
  border-width: 2px;
  border-style: solid;
  color: gray;
  padding: 5px;
  margin-top: 8px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.button-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.button-container .widget-button {
  position: relative;
  z-index: 1;
}

.button-container .HashLoader {
  position: absolute;
  z-index: 2;
}

.startButtonContainer {
  display: grid;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
}
.startButton {
  padding: 10px 20px;
  font-size: 20px;
  cursor: pointer;
}

.grid-item {
  min-height: 60vh;
}

.grid-container:has(.grid-item:nth-child(3):not(:empty)) .grid-item {
  min-height: 45vh;
}