@import url("https://fonts.googleapis.com/css2?family=Kufam:ital,wght@0,400..900;1,400..900&display=swap");

:root {
  /* Light theme colors */
  --bg-gradient-light: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  --bg-color-light: #f5f5f5;
  --card-bg-light: white;
  --text-color-light: #333333;
  --input-bg-light: white;
  --input-border-light: #e0e0e0;
  --input-text-light: #333333;
  --button-bg-light: #4285f4;
  --button-hover-light: #3367d6;
  --link-color-light: #4285f4;

  --send-button-color-light: white;
  --record-button-color-light: #303030;

  /* Dark theme colors */
  --bg-gradient-dark: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  --bg-color-dark: #303030;
  --card-bg-dark: #303030;
  --text-color-dark: #ffffff;
  --input-bg-dark: #2a2a2a;
  --input-border-dark: #404040;
  --input-text-dark: #ffffff;
  --button-bg-dark: #4285f4;
  --button-hover-dark: #3367d6;
  --link-color-dark: #4285f4;

  --send-button-color-dark: #303030;
  --record-button-color-dark: #3367d6;
}

body {
  font-family: "Inter", sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  transition: all 0.3s ease;
}

/* Theme classes */
.light-theme {
  background: var(--bg-gradient-light);
  --bg-color: var(--bg-color-light);
  --card-bg: var(--card-bg-light);
  --text-color: var(--text-color-light);
  --input-bg: var(--input-bg-light);
  --input-border: var(--input-border-light);
  --input-text: var(--input-text-light);
  --button-bg: var(--button-bg-light);
  --button-hover: var(--button-hover-light);
  --link-color: var(--link-color-light);
  --brand-name: "SELLIA";

  --send-button-color: var(--send-button-color-light);
  --record-button-color: var(var(--record-button-color-light));
}

.dark-theme {
  background: var(--bg-gradient-dark);
  --bg-color: var(--bg-color-dark);
  --card-bg: var(--card-bg-dark);
  --text-color: var(--text-color-dark);
  --input-bg: var(--input-bg-dark);
  --input-border: var(--input-border-dark);
  --input-text: var(--input-text-dark);
  --button-bg: var(--button-bg-dark);
  --button-hover: var(--button-hover-dark);
  --link-color: var(--link-color-dark);
  --brand-name: "BREAKOUT";

  --send-button-color: var(--send-button-color-dark);
  --record-button-color: var(--record-button-color-dark);
}

.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
  position: relative;
  padding: 0 20px;
  overflow: hidden;
}
.left-effect {
  position: absolute;
  left: -10px;
  top: -10px;
  width: 300px;
  height: 300px;
  border-radius: 100%;
  background: #598ec8;
  background: radial-gradient(
    circle,
    rgba(89, 142, 200, 1) 49%,
    rgba(255, 255, 255, 1) 100%
  );
  filter: blur(120px);
}
.right-effect {
  position: absolute;
  bottom: -20px;
  right: -20px;
  width: 200px;
  height: 200px;
  border-radius: 100%;
  background: #598ec8;
  background: radial-gradient(
    circle,
    rgba(89, 142, 200, 1) 49%,
    rgba(255, 255, 255, 1) 100%
  );
  filter: blur(120px);
}

.brand-section {
  text-align: center;
  margin-bottom: 20px;
}

.brand-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: var(--button-bg);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(66, 133, 244, 0.3);
  margin-bottom: 52px;
}

.brand-icon svg {
  width: 40px;
  height: 40px;
  fill: white;
}

.brand-name {
  font-family: "Kufam", sans-serif;
  font-size: 89px;
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
  letter-spacing: 2px;
}

.login-card {
  background: var(--card-bg);
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0px 17px 39px 21px rgba(0, 0, 0, 0.75);
  -webkit-box-shadow: 0px 17px 39px 21px rgba(0, 0, 0, 0.75);
  -moz-box-shadow: 0px 17px 39px 21px rgba(0, 0, 0, 0.75);
  width: 100%;
  max-width: 400px;
  margin-bottom: 30px;
}

.login-title {
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 30px;
  color: var(--text-color);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-color);
  margin-bottom: 8px;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  font-size: 16px;
  color: var(--input-text);
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  height: 48px;
  box-sizing: border-box;
  font-family: "Inter", sans-serif;
}

.form-group input:focus {
  outline: none;
  border-color: var(--button-bg);
  box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.1);
}

.auth-options {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 15px;
  margin: 20px 0 25px 0;
  color: var(--text-color);
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
}

.remember-me label {
  font-size: 14px;
  color: var(--text-color);
  font-weight: 400;
  margin: 0;
}

.forgot-password {
  text-align: left;
  margin: 0;
}

.forgot-password a {
  color: var(--text-color);
  text-decoration: none;
  font-size: 14px;
}

.forgot-password a:hover {
  text-decoration: underline;
}

.login-button {
  width: 100%;
  padding: 12px 24px;
  background-color: var(--button-bg);
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  color: white;
  font-family: "Inter", sans-serif;
  height: 48px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.login-button:hover {
  background-color: var(--button-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

.login-button:active {
  transform: translateY(0);
}

.error-message {
  margin-top: 15px;
  padding: 10px;
  background-color: #ffebee;
  color: #c62828;
  border-radius: 8px;
  font-size: 14px;
  display: none;
}

.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--button-bg);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}
/* Chat App Structure */
.chat-app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Inter", sans-serif;
  /* width: 70%; */
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  overflow-y: auto;
}

/* Header */
.chat-header {
  padding: 20px 0 15px 0;
  flex-shrink: 0;
  text-align: center;
  /* border-bottom: 1px solid var(--input-border); */
}

.chat-header h1 {
  font-weight: 600;
  margin: 0 0 8px 0;
  color: var(--text-color);
}

.subtitle {
  font-family: "Kufam", sans-serif;
  font-size: 22px;
  color: var(--text-color);
  margin: 4px 0;
  font-weight: 500;
  line-height: 1.4;
}

/* Messages Area */
.chat-messages {
  width: 70%;
  flex: 1;
  padding: 35px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: auto;
  gap: 40px;
}

/* Message Bubbles */
.message {
  max-width: 85%;
  display: flex;
}

.message.assistant {
  align-self: flex-start;
}

.message.user {
  align-self: flex-end;
}

.message-bubble {
  padding: 30px 55px;
  font-weight: 400;
  border-radius: 39px;
  line-height: 1;
  font-size: 20px;

  letter-spacing: -1px;
  box-shadow: 0px 17px 39px -8px rgba(0, 0, 0, 0.75);
  -webkit-box-shadow: 0px 17px 39px -8px rgba(0, 0, 0, 0.75);
  -moz-box-shadow: 0px 17px 39px -8px rgba(0, 0, 0, 0.75);
}

.message.assistant .message-bubble {
  background-color: var(--card-bg);

  color: var(--text-color);
  /* border-bottom-left-radius: 4px; */
}

.message.user .message-bubble {
  background-color: var(--button-bg);
  color: white;
  border-bottom-right-radius: 4px;
}

.message-bubble p {
  margin: 0;
  padding: 2px 0;
}

/* Input Area - Fixed Version */
.chat-input-container {
  padding: 15px 0 30px 0;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 10px;
  width: 70%;
  margin: auto;
  position: fixed;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
}

.chat-input {
  display: flex;
  align-items: center;
  background-color: var(--input-bg);
  border-radius: 18px;
  /* padding: 8px 12px; */
  border: 1px solid var(--input-border);
  min-height: 50px;
  max-height: 150px;
  transition: height 0.2s ease;
  width: 98%;
}

.chat-input textarea {
  flex: 1;
  border: none;
  background: transparent;
  resize: none;
  color: var(--input-text);
  font-family: "Inter", sans-serif;
  font-size: 15px;
  /* padding: 0; */
  line-height: 1.4;
  max-height: 120px;
  outline: none;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--button-bg) transparent;
}
/* Custom Scrollbars */
.chat-input textarea::-webkit-scrollbar {
  width: 4px;
}

.chat-input textarea::-webkit-scrollbar-track {
  background: transparent;
}

.chat-input textarea::-webkit-scrollbar-thumb {
  background-color: var(--button-bg);
  border-radius: 2px;
}

.chat-input textarea::-webkit-scrollbar-button {
  background-color: transparent;
  display: none;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

/* Input Placeholder */
.chat-input textarea::placeholder {
  color: var(--text-color);
  opacity: 0.7;
  font-weight: 200;
}

/* Buttons */
.input-buttons {
  display: flex;
  gap: 6px;
  margin-left: 8px;
}

.icon-button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.icon-button:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.icon-button.send-button {
  color: var(--send-button-color);
}

.icon-button.mic-button {
  color: var(--button-bg);
}

/* Theme and Logout Buttons */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--button-bg);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.logout-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--card-bg);
  border: 1px solid var(--input-border);
  color: var(--text-color);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  z-index: 1000;
}
#recorderContainer {
  display: flex;
  flex-direction: column;
  /* width: 100%; */
  gap: 8px;
}
.control-row {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 12px;
}
#toggleBtn {
  padding: 10px 20px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  color: #282828;
  font-size: 16px;
  transition: background-color 0.3s;
  background-color: #e0e0e0;
  flex-shrink: 0;
}
#toggleBtn.recording {
  background-color: #ff4b4b;
  color: white;
}
#statusText {
  font-size: 14px;
  color: #555;
  flex-grow: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 200px;
}
#statusText.speaking {
  color: #ff4b4b;
  font-weight: bold;
}
#statusText.silence {
  color: #ff7700;
}
#statusText.processing {
  color: #007bff;
}
.progress-container {
  width: 100%;
  background-color: #f3f3f3;
  border-radius: 4px;
  display: none;
}
.progress-bar {
  height: 4px;
  background-color: #4caf50;
  border-radius: 4px;
  width: 0%;
  transition: width 0.1s;
}
/* Typing indicator styles */
.typing-indicator {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  background: #f8f9fa;
  border-radius: 18px;
  margin: 4px 0;
  max-width: 80px;
  opacity: 0;
  animation: fadeIn 0.3s ease-in-out forwards;
}

.typing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #6b7280;
  animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
  animation-delay: -0.32s;
}
.typing-dot:nth-child(2) {
  animation-delay: -0.16s;
}
.typing-dot:nth-child(3) {
  animation-delay: 0s;
}

@keyframes typingBounce {
  0%,
  80%,
  100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* Voice recorder improvements */
#recorderContainer {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

#toggleBtn {
  position: relative;
  width: 60px;
  height: 60px;
  color: var(--record-button-color);
  border-radius: 50%;
  /* border: 2px solid #ddd; */
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  font-size: 20px;
  justify-content: center;
}

#toggleBtn:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Recording state */
#toggleBtn.recording {
  background: #ef4444;
  border-color: #dc2626;
  animation: pulse 2s infinite;
}

#toggleBtn.recording #recordIcon {
  color: white;
}

/* Speaking state */
#toggleBtn.speaking {
  background: #10b981;
  border-color: #059669;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}

#toggleBtn.speaking #recordIcon {
  color: white;
}

/* Silence timeout state */
#toggleBtn.silence {
  background: #f59e0b;
  border-color: #d97706;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
}

#toggleBtn.silence #recordIcon {
  color: white;
}

/* Processing state */
#toggleBtn.processing {
  background: #6366f1;
  border-color: #4f46e5;
}

#toggleBtn.processing #recordIcon {
  color: white;
  animation: spin 1s linear infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0.1);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Voice activity indicator - subtle audio wave */
.voice-indicator {
  display: none;
  align-items: center;
  gap: 2px;
  margin-left: 4px;
}

.voice-indicator.active {
  display: flex;
}

.voice-bar {
  width: 2px;
  background: #10b981;
  border-radius: 1px;
  animation: voice-wave 1.5s ease-in-out infinite;
}

.voice-bar:nth-child(1) {
  height: 8px;
  animation-delay: 0s;
}
.voice-bar:nth-child(2) {
  height: 12px;
  animation-delay: 0.1s;
}
.voice-bar:nth-child(3) {
  height: 6px;
  animation-delay: 0.2s;
}
.voice-bar:nth-child(4) {
  height: 10px;
  animation-delay: 0.3s;
}

@keyframes voice-wave {
  0%,
  100% {
    transform: scaleY(0.3);
    opacity: 0.7;
  }
  50% {
    transform: scaleY(1);
    opacity: 1;
  }
}

/* Countdown display */
.countdown-display {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  background: #f59e0b;
  color: white;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 4px;
  animation: countdown-pulse 1s ease-in-out infinite;
}

.countdown-display.active {
  display: flex;
}

@keyframes countdown-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

/* Improved textarea */
#userInput {
  /* max-height: 120px; */
  border: none;
  outline: none;
  background: transparent;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  padding-left: 30px;
  border-radius: 12px;
  transition: all 0.2s ease;
  /*  */
  /* height: 100%;
  box-sizing: border-box;
  min-height: 70px;
  width: 100%;
  resize: none; */
}

#userInput:focus {
  background: transparent;
}

.chat-input {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0px;
  background: #343952;
  background-color: var(--bg-color);
  backdrop-filter: blur(10px);
  border-radius: 42px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  overflow: hidden;
  min-height: 70px;
}

.chat-input:focus-within {
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.input-buttons {
  display: flex;
  align-items: end;
  gap: 8px;
  padding-right: 10px;
}

.send-button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #5b9cec;
  border: none;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.send-button:hover {
  background: #2563eb;
  transform: scale(1.05);
}

/* Hide old progress container */
.progress-container {
  display: none !important;
}

/* Status text - keep minimal for fallback */
#statusText {
  display: none;
}
/* Loading spinner styles */
.button-loader {
  vertical-align: middle;
}

.spinner {
  animation: rotate 2s linear infinite;
  width: 20px;
  height: 20px;
  display: inline-block;
}

.spinner .path {
  stroke: currentColor;
  stroke-linecap: round;
  animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes dash {
  0% {
    stroke-dasharray: 1, 150;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -35;
  }
  100% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -124;
  }
}

/* Disabled button state */
.login-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}
.theme-toggle,
#logoutButton {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--button-bg);
  color: var(--button-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  z-index: 1000;
  transition: all 0.3s ease;
}

#logoutButton {
  right: 70px; /* Position to the left of theme toggle */
  background: #ff4444;
}

#logoutButton:hover {
  background: #cc0000;
}
.toastui-editor-contents {
  font-family: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
  color: inherit !important;
  background: none !important;
}

.toastui-editor-contents * {
  font-family: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
  color: inherit !important;
  background: none !important;
}