/* UI Components Styles */

/* Chat View Header */
#chat-view-header {
  padding: 16px 20px;
  text-align: center;
  max-width: 60%;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  display: none;
}

#chat-view-header .main-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--ai-text);
  margin-bottom: 4px;
}

#chat-view-header .mode-subtitle {
  font-size: 14px;
  font-weight: 500;
}

#chat-view-header.simple-mode {
  display: block;
}

#chat-view-header.simple-mode .mode-subtitle {
  color: var(--muted);
  text-shadow: 0 0 10px rgba(136, 136, 136, 0.3);
}

#chat-view-header.super-agent {
  display: block;
}

#chat-view-header.super-agent .mode-subtitle {
  color: var(--accent);
  text-shadow: 0 0 20px rgba(155, 220, 255, 0.5);
  animation: superAgentGlow 2s ease-in-out infinite alternate;
}

#chat-view-header.ultra-mode {
  display: block;
}

#chat-view-header.ultra-mode .mode-subtitle {
  color: #ff4444;
  text-shadow: 0 0 20px rgba(255, 68, 68, 0.5);
  animation: ultraModeGlow 2s ease-in-out infinite alternate;
}

/* Action Logs and Notifications */
.action-log {
  align-self: flex-start;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--muted);
  border-left: 2px solid #444;
  margin-left: 14px;
  animation: fadeInUp 220ms ease;
}

.working-bubble {
  align-self: flex-start;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  margin-left: 14px;
  animation: fadeInUp 220ms ease;
  display: inline-block;
  transition: opacity 0.5s ease-out;
}

.working-bubble.fade-out {
  opacity: 0;
}

.notification-banner {
  background: #000000;
  color: var(--accent);
  padding: 12px 16px;
  border-radius: 12px;
  border: 2px solid var(--accent);
  margin: 16px 0;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  animation: fadeInUp 220ms ease;
}

/* Character Image */
.character-image {
  width: 100px;
  height: auto;
  border-radius: 0px;
  margin-top: 12px;
  display: block;
  animation: fadeInUp 220ms ease;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  object-fit: cover;
   border-left: none;
}

.character-image:hover {
  transform: scale(1.5);
   border-left: 2px solid var(--accent);
}

/* Ultra mode character image styling */
.character-image.ultra-mode-image {
  border-color: #ff4444;
 border-left: 2px solid #ff4444;
}

/* Buttons and Controls */
#new-project-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  background: var(--input-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--ai-text);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  z-index: 100;
}

.code-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: none;
  color: var(--copy);
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}

.code-run-btn {
  position: absolute;
  top: 8px;
  right: 60px;
  background: rgba(0, 0, 0, 0.25);
  border: none;
  color: var(--accent);
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}

/* Input Sections */
#input-section-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

#simple-mode-input-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 16px 20px;
  z-index: 50;
  display: flex;
  justify-content: center;
  align-items: center;
}

#simple-mode-input-container .input-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

#simple-mode-input {
  flex: 1;
  height: 52px;
  padding: 14px 20px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--input-bg);
  color: var(--ai-text);
  font-size: 16px;
  outline: none;
  box-sizing: border-box;
  position: relative;
}

#simple-mode-send {
  width: 82px;
  height: 52px;
  padding: 0 20px;
  border-radius: 26px;
  border: none;
  background: #ffffff;
  color: #000000;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  font-size: 15px;
  flex-shrink: 0;
}

#instructions {
  color: var(--muted);
  font-size: 14px;
  max-width: 80%;
  text-align: center;
  position: relative;
  display: inline-block;
  min-height: 20px;
}

#instructions .typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background-color: var(--muted);
  margin-left: 2px;
  animation: cursorBlink 1s step-end infinite;
  vertical-align: text-bottom;
}

#instructions.typing-complete .typing-cursor {
  display: none;
}

#mode-instructions {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  z-index: 10;
  background: rgba(0, 0, 0, 0.8);
  padding: 8px 16px;
  border-radius: 16px;
  backdrop-filter: blur(10px);
  white-space: nowrap;
}

#input-error {
  color: var(--error);
  font-size: 13px;
  font-weight: 500;
  max-width: 80%;
  text-align: center;
  display: none;
  height: 16px;
}

#input-bar {
  width: 100%;
  max-width: 80%;
  display: flex;
  gap: 12px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
}

#input-bar .input-wrapper {
  flex: 1;
  position: relative;
  max-width: 600px;
}

#user-input {
  width: 100%;
  height: 64px;
  padding: 16px 24px;
  border-radius: 32px;
  border: none;
  background: var(--input-bg);
  color: var(--ai-text);
  font-size: 16px;
  outline: none;
  box-sizing: border-box;
}

#send-button {
  height: 64px;
  padding: 0 24px;
  border-radius: 32px;
  border: none;
  background: #ffffff;
  color: #000000;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* Action Buttons Container */
#final-actions-container {
  display: none;
  padding: 20px;
  max-width: 60%;
  margin: 0 auto;
  animation: fadeInUp 220ms ease;
}

#final-actions-container .action-buttons {
  display: flex;
  gap: 12px;
  width: 100%;
}

#download-btn, #improve-btn, #new-project-btn-bottom {
  flex: 1;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
}

#download-btn, #new-project-btn-bottom {
  background: var(--input-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--ai-text);
}

#improve-btn {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: var(--bg);
}

/* Modal Styles */
.custom-confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.custom-confirm-dialog {
  background: var(--input-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 24px;
  max-width: 400px;
  width: 90%;
  text-align: center;
}

.custom-confirm-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--ai-text);
}

.custom-confirm-message {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 20px;
  line-height: 1.4;
}

.custom-confirm-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.custom-confirm-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  font-size: 14px;
}

.custom-confirm-btn.primary {
  background: var(--accent);
  color: var(--bg);
}

.custom-confirm-btn.secondary {
  background: transparent;
  color: var(--ai-text);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Tooltips and Previews */
.mode-preview {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--bg);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  z-index: 60;
  animation: fadeInUp 220ms ease;
  display: none;
}

.command-tooltip {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--bg);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  z-index: 70;
  animation: fadeInUp 220ms ease;
  display: none;
  margin-top: 8px;
  white-space: nowrap;
}

.command-tooltip::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-bottom-color: var(--accent);
}

.command-tooltip.ultra {
  background: #ff4444;
  color: #ffffff;
}

.command-tooltip.ultra::after {
  border-bottom-color: #ff4444;
}
