/* ============================================
   Jean&Len Marketing Suite – Styles v2
   Redesign: Hoher Kontrast, klare Lesbarkeit
   ============================================ */

:root {
  /* Brand Colors */
  --bg: #F7F8FA;
  --sidebar-bg: #1A1B2E;
  --sidebar-hover: #2A2B3E;
  --sidebar-text: #C8CDD5;

  /* Pink Theme – kräftiger für Lesbarkeit */
  --pink: #D4608A;
  --pink-light: #FDF0F5;
  --pink-medium: #E899B5;
  --pink-dark: #B8406E;
  --pink-glow: rgba(212, 96, 138, 0.12);

  /* Neutrals – deutlich höherer Kontrast */
  --text: #111827;
  --text-secondary: #374151;
  --text-muted: #6B7280;
  --white: #FFFFFF;
  --border: #E5E7EB;
  --border-light: #F3F4F6;

  /* Functional */
  --success: #059669;
  --success-light: #ECFDF5;
  --info: #2563EB;
  --info-light: #EFF6FF;

  /* Sizing */
  --sidebar-width: 260px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-pink: 0 4px 14px rgba(212, 96, 138, 0.2);
}

/* ============================================
   Reset & Base
   ============================================ */

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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   App Layout
   ============================================ */

.app {
  display: flex;
  height: 100vh;
  width: 100%;
}

/* ============================================
   Sidebar
   ============================================ */

.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.3px;
}

.brand-sub {
  font-size: 11px;
  font-weight: 600;
  color: var(--pink);
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Navigation */
.sidebar-nav {
  flex: 1;
  padding: 16px 10px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 8px 12px 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 2px;
  position: relative;
  user-select: none;
}

.nav-item:hover:not(.disabled) {
  background: var(--sidebar-hover);
  color: var(--white);
}

.nav-item.active {
  background: var(--pink);
  color: var(--white);
  font-weight: 500;
}

.nav-item.active .nav-icon {
  stroke: var(--white);
}

.nav-item.disabled {
  opacity: 0.35;
  cursor: default;
}

.nav-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  stroke: var(--sidebar-text);
}

.nav-item.active .nav-icon {
  stroke: var(--white);
}

.badge {
  margin-left: auto;
  font-size: 9px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 14px 20px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.data-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.status-icon {
  width: 15px;
  height: 15px;
  stroke: var(--success);
  flex-shrink: 0;
}

.status-text {
  display: flex;
  flex-direction: column;
}

.status-label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
}

.status-date {
  font-size: 12px;
  color: var(--sidebar-text);
  font-weight: 500;
}

.footer-meta {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 25px;
}

.dot {
  opacity: 0.5;
}

.sidebar-impressum {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
  line-height: 1.5;
}

.sidebar-impressum a {
  color: rgba(255, 255, 255, 0.4);
  text-decoration: none;
}

.sidebar-impressum a:hover {
  color: var(--pink);
}

/* ============================================
   Mobile Header
   ============================================ */

.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--sidebar-bg);
  color: var(--white);
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  z-index: 90;
}

.menu-toggle {
  background: none;
  border: none;
  color: var(--white);
  cursor: pointer;
  padding: 8px;
  margin: -8px;
}

.menu-toggle svg {
  width: 22px;
  height: 22px;
}

.mobile-title {
  font-size: 15px;
  font-weight: 600;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
}

/* ============================================
   Main Content
   ============================================ */

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
}

/* Header */
.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.header-text h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.header-text p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 1px;
}

.header-stats {
  display: flex;
  gap: 16px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 16px;
  background: var(--pink-light);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(212, 96, 138, 0.1);
}

.stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--pink-dark);
}

.stat-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================
   Chat Container
   ============================================ */

.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg);
}

/* Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
  width: 5px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: #D1D5DB;
}

/* Message Styles */
.message {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  max-width: 85%;
  animation: messageIn 0.25s ease-out;
}

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

.message.bot {
  align-self: flex-start;
}

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

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.message.bot .avatar {
  background: var(--pink-light);
  border: 1px solid rgba(212, 96, 138, 0.15);
}

.message.bot .avatar svg {
  width: 16px;
  height: 16px;
  stroke: var(--pink-dark);
}

.message.user .avatar {
  background: var(--sidebar-bg);
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
}

.bubble {
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  line-height: 1.65;
  position: relative;
}

.message.bot .bubble {
  background: var(--white);
  border: 1px solid var(--border);
  border-top-left-radius: 4px;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.message.user .bubble {
  background: var(--sidebar-bg);
  color: var(--white);
  border-top-right-radius: 4px;
  box-shadow: var(--shadow-md);
}

.bubble-content strong {
  font-weight: 600;
  color: var(--text);
}

.example-list {
  margin: 8px 0 0 0;
  padding-left: 0;
  list-style: none;
}

.example-list li {
  padding: 3px 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.example-list li::before {
  content: "\2192  ";
  color: var(--pink);
  font-weight: 600;
}

/* ============================================
   Article Results in Chat
   ============================================ */

.result-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-light);
}

.result-header .result-icon {
  width: 18px;
  height: 18px;
  stroke: var(--pink-dark);
}

.result-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.result-header .result-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--pink-dark);
  background: var(--pink-light);
  padding: 2px 10px;
  border-radius: 10px;
}

.article-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.article-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 6px 0;
  border-bottom: 2px solid var(--border);
}

.article-table td {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
  color: var(--text);
}

.article-table tr:last-child td {
  border-bottom: none;
}

.article-table .sku {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 12px;
  color: var(--pink-dark);
  font-weight: 600;
  white-space: nowrap;
  padding-right: 16px;
  width: 130px;
}

.article-table .article-name {
  color: var(--text);
  font-weight: 400;
}

.article-table .article-category {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  padding-left: 12px;
  text-align: right;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 7px 16px;
  background: var(--white);
  color: var(--pink-dark);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.copy-btn:hover {
  background: var(--pink-dark);
  color: var(--white);
  border-color: var(--pink-dark);
  box-shadow: var(--shadow-pink);
}

.copy-btn.copied {
  background: var(--success-light);
  color: var(--success);
  border-color: var(--success);
}

.copy-btn svg {
  width: 14px;
  height: 14px;
}

/* Multi-Produkt-Blöcke */
.multi-block {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.multi-block:first-of-type {
  border-top: none;
  padding-top: 4px;
}

.multi-block-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.multi-block-title .multi-q {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.multi-block-title .multi-count {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--pink-dark);
  background: var(--pink-light);
  padding: 2px 8px;
  border-radius: 10px;
}

.multi-count-empty {
  color: var(--text-muted);
  background: var(--border-light);
}

.multi-block-empty .multi-q {
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-color: var(--border);
}

.multi-note {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

.multi-hint {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--info-light);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Category overview */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.category-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid var(--border);
}

.category-card:hover {
  border-color: var(--pink);
  background: var(--pink-light);
  box-shadow: var(--shadow-sm);
}

.category-card .cat-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.category-card .cat-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--pink-dark);
  background: var(--pink-light);
  padding: 1px 8px;
  border-radius: 8px;
}

/* No results */
.no-results {
  text-align: center;
  padding: 16px 0;
  color: var(--text-secondary);
}

.no-results .no-results-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.no-results p {
  font-size: 13px;
  color: var(--text-secondary);
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 10px;
}

.suggestions button {
  font-size: 12px;
  padding: 5px 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.15s ease;
}

.suggestions button:hover {
  background: var(--pink-light);
  border-color: var(--pink);
  color: var(--pink-dark);
}

/* ============================================
   Typing Indicator
   ============================================ */

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 8px 4px;
}

.typing-indicator .dot {
  width: 7px;
  height: 7px;
  background: var(--pink);
  border-radius: 50%;
  animation: typingBounce 1.4s ease-in-out infinite;
  opacity: 0.7;
}

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

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

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

/* ============================================
   Quick Actions
   ============================================ */

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 32px;
  border-top: 1px solid var(--border);
  background: var(--white);
}

.chip {
  padding: 7px 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  white-space: nowrap;
}

.chip:hover {
  background: var(--pink-dark);
  color: var(--white);
  border-color: var(--pink-dark);
  box-shadow: var(--shadow-pink);
  transform: translateY(-1px);
}

/* ============================================
   Input Area
   ============================================ */

.chat-input-container {
  padding: 16px 32px 18px;
  background: var(--white);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.input-wrapper {
  display: flex;
  align-items: flex-end;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 28px;
  padding: 4px 4px 4px 20px;
  transition: all 0.2s ease;
}

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

#chatInput {
  flex: 1;
  border: none;
  background: none;
  font-size: 14px;
  color: var(--text);
  outline: none;
  font-family: inherit;
  padding: 10px 0;
  resize: none;
  line-height: 1.4;
  max-height: 140px;
  overflow-y: auto;
}

#chatInput::placeholder {
  color: var(--text-muted);
}

.send-btn {
  width: 42px;
  height: 42px;
  border: none;
  background: var(--pink-dark);
  color: var(--white);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.send-btn:hover {
  background: var(--pink);
  transform: scale(1.05);
  box-shadow: var(--shadow-pink);
}

.send-btn:active {
  transform: scale(0.95);
}

.send-btn svg {
  width: 17px;
  height: 17px;
}

.input-hint {
  display: block;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
}

.made-with-love {
  text-align: center;
  font-size: 11px;
  color: var(--pink);
  margin-top: 4px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    z-index: 100;
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.visible {
    display: block;
  }

  .mobile-header {
    display: flex;
  }

  .main-content {
    padding-top: 56px;
  }

  .main-header {
    padding: 14px 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .header-stats {
    align-self: stretch;
  }

  .stat {
    flex: 1;
  }

  .chat-messages {
    padding: 16px 20px;
  }

  .quick-actions {
    padding: 12px 20px;
  }

  .chat-input-container {
    padding: 12px 20px 16px;
  }

  .message {
    max-width: 95%;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .header-text h1 {
    font-size: 16px;
  }

  .chip {
    font-size: 12px;
    padding: 5px 12px;
  }
}
