/* ============================================================
   Angebotsmanager – Globales Stylesheet
   Modern Sidebar Layout, Mobile-first
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

/* --- CSS Variables --- */
:root {
  --accent:       #6366f1;
  --accent-dark:  #4f46e5;
  --accent-light: #eef2ff;
  --accent-glow:  rgba(99, 102, 241, 0.15);
  --danger:       #ef4444;
  --danger-light: #fef2f2;
  --text:         #0f172a;
  --text-secondary: #475569;
  --text-muted:   #94a3b8;
  --border:       #e2e8f0;
  --bg:           #f8fafc;
  --card:         #ffffff;
  --success:      #10b981;
  --success-light:#ecfdf5;
  --warning:      #f59e0b;
  --warning-light:#fffbeb;

  --sidebar-w:    260px;
  --sidebar-bg:   #1e1b4b;
  --sidebar-text: #c7d2fe;
  --sidebar-active: #6366f1;
  --sidebar-hover: rgba(99, 102, 241, 0.15);
  --topbar-h:     64px;

  --radius:       16px;
  --radius-sm:    10px;
  --radius-xs:    6px;
  --shadow:       0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:    0 4px 6px rgba(0,0,0,0.05), 0 10px 15px rgba(0,0,0,0.04);
  --shadow-lg:    0 10px 25px rgba(0,0,0,0.07), 0 20px 48px rgba(0,0,0,0.05);
  --transition:   0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand .brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.sidebar-brand h2 {
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav .nav-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.35);
  padding: 16px 12px 6px;
}

.sidebar-nav .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background var(--transition), color var(--transition);
  font-family: inherit;
}

.sidebar-nav .nav-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.sidebar-nav .nav-item.active {
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.sidebar-nav .nav-item .nav-icon {
  font-size: 1.15rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-footer .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background var(--transition), color var(--transition);
  font-family: inherit;
}

.sidebar-footer .nav-item:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

/* Sidebar Overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 190;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.sidebar-overlay.show {
  display: block;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: var(--sidebar-w);
  height: var(--topbar-h);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Hamburger Button (mobile only) */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 1.4rem;
  transition: background var(--transition);
}

.hamburger-btn:hover {
  background: var(--accent-light);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  margin-left: var(--sidebar-w);
  padding-top: var(--topbar-h);
  min-height: 100vh;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 28px 24px 48px;
}

/* ============================================================
   MOBILE (< 768px) – Sidebar als Overlay-Drawer
   ============================================================ */
@media (max-width: 767px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.3);
  }

  .topbar {
    left: 0;
    padding: 0 16px;
  }

  .hamburger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .main-content {
    margin-left: 0;
  }

  .container {
    padding: 20px 16px 40px;
  }
}

/* ============================================================
   CARD
   ============================================================ */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  border: 1px solid var(--border);
  transition: box-shadow var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-family: 'Inter', 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
  width: 100%;
  text-align: center;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  box-shadow: 0 4px 14px var(--accent-glow);
  text-decoration: none;
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.btn-outline:hover {
  background: var(--accent-light);
  text-decoration: none;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn-danger:hover {
  background: #dc2626;
  border-color: #dc2626;
  text-decoration: none;
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 8px 14px;
}
.btn-ghost:hover {
  background: var(--bg);
  color: var(--text);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* ============================================================
   INPUT GROUP
   ============================================================ */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.input-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.input-group input,
.input-group select,
.input-group textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Inter', 'DM Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-group input::placeholder,
.input-group textarea::placeholder {
  color: var(--text-muted);
}

/* ============================================================
   LEGACY HEADER + TAB BAR (hidden with sidebar)
   ============================================================ */
.header {
  display: none;
}

.tab-bar {
  display: none;
}

/* ============================================================
   MIC BUTTON
   ============================================================ */
.mic-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 4px 20px var(--accent-glow);
  transition: all var(--transition);
  position: relative;
}

.mic-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 28px rgba(99, 102, 241, 0.35);
}

.mic-btn.recording {
  animation: mic-pulse 1.2s ease-in-out infinite;
  background: linear-gradient(135deg, var(--danger), #dc2626);
}

@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.45); }
  50%       { box-shadow: 0 0 0 18px rgba(239, 68, 68, 0); }
}

/* ============================================================
   RESULT TABLE
   ============================================================ */
.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin-top: 12px;
}

.result-table th,
.result-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.result-table th {
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.result-table tfoot td {
  font-weight: 700;
  border-top: 2px solid var(--border);
  border-bottom: none;
}

/* ============================================================
   FOLDER GRID
   ============================================================ */
.folder-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
}

.folder-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  border: 1.5px solid transparent;
}

.folder-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--accent-light);
}

.folder-card .folder-icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
  display: block;
}

.folder-card h4 {
  font-size: 0.875rem;
  color: var(--text);
}

/* ============================================================
   SPINNER
   ============================================================ */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 24px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   LANDING / HERO
   ============================================================ */
.hero {
  text-align: center;
  padding: 48px 0 32px;
}

.hero h1 {
  font-size: 1.75rem;
  margin-bottom: 16px;
  color: var(--text);
}

.hero p {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 28px;
  line-height: 1.65;
}

.features {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}

.feature-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
}

.feature-card .icon {
  font-size: 1.75rem;
  line-height: 1;
  flex-shrink: 0;
}

.feature-card h3 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============================================================
   LANGUAGE SWITCHER
   ============================================================ */
.lang-switch {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border-radius: 999px;
  padding: 3px;
  border: 1px solid var(--border);
}

.lang-switch button {
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Inter', 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}

.lang-switch button.active {
  background: var(--accent);
  color: #fff;
}

/* ============================================================
   ONBOARDING STEPS
   ============================================================ */
.steps {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 24px 0;
}

.step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  transition: background var(--transition), transform var(--transition);
}

.step-dot.active {
  background: var(--accent);
  transform: scale(1.3);
}

.step-dot.done {
  background: var(--success);
}

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.45;
  margin-bottom: 16px;
  display: none;
}

.alert.show {
  display: block;
}

.alert-error {
  background: var(--danger-light);
  color: #dc2626;
  border: 1px solid #fecaca;
}

.alert-success {
  background: var(--success-light);
  color: #059669;
  border: 1px solid #a7f3d0;
}

/* ============================================================
   FILE LIST
   ============================================================ */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.file-item:hover {
  border-color: var(--accent-light);
  box-shadow: var(--shadow-md);
}

.file-item .file-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item .file-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.text-center { text-align: center; }
.text-muted   { color: var(--text-muted); }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}

.auth-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

/* ============================================================
   CHECKOUT
   ============================================================ */
.checkout-summary {
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-bottom: 24px;
}

.checkout-summary .price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
  padding: 6px 0;
  border-bottom: 1px solid rgba(99, 102, 241, 0.15);
}

.checkout-summary .price-row:last-child {
  border-bottom: none;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--accent);
  padding-top: 12px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ============================================================
   LOGO MARK
   ============================================================ */
.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-radius: 14px;
  font-size: 1.5rem;
  margin-bottom: 16px;
}

/* ============================================================
   LEGAL FOOTER
   ============================================================ */
.legal-footer {
  text-align: center;
  padding: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 32px;
}

.legal-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.legal-footer a:hover {
  color: var(--accent);
}

/* ============================================================
   STATUS BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-success {
  background: var(--success-light);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-light);
  color: var(--warning);
}

.badge-danger {
  background: var(--danger-light);
  color: var(--danger);
}

/* ============================================================
   ANGEBOT LIST ITEMS (Dokumente, Rechnungen)
   ============================================================ */
.angebot-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.angebot-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}

.angebot-list-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* ============================================================
   SETTINGS SECTIONS
   ============================================================ */
.settings-section {
  margin-bottom: 24px;
}

.settings-section h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================================
   TOTALS BLOCK
   ============================================================ */
.totals-block {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 16px;
}

/* ============================================================
   PREVIEW AREA
   ============================================================ */
.preview-area {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   RESPONSIVE GRID FOR LARGER SCREENS
   ============================================================ */
@media (min-width: 768px) {
  .folder-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .folder-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
