/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:             #0a0908;
  --bg-chat:        #0d0c0b;
  --bg-msg:         #141210;
  --bg-input:       #171513;
  --border:         #242220;
  --border-light:   #1e1c1a;
  --accent:         #e8c547;
  --accent-dim:     #c4a53a;
  --text-primary:   #f0ede8;
  --text-secondary: #7a7672;
  --text-hint:      #3d3b38;
  --radius:         10px;
  --radius-msg:     15px;
}

html, body {
  height: 100%;
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== LAYOUT ===== */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ===== HEADER ===== */
.chat-header {
  padding: 0 36px;
  height: 56px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  flex-shrink: 0;
  z-index: 10;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 9px;
}

.brand-mark {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  flex-shrink: 0;
}

.logo-text {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.logo-sep {
  color: var(--border);
  font-size: 14px;
  line-height: 1;
  margin: 0 -2px;
}

.logo-by {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

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

.header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.status-dot {
  width: 6px;
  height: 6px;
  background: #4ade80;
  border-radius: 50%;
  animation: pulse 2.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.new-chat-btn {
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.1px;
}

.new-chat-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(232,197,71,0.04);
}

/* ===== CHAT AREA ===== */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ===== MESSAGES ===== */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 36px 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  scroll-behavior: smooth;
}

.messages-container::-webkit-scrollbar { width: 3px; }
.messages-container::-webkit-scrollbar-track { background: transparent; }
.messages-container::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ===== WELCOME SCREEN ===== */
.welcome-screen {
  margin: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 80px 24px;
  max-width: 520px;
  width: 100%;
  position: relative;
  overflow: hidden;
}

/* Subtle dot grid background */
.welcome-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  z-index: 0;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 30%, transparent 100%);
  pointer-events: none;
}

.welcome-badge {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 5px 14px 5px 10px;
  background: var(--bg-msg);
}

.welcome-badge svg { color: var(--accent); flex-shrink: 0; }

.welcome-hero {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.welcome-screen h2 {
  font-size: 54px;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.08;
  letter-spacing: -2px;
}

.welcome-accent {
  color: var(--accent);
}

.welcome-screen p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 360px;
  margin: 0 auto;
  font-weight: 400;
}

.start-btn {
  position: relative;
  z-index: 1;
  padding: 12px 30px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.1px;
}

.start-btn:hover {
  background: #f0d060;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(232,197,71,0.25);
}

/* ===== MESSAGE BUBBLES ===== */
.message {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  max-width: 740px;
  width: 100%;
  margin: 0 auto;
  padding: 0 36px;
  animation: fadeIn 0.2s ease;
}

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

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

.message-avatar {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: 0.2px;
}

.message.assistant .message-avatar {
  background: var(--accent);
  color: #000;
}

.message.user .message-avatar {
  background: #1c1a18;
  color: var(--text-secondary);
}

.message-bubble {
  padding: 12px 16px;
  border-radius: var(--radius-msg);
  font-size: 14.5px;
  line-height: 1.65;
  max-width: calc(100% - 44px);
}

.message.assistant .message-bubble {
  background: var(--bg-msg);
  border: 1px solid var(--border-light);
  border-top-left-radius: 4px;
  color: var(--text-primary);
}

.message.user .message-bubble {
  background: var(--accent);
  color: #000;
  border-top-right-radius: 4px;
  font-weight: 500;
}

.message-bubble strong { font-weight: 700; }
.message-bubble em { font-style: italic; }

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  max-width: 740px;
  width: 100%;
  margin: 0 auto;
  padding: 0 36px;
  animation: fadeIn 0.2s ease;
}

.typing-dots {
  background: var(--bg-msg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-msg);
  border-top-left-radius: 4px;
  padding: 14px 16px;
  display: flex;
  gap: 5px;
  align-items: center;
}

.typing-dots span {
  width: 5px;
  height: 5px;
  background: var(--text-hint);
  border-radius: 50%;
  animation: bounce 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-5px); }
}

/* ===== INPUT AREA ===== */
.input-area {
  padding: 14px 36px 20px;
  max-width: 812px;
  width: 100%;
  margin: 0 auto;
  align-self: stretch;
}

.input-wrapper {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 13px;
  transition: border-color 0.15s;
}

.input-wrapper:focus-within {
  border-color: rgba(232,197,71,0.35);
}

textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 14.5px;
  font-family: inherit;
  resize: none;
  max-height: 160px;
  line-height: 1.5;
}

textarea::placeholder { color: var(--text-hint); }

.send-btn {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border: none;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}

.send-btn:hover:not(:disabled) {
  background: #f0d060;
  transform: scale(1.05);
}

.send-btn:disabled { background: var(--border); cursor: not-allowed; }
.send-btn svg { width: 14px; height: 14px; stroke: #000; }
.send-btn:disabled svg { stroke: var(--text-hint); }

.upload-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 7px;
  transition: background 0.15s;
  opacity: 0.4;
}
.upload-btn:hover { background: var(--border); opacity: 1; }
.upload-btn svg { width: 16px; height: 16px; stroke: var(--text-secondary); }
.upload-btn.active { opacity: 1; }

.message-bubble img {
  max-width: 220px;
  max-height: 220px;
  border-radius: 9px;
  display: block;
  margin-top: 6px;
  object-fit: cover;
}

.input-hint {
  font-size: 10.5px;
  color: var(--text-hint);
  margin-top: 7px;
  text-align: center;
}

/* ===== BRIEF STYLES ===== */
.brief-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brief-title {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 2px;
  text-transform: uppercase;
  padding-bottom: 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brief-copy-btn {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.brief-copy-btn:hover { color: var(--accent); border-color: var(--accent); }

.brief-section { font-size: 13px; line-height: 1.7; color: var(--text-primary); }
.brief-section-title { font-weight: 600; color: var(--text-secondary); }
.brief-section-title::after { content: ': '; }
.brief-value { color: var(--text-primary); }

.propuesta-card {
  padding: 9px 12px;
  border-left: 2px solid var(--accent);
  margin: 6px 0 2px;
  background: #111009;
  border-radius: 0 6px 6px 0;
}

.propuesta-nombre {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.propuesta-card .brief-value { font-size: 13px; color: var(--text-secondary); }

.brief-question {
  margin-top: 10px;
  background: var(--accent);
  color: #000;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 8px;
}

.brief-intro {
  font-size: 13px;
  color: var(--text-secondary);
  font-style: italic;
  padding-bottom: 4px;
}

.list-item {
  display: block;
  padding-left: 12px;
  position: relative;
  line-height: 1.8;
}

.list-item::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 600;
}

/* ===== MOCKUP ===== */
.mockup-bubble { padding: 13px !important; max-width: 320px !important; }

.mockup-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  margin-bottom: 10px;
}

.mockup-img {
  width: 100%;
  border-radius: 9px;
  display: block;
  border: 1px solid var(--border);
  cursor: zoom-in;
}

.mockup-download {
  display: block;
  margin-top: 10px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 7px;
  transition: all 0.15s;
}

.mockup-download:hover {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

/* ===== LIGHTBOX ===== */
.lightbox { display: none; position: fixed; inset: 0; z-index: 1000; align-items: center; justify-content: center; }
.lightbox.open { display: flex; }

.lightbox-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(8px);
}

.lightbox-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox-content img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6);
}

.lightbox-close {
  position: absolute;
  top: -44px;
  right: 0;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 20px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  transition: color 0.15s;
}
.lightbox-close:hover { color: #fff; }

.lightbox-download-btn {
  padding: 10px 26px;
  background: var(--accent);
  color: #000;
  font-weight: 700;
  font-size: 13px;
  font-family: inherit;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s;
}
.lightbox-download-btn:hover { background: #f0d060; }

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .chat-header { padding: 0 20px; }
  .logo-sep, .logo-by { display: none; }
  .messages-container { padding: 20px 0; }
  .message, .typing-indicator { padding: 0 16px; }
  .input-area { padding: 12px 16px 16px; }
  .welcome-screen h2 { font-size: 36px; }
}
