/* claude-chat.html — page-specific styles */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0d12;
  --surface: #12171e;
  --surface2: #18202a;
  --border: #232d3c;
  --accent: #d4a853;
  --accent2: #e8c97a;
  --text: #dee3ea;
  --text-muted: #727f92;
  --user-bubble: #1c2430;
  --claude-bubble: #151b24;
  --glow: rgba(212, 168, 83, 0.12);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #0b0e13 0%, #141c28 100%);
  min-height: 100vh;
  color: #c9d2dc;
  line-height: 1.6;
}

.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar - from prompt.html */
.sidebar {
  width: 280px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  padding: 24px 0;
  box-shadow: 2px 0 25px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
  overflow-y: auto;
}

.sidebar.collapsed {
  width: 80px;
}

.logo {
  display: flex;
  align-items: center;
  font-size: 20px;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #ff6b00, #ff9933);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo img {
  height: 32px;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  background: none;
  color: white;
  width: 100%;
  text-align: left;
  position: relative;
  border-radius: 0 25px 25px 0;
  margin: 4px 0;
  font-family: inherit;
  font-size: 14px;
}

.nav-item.section-header {
  background: rgba(43,139,230,0.2);
  border-left: 4px solid #2b8be6;
  color: #2b8be6;
  font-weight: 600;
  margin: 8px 0 4px 0;
  box-shadow: 0 4px 15px rgba(43,139,230,0.2);
}

.nav-item.active-page {
  background: linear-gradient(135deg, rgba(43,139,230,0.3), rgba(84,104,242,0.3));
  border-left: 4px solid #5468f2;
  color: white;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(84,104,242,0.3);
}

.nav-item .material-icons {
  margin-right: 12px;
  font-size: 20px;
  flex-shrink: 0;
}

.sidebar.collapsed .nav-text {
  display: none;
}

.sidebar.collapsed .expand-icon {
  display: none;
}

.nav-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
}

.expand-icon {
  margin-left: auto;
  transition: transform 0.3s ease;
  font-size: 18px;
  flex-shrink: 0;
}

.nav-item.section-header.expanded .expand-icon {
  transform: rotate(90deg);
}

.nav-item.section-header.expanded {
  background: #26303f;
}

.nav-subitems {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: #26303f;
  backdrop-filter: blur(10px);
}

.nav-subitems.expanded {
  max-height: 1000px;
}

.sidebar.collapsed .nav-subitems {
  display: none;
}

.nav-subitems .nav-item {
  background: transparent;
  padding-left: 52px;
  font-weight: 400;
  margin: 2px 0;
}

.nav-subitems .nav-item:hover {
  background: rgba(255,255,255,0.1);
  transform: translateX(8px);
}

.nav-subitems .nav-item.active-page {
  background: rgba(84,104,242,0.2);
  border-left: 3px solid #5468f2;
}

/* Main content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,0.02);
  min-height: 100vh;
}

.header {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 20px 32px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
}

.header-title {
  font-size: 28px;
  font-weight: 700;
  margin-left: 20px;
  background: linear-gradient(135deg, #ff6b00, #ff9933);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.api-bar {
  display: none !important; /* Hidden per design */
  position: relative;
  z-index: 10;
  padding: 10px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  align-items: center;
  gap: 10px;
}

.api-bar label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  white-space: nowrap;
}

.api-bar input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  padding: 6px 12px;
  outline: none;
  transition: border-color 0.2s;
}

.api-bar input:focus {
  border-color: var(--accent);
}

.api-bar input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.api-bar button {
  background: var(--accent);
  color: #e4e8ed;
  border: none;
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
}

.api-bar button:hover { background: var(--accent2); }
.api-bar button:active { transform: scale(0.97); }

#chat-window {
  flex: 1;
  overflow-y: auto;
  padding: 28px 0;
  scroll-behavior: smooth;
  position: relative;
  z-index: 1;
}

#chat-window::-webkit-scrollbar { width: 5px; }
#chat-window::-webkit-scrollbar-track { background: transparent; }
#chat-window::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

.message-row {
  display: flex;
  padding: 8px 28px;
  gap: 14px;
  animation: fadeSlide 0.28s ease-out;
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
}

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

.message-row.user { flex-direction: row-reverse; }

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 600;
  margin-top: 2px;
}

.avatar.user-av {
  background: linear-gradient(135deg, #1a77d5, #125395);
  color: #c1dcf7;
}

.avatar.claude-av {
  background: linear-gradient(135deg, var(--accent), #8a5c1a);
}

.bubble {
  max-width: min(72%, 620px);
  padding: 13px 17px;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.65;
  position: relative;
}

.message-row.user .bubble {
  background: var(--user-bubble);
  border: 1px solid #293546;
  border-top-right-radius: 4px;
}

.message-row.assistant .bubble {
  background: var(--claude-bubble);
  border: 1px solid var(--border);
  border-top-left-radius: 4px;
}

.bubble code {
  font-family: 'DM Mono', monospace;
  font-size: 0.83em;
  background: rgba(212,168,83,0.1);
  border: 1px solid rgba(212,168,83,0.2);
  border-radius: 4px;
  padding: 1px 5px;
}

.bubble pre {
  background: #0b0e12;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  margin-top: 10px;
  font-family: 'DM Mono', monospace;
  font-size: 0.82em;
  line-height: 1.6;
}

.bubble pre code {
  background: none;
  border: none;
  padding: 0;
}

.sender-name {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.message-row.user .sender-name { text-align: right; }

/* Thinking / streaming indicator */
.thinking-row .bubble {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px 17px;
}

.dot-flashing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  animation: blink 1.2s ease-in-out infinite;
}

.dot-flashing span:nth-child(2) { animation-delay: 0.2s; }
.dot-flashing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
  0%, 80%, 100% { opacity: 0.2; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1); }
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 14px;
  color: var(--text-muted);
  text-align: center;
  padding: 40px;
}

.empty-state .big-icon {
  font-family: Georgia, serif;
  font-size: 2.6rem;
  color: var(--accent);
  opacity: 0.5;
}

.empty-state p {
  font-size: 0.88rem;
  max-width: 320px;
  line-height: 1.6;
}

.empty-state .suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
}

.suggestion-chip {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.suggestion-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--glow);
}

/* Input area */
.input-area {
  position: relative;
  z-index: 10;
  padding: 16px 28px 20px;
  border-top: 1px solid var(--border);
  background: rgba(10,13,18,0.9);
  backdrop-filter: blur(12px);
}

.input-wrapper {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 10px 10px 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--glow);
}

#user-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  line-height: 1.55;
  resize: none;
  max-height: 160px;
  min-height: 24px;
}

#user-input::placeholder { color: var(--text-muted); opacity: 0.6; }

#send-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent);
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.1s, opacity 0.2s;
}

#send-btn:hover { background: var(--accent2); }
#send-btn:active { transform: scale(0.93); }
#send-btn:disabled { opacity: 0.35; cursor: not-allowed; }

#send-btn svg { width: 16px; height: 16px; }

.input-hint {
  max-width: 860px;
  margin: 7px auto 0;
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.6;
  text-align: center;
}

/* Content + card layout (prompt.html / prompt-claude style) */
.content {
  padding: 32px;
  flex: 1;
  overflow-y: auto;
}
.card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  margin-bottom: 32px;
  overflow: hidden;
}
.card-header {
  padding: 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, rgba(43,139,230,0.1), rgba(84,104,242,0.1));
}
.card-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #f2f5f9;
}
.card-subtitle {
  color: #8c99a8;
  font-size: 16px;
}
.card-content {
  padding: 32px;
}
.prompt-input {
  width: 100%;
  min-height: 120px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  color: #f2f5f9;
  resize: vertical;
  transition: all 0.3s ease;
}
.prompt-input:focus {
  outline: none;
  border-color: #2b8be6;
  box-shadow: 0 0 0 4px rgba(43,139,230,0.1);
}

.results-textbox {
  width: 100%;
  min-height: 280px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  color: #f2f5f9;
  resize: vertical;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.results-textbox:focus {
  outline: none;
  border-color: #2b8be6;
}
.results-textbox::placeholder {
  color: #838f9f;
}
.results-label {
  font-size: 14px;
  font-weight: 600;
  color: #8c99a8;
  margin-bottom: 12px;
  display: block;
}
.prompt-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  margin-bottom: 24px;
}
.btn {
  padding: 16px 32px;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  min-width: 140px;
  height: 56px;
  justify-content: center;
}
.btn-primary {
  background: linear-gradient(135deg, #2b8be6, #5468f2);
  color: white;
  box-shadow: 0 4px 15px rgba(43,139,230,0.3);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(43,139,230,0.4);
}
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.loading-dots::after {
  content: '';
  animation: dots 1.5s steps(4, end) infinite;
}
@keyframes dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}
.error-text {
  color: #f87171;
}

.error-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: #3a1a1a;
  border: 1px solid #6b2f2f;
  color: #f08080;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.83rem;
  z-index: 100;
  animation: fadeSlide 0.25s ease-out;
  max-width: 400px;
  text-align: center;
}

@media (max-width: 768px) {
  .sidebar {
    width: 80px;
    background: #26303f;
  }
  .sidebar .nav-text {
    display: none;
  }
  .header-title {
    font-size: 20px;
  }
}
