/* Dedicated Styles for Gemini Chat Workspace (index.html) - Ultra Beautified & Responsive */
.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  scroll-behavior: smooth;
}

.welcome-container {
  max-width: 780px;
  width: 100%;
  margin: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 36px 32px;
  background: #ffffff;
  border: var(--border-width) solid var(--border-color);
  box-shadow: var(--shadow-hard);
  border-radius: 18px;
  animation: fadeInWelcome 0.3s ease-out;
}

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

.welcome-logo {
  width: 72px;
  height: 72px;
  background: var(--neo-yellow);
  border: var(--border-width) solid var(--border-color);
  box-shadow: 5px 5px 0px #000;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  transition: transform 0.2s ease;
}

.welcome-logo:hover {
  transform: rotate(-5deg) scale(1.05);
}

.welcome-title {
  font-size: 26px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  color: #000;
}

.welcome-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 600px;
}

.suggestion-chips {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  width: 100%;
  margin-top: 12px;
}

.chip-item {
  padding: 16px;
  background: #ffffff;
  border: var(--border-width) solid var(--border-color);
  box-shadow: 4px 4px 0px #000;
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.chip-item:hover {
  background: var(--neo-cyan);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px #000;
}

.chip-title {
  font-weight: 800;
  font-size: 14px;
  display: block;
  margin-bottom: 4px;
  color: #000;
}

.chip-sub {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Chat Messages Rows & Bubbles */
#messagesContainer {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding-bottom: 90px;
}

.msg-row {
  display: flex;
  width: 100%;
  gap: 12px;
  animation: fadeInMsg 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.msg-row.user {
  justify-content: flex-end;
  align-items: flex-start;
}

.msg-row.gemini {
  justify-content: flex-start;
  align-items: flex-start;
}

.msg-avatar {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: var(--border-width) solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 3px 3px 0px #000;
}

.msg-avatar.user {
  background: var(--neo-purple);
}

.msg-avatar.gemini {
  background: var(--neo-yellow);
}

.msg-bubble {
  border: var(--border-width) solid var(--border-color);
  border-radius: 14px;
  font-size: 14.5px;
  line-height: 1.7;
  word-break: break-word;
}

.msg-bubble.user {
  background: var(--neo-cyan);
  border-bottom-right-radius: 4px;
  color: #000;
  font-weight: 700;
  padding: 12px 18px;
  box-shadow: 4px 4px 0 #000;
  max-width: 75%;
  width: fit-content;
}

.msg-bubble.gemini {
  background: #ffffff;
  border-bottom-left-radius: 4px;
  color: #000;
  padding: 18px 22px;
  box-shadow: 5px 5px 0 #000;
  max-width: 85%;
  width: 100%;
}

.msg-bubble img {
  max-width: 100%;
  max-height: 380px;
  object-fit: contain;
  border-radius: 10px;
  border: 2px solid #000;
  box-shadow: 3px 3px 0 #000;
  margin: 6px 0;
  display: block;
}

.msg-bubble video {
  max-width: 100%;
  max-height: 340px;
  border-radius: 10px;
  border: 2px solid #000;
  box-shadow: 3px 3px 0 #000;
  margin: 6px 0;
  display: block;
}

.msg-bubble audio {
  max-width: 100%;
  margin: 6px 0;
}

/* Formatted Markdown Content inside Gemini Bubble */
.msg-bubble p {
  margin-bottom: 12px;
}

.msg-bubble p:last-child {
  margin-bottom: 0;
}

.msg-bubble h1, .msg-bubble h2, .msg-bubble h3, .msg-bubble h4 {
  margin-top: 16px;
  margin-bottom: 10px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #000;
  border-bottom: 2px solid #000;
  padding-bottom: 4px;
}

.msg-bubble ul, .msg-bubble ol {
  margin-left: 20px;
  margin-bottom: 12px;
}

.msg-bubble li {
  margin-bottom: 6px;
}

.msg-bubble blockquote {
  border-left: 5px solid #000;
  background: #ffeaa7;
  padding: 10px 16px;
  margin: 12px 0;
  border-radius: 6px;
  font-weight: 600;
  box-shadow: 2px 2px 0 #000;
}

.msg-bubble table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  border: 2px solid #000;
  font-size: 13px;
}

.msg-bubble th, .msg-bubble td {
  padding: 10px 14px;
  border: 1px solid #000;
}

.msg-bubble th {
  background: var(--neo-yellow);
  font-weight: 900;
  text-transform: uppercase;
}

/* Code Blocks Styling */
.msg-bubble pre {
  background: #181825;
  color: #cdd6f4;
  border: 2px solid #000;
  border-radius: 10px;
  margin: 14px 0;
  overflow-x: auto;
  box-shadow: 4px 4px 0 #000;
}

.msg-bubble pre code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  padding: 16px;
  display: block;
}

.msg-bubble code:not(pre code) {
  font-family: 'JetBrains Mono', monospace;
  background: #ffe600;
  color: #000;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 800;
  border: 1px solid #000;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #11111b;
  padding: 8px 14px;
  border-bottom: 2px solid #000;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #a6adc8;
  font-weight: 700;
}

.btn-copy-code {
  background: var(--neo-yellow);
  color: #000;
  border: 2px solid #000;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 2px 2px 0 #000;
  transition: transform 0.1s ease;
}

.btn-copy-code:hover {
  transform: translate(-1px, -1px);
}

/* AI Thinking Wave Animation */
.thinking-wave {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--neo-yellow);
  border: 2px solid #000;
  border-radius: 20px;
  box-shadow: 3px 3px 0 #000;
  font-weight: 800;
  font-size: 13px;
  color: #000;
}

.thinking-dots {
  display: flex;
  align-items: center;
  gap: 5px;
}

.thinking-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #000;
  border: 1px solid #000;
  animation: bounceWave 1.2s infinite ease-in-out;
}

.thinking-dot:nth-child(2) {
  animation-delay: 0.2s;
  background: var(--neo-cyan);
}

.thinking-dot:nth-child(3) {
  animation-delay: 0.4s;
  background: var(--neo-pink);
}

@keyframes bounceWave {
  0%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-8px);
  }
}

/* Floating Input Dock */
.floating-chat-footer {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 0 20px 20px 20px;
  background: transparent;
  z-index: 10;
}

.floating-input-dock {
  width: 100%;
  max-width: 900px;
  background: #ffffff;
  border: var(--border-width) solid var(--border-color);
  box-shadow: var(--shadow-hard);
  border-radius: 16px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow 0.2s ease;
}

.floating-input-dock:focus-within {
  box-shadow: 7px 7px 0px #000;
}

.chat-input {
  width: 100%;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.5;
  resize: none;
  max-height: 140px;
  background: transparent;
  color: #000;
}

.input-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 2px dashed #e2e8f0;
  padding-top: 10px;
}

.input-hint {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-send-neo {
  padding: 10px 22px;
  background: var(--neo-yellow);
  border: var(--border-width) solid var(--border-color);
  box-shadow: 4px 4px 0px #000;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 900;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  text-transform: uppercase;
}

.btn-send-neo:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0px #000;
  background: var(--neo-green);
}

.btn-send-neo:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0px #000;
}

/* Attached Files Preview Bar Neo Brutalism */
.attached-files-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  background: #f8f9fa;
  border: 2px solid #000;
  border-radius: 8px;
  margin-bottom: 8px;
}

.file-preview-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 2px solid #000;
  box-shadow: 2px 2px 0 #000;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  max-width: 220px;
}

.file-preview-thumb {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border: 1px solid #000;
  border-radius: 4px;
}

.file-preview-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.file-preview-remove {
  background: #ff4757;
  color: #fff;
  border: 1px solid #000;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
  font-weight: 900;
  margin-left: auto;
}

.file-preview-remove:hover {
  background: #ff6b81;
}

/* All-Screen Responsive Layout Fixes */
@media (max-width: 768px) {
  .chat-body {
    padding: 14px;
    gap: 14px;
  }
  .msg-row {
    gap: 8px;
  }
  .msg-bubble {
    max-width: 90%;
    padding: 14px 16px;
    font-size: 13.5px;
  }
  .floating-chat-footer {
    padding: 0 10px 10px 10px;
  }
  .floating-input-dock {
    padding: 10px 12px;
    border-radius: 12px;
  }
  .chat-header {
    padding: 0 12px;
    height: 64px;
  }
  .active-chat-title {
    font-size: 14px;
  }
  .model-select-dropdown {
    font-size: 10px !important;
    padding: 4px 6px !important;
  }
}

@media (max-width: 480px) {
  .suggestion-chips {
    grid-template-columns: 1fr;
  }
  .msg-bubble {
    max-width: 94%;
  }
  .msg-avatar {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
  .input-hint {
    display: none;
  }
}

/* Image Studio Generating Animation Styles */
@keyframes genPulseSpin {
  0% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.18) rotate(10deg); }
  100% { transform: scale(1) rotate(0deg); }
}

@keyframes genShimmer {
  0% { opacity: 0.7; background-position: 0% 50%; }
  50% { opacity: 1; background-position: 100% 50%; }
  100% { opacity: 0.7; background-position: 0% 50%; }
}

.generating-studio-state {
  text-align: center;
  padding: 36px 20px;
  animation: fadeInWelcome 0.3s ease-out;
}

.gen-anim-spinner {
  font-size: 54px;
  margin-bottom: 14px;
  display: inline-block;
  animation: genPulseSpin 1.4s infinite ease-in-out;
  filter: drop-shadow(3px 3px 0 #000);
}
