/* =============================================
   GLS PLATFORM — Phase 1 Stylesheet
   Design: Dark professional with gold accents
   ============================================= */

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

:root {
  --bg-base:       #080d1a;
  --bg-surface:    #0e1628;
  --bg-elevated:   #151f35;
  --bg-card:       #1a2540;
  --border:        rgba(255,255,255,0.07);
  --border-hover:  rgba(255,255,255,0.14);
  --accent:        #c9a84c;
  --accent-dim:    rgba(201,168,76,0.12);
  --accent-glow:   rgba(201,168,76,0.25);
  --blue:          #3b82f6;
  --blue-dim:      rgba(59,130,246,0.12);
  --text-primary:  #f0f4ff;
  --text-secondary:#8a9bbf;
  --text-muted:    #4a5878;
  --green:         #22c55e;
  --sidebar-w:     240px;
  --header-h:      64px;
  --radius:        12px;
  --radius-sm:     8px;
  --font-display:  'Syne', sans-serif;
  --font-body:     'DM Sans', sans-serif;
}

html { font-size: 16px; }

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

/* ===== LIGHT MODE ===== */
body.light {
  --bg-base:       #f0f2f8;
  --bg-surface:    #ffffff;
  --bg-elevated:   #f5f6fa;
  --bg-card:       #ffffff;
  --border:        rgba(0,0,0,0.08);
  --border-hover:  rgba(0,0,0,0.15);
  --accent:        #a87c20;
  --accent-dim:    rgba(168,124,32,0.1);
  --accent-glow:   rgba(168,124,32,0.2);
  --blue:          #2563eb;
  --blue-dim:      rgba(37,99,235,0.08);
  --text-primary:  #111827;
  --text-secondary:#4b5563;
  --text-muted:    #9ca3af;
  --green:         #16a34a;
}

/* ===== THEME TOGGLE BUTTON ===== */
.theme-toggle {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-hover);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  margin-right: 0.5rem;
}
.theme-toggle:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 4px; }

/* ===== HEADER ===== */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  backdrop-filter: blur(12px);
}

.header-inner {
  max-width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
}

.brand { display: flex; align-items: center; gap: 0.875rem; }

.brand-logo {
  display: flex;
  align-items: center;
  gap: 1px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.5rem;
}

.brand-logo span {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  line-height: 1;
}
.logo-g { color: var(--accent); }
.logo-l { color: var(--text-primary); }
.logo-s { color: var(--blue); }

.brand-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.brand-tagline {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 300;
  letter-spacing: 0.02em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2s infinite;
}

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

.status-label {
  font-size: 0.75rem;
  color: var(--green);
  font-weight: 500;
}

/* ===== MAIN LAYOUT ===== */
.main {
  display: flex;
  margin-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 0;
  overflow-y: auto;
}

.nav { flex: 1; padding: 0 0.75rem; }

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 0.75rem;
  margin-bottom: 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 400;
  transition: all 0.15s ease;
  margin-bottom: 0.15rem;
}

.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }

.nav-item:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(201,168,76,0.2);
}

.nav-item.active svg { stroke: var(--accent); }

.sidebar-footer {
  padding: 1rem 1.5rem 0;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
}

.phase-badge {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.3rem 0.75rem;
  display: inline-block;
}

/* ===== CONTENT AREA ===== */
.content-area {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--header-h));
}

/* ===== PAGES ===== */
.page { display: none; flex-direction: column; height: calc(100vh - var(--header-h)); }
.page.active { display: flex; }

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

/* ===== MODE TOGGLE ===== */
.mode-toggle {
  display: flex;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
}

.mode-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.875rem;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-btn.active {
  background: var(--accent);
  color: #080d1a;
}

.mode-btn:not(.active):hover {
  background: var(--border);
  color: var(--text-primary);
}

/* ===== MODE INDICATOR ===== */
.mode-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 2rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.mode-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.mode-dot.general { background: var(--blue); box-shadow: 0 0 6px var(--blue); }
.mode-dot.insurance { background: var(--accent); box-shadow: 0 0 6px var(--accent); }

/* ===== CHAT WINDOW ===== */
.chat-window {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ===== WELCOME ===== */
.chat-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 3rem 1rem;
  gap: 1rem;
  animation: fadeIn 0.4s ease;
}

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

.welcome-icon {
  width: 64px; height: 64px;
  background: var(--accent-dim);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.welcome-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
}

.welcome-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  max-width: 400px;
  line-height: 1.7;
}

.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.5rem;
}

.quick-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-hover);
  border-radius: 20px;
  padding: 0.4rem 1rem;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-btn:hover {
  background: var(--accent-dim);
  border-color: rgba(201,168,76,0.3);
  color: var(--accent);
}

/* ===== CHAT MESSAGES ===== */
.chat-message {
  display: flex;
  gap: 0.875rem;
  animation: fadeIn 0.3s ease;
}

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

.msg-avatar {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  font-family: var(--font-display);
}

.chat-message.user .msg-avatar {
  background: var(--blue-dim);
  color: var(--blue);
  border: 1px solid rgba(59,130,246,0.2);
}

.chat-message.ai .msg-avatar {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(201,168,76,0.2);
}

.msg-bubble {
  max-width: 75%;
  padding: 0.875rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  line-height: 1.75;
  position: relative;
}

.chat-message.user .msg-bubble {
  background: var(--blue-dim);
  border: 1px solid rgba(59,130,246,0.15);
  color: var(--text-primary);
  border-radius: var(--radius) var(--radius) 4px var(--radius);
}

.chat-message.ai .msg-bubble {
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  color: var(--text-primary);
  border-radius: var(--radius) var(--radius) var(--radius) 4px;
}

.msg-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.625rem;
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem 0.65rem;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.2s;
}

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

.copy-btn.copied {
  border-color: var(--green);
  color: var(--green);
}

/* ===== TYPING INDICATOR ===== */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 1rem 1.1rem;
}

.typing-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: typing 1.2s infinite;
}

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

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ===== INPUT AREA ===== */
.input-area {
  padding: 1rem 2rem 1.25rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-surface);
}

.input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  padding: 0.75rem 0.75rem 0.75rem 1.1rem;
  transition: border-color 0.2s;
}

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

.user-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  line-height: 1.6;
  resize: none;
  max-height: 140px;
  overflow-y: auto;
}

.user-input::placeholder { color: var(--text-muted); }

.generate-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: #080d1a;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.55rem 1.1rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  white-space: nowrap;
}

.generate-btn:hover { background: #d4a832; transform: translateY(-1px); }
.generate-btn:active { transform: translateY(0); }
.generate-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.input-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  padding-left: 0.25rem;
}

.input-hint kbd {
  background: var(--bg-elevated);
  border: 1px solid var(--border-hover);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-size: 0.65rem;
  font-family: monospace;
}

/* ===== COMING SOON ===== */
.coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  gap: 1rem;
  padding: 2rem;
  animation: fadeIn 0.3s ease;
}

.cs-icon { font-size: 3rem; }

.coming-soon h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.coming-soon p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  max-width: 360px;
  line-height: 1.7;
}

.cs-badge {
  background: var(--accent-dim);
  border: 1px solid rgba(201,168,76,0.25);
  color: var(--accent);
  border-radius: 20px;
  padding: 0.3rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ===== MOBILE NAV ===== */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 0.5rem 0 calc(0.5rem + env(safe-area-inset-bottom));
  z-index: 100;
}

.mob-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.65rem;
  font-weight: 500;
  padding: 0.3rem 0;
  transition: color 0.2s;
  flex: 1;
}

.mob-item.active { color: var(--accent); }
.mob-item:hover { color: var(--text-primary); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .content-area { margin-left: 0; }
  .mobile-nav { display: flex; }
  .page { height: calc(100vh - var(--header-h) - 65px); }
  .page-header { padding: 1rem; flex-wrap: wrap; gap: 0.75rem; }
  .chat-window { padding: 1rem; }
  .input-area { padding: 0.75rem 1rem 1rem; }
  .brand-tagline { display: none; }
  .msg-bubble { max-width: 88%; }
  .mode-btn { padding: 0.4rem 0.6rem; font-size: 0.75rem; }
}

@media (max-width: 480px) {
  .quick-prompts { flex-direction: column; align-items: center; }
  .quick-btn { width: 100%; max-width: 280px; }
}

/* =============================================
   PHASE 2 — CONTENT ENGINE STYLES
   ============================================= */

.tone-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tone-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.tone-select {
  background: var(--bg-elevated);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.tone-select:focus { border-color: var(--accent); }

.content-engine-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.ce-section-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.ce-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.875rem;
}

.ce-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  font-family: var(--font-body);
}

.ce-btn:hover {
  background: var(--accent-dim);
  border-color: rgba(201,168,76,0.3);
  transform: translateY(-2px);
}

.ce-btn:active { transform: translateY(0); }

.ce-btn-icon {
  width: 42px;
  height: 42px;
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
  transition: background 0.2s;
}

.ce-btn:hover .ce-btn-icon {
  background: var(--accent-dim);
  border-color: rgba(201,168,76,0.3);
}

.ce-btn-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.ce-btn-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.ce-btn-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* OUTPUT AREA */
.ce-output {
  background: var(--bg-elevated);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  overflow: hidden;
  animation: fadeInUp 0.3s ease;
}

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

.ce-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.ce-output-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.ce-output-text {
  padding: 1.1rem;
  font-size: 0.875rem;
  line-height: 1.8;
  color: var(--text-primary);
  white-space: pre-wrap;
  min-height: 120px;
}

/* Loading state */
.ce-btn.loading {
  opacity: 0.7;
  pointer-events: none;
}

@media (max-width: 768px) {
  .content-engine-body { padding: 1rem; }
  .ce-buttons { grid-template-columns: 1fr 1fr; gap: 0.625rem; }
  .ce-btn { padding: 0.75rem; gap: 0.625rem; }
  .ce-btn-icon { width: 36px; height: 36px; }
  .tone-selector { display: none; }
}

@media (max-width: 480px) {
  .ce-buttons { grid-template-columns: 1fr; }
}

/* =============================================
   GLS PLATFORM LOGO SVG STYLES
   ============================================= */

.brand-svg {
  flex-shrink: 0;
}

.gls-text {
  fill: #ffffff;
  transition: fill 0.3s ease;
}

.gls-accent {
  fill: #4a9eff;
  transition: fill 0.3s ease;
}

.gls-platform {
  fill: #4a9eff;
  letter-spacing: .22em;
  transition: fill 0.3s ease;
}

.gls-bar {
  fill: rgba(74,158,255,0.25);
  transition: fill 0.3s ease;
}

body.light .gls-text { fill: #0f172a; }
body.light .gls-accent { fill: #2563eb; }
body.light .gls-platform { fill: #2563eb; }
body.light .gls-bar { fill: rgba(37,99,235,0.2); }

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-tagline {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 300;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .brand-tagline { display: none; }
  .brand-svg { width: 140px; height: 38px; }
}
