/* ===========================================
   Smartgeräte-Baukasten - Styles
   Inspiriert von digitalassistenz.schule
   =========================================== */

@import url('https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@400;700&family=Roboto:wght@400;500;700&display=swap');

:root {
  /* Farbpalette angelehnt an digitalassistenz.schule */
  --primary: #b35300;
  --primary-light: #e67700;
  --primary-dark: #8a4000;
  --secondary: #20305f;
  --secondary-light: #2a4080;
  --accent: #9DFF20;
  --accent-muted: #7acc1a;

  --bg: #f7f7f7;
  --bg-white: #ffffff;
  --text: #1a1a1a;
  --text-light: #4a4a4a;
  --text-muted: #6b6b6b;
  --line: #e0e0e0;
  --line-light: #eeeeee;

  --success: #059669;
  --success-light: #d1fae5;
  --warning: #fef3c7;
  --warning-border: #fcd34d;
  --warning-text: #92400e;

  --radius: 1.2em;
  --radius-sm: 0.8em;
  --radius-pill: 60em;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 700;
  line-height: 1.3;
}

/* ===========================================
   Header
   =========================================== */
.header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--line);
  padding: 16px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.logo-placeholder {
  width: 40px;
  height: 40px;
  background: var(--secondary);
  border-radius: 10px;
  font-size: 9px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 700;
}

.site-title {
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-badge {
  background: var(--accent);
  color: var(--secondary);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ===========================================
   Wizard Overlay (Startbildschirm)
   =========================================== */
.wizard-overlay {
  position: fixed;
  inset: 0;
  background: rgba(32, 48, 95, 0.85);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.wizard-overlay.hidden {
  display: none;
}

.wizard-box {
  background: var(--bg-white);
  border-radius: var(--radius);
  max-width: 600px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin: auto;
}

.wizard-header {
  background: var(--secondary);
  color: white;
  padding: 32px 28px;
  text-align: center;
}

.wizard-header h1 {
  font-size: 26px;
  margin-bottom: 12px;
}

.wizard-header p {
  opacity: 0.9;
  font-size: 16px;
  max-width: 400px;
  margin: 0 auto;
}

.wizard-body {
  padding: 32px 28px;
}

.wizard-intro {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-bottom: 28px;
  border-left: 4px solid var(--primary);
}

.wizard-intro p {
  font-size: 15px;
  color: var(--text-light);
  margin: 0;
}

.wizard-intro strong {
  color: var(--primary);
}

.wizard-form-group {
  margin-bottom: 24px;
}

.wizard-form-group:last-of-type {
  margin-bottom: 32px;
}

.wizard-label {
  display: block;
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wizard-label-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
  display: block;
  margin-top: 4px;
  font-size: 13px;
}

.wizard-input,
.wizard-select {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: 'Roboto', sans-serif;
  background: var(--bg-white);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.wizard-input:focus,
.wizard-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(179, 83, 0, 0.1);
}

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

.wizard-actions {
  display: flex;
  gap: 12px;
}

.wizard-btn {
  flex: 1;
  padding: 16px 24px;
  border-radius: var(--radius-pill);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  font-family: 'Roboto Condensed', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wizard-btn-primary {
  background: var(--primary);
  color: white;
}

.wizard-btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(179, 83, 0, 0.3);
}

.wizard-btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 2px solid var(--line);
  flex: none;
  padding: 16px 20px;
}

.wizard-btn-secondary:hover {
  background: var(--line-light);
}

.wizard-footer {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
}

.wizard-footer a {
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: none;
}

.wizard-footer a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* ===========================================
   Main Layout
   =========================================== */
.main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px 60px;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  align-items: start;
}

/* ===========================================
   Cards
   =========================================== */
.card {
  background: var(--bg-white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-header h2 {
  font-size: 16px;
  color: var(--secondary);
  margin: 0;
}

.card-header .step-num {
  background: var(--primary);
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-header .step-num.done {
  background: var(--success);
}

.card-body {
  padding: 20px;
}

.card + .card {
  margin-top: 16px;
}

/* ===========================================
   Progress Indicator
   =========================================== */
.progress-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  padding: 16px 20px;
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.progress-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--line);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  transition: all 0.3s;
}

.progress-step.active .progress-step-num {
  background: var(--primary);
  color: white;
}

.progress-step.done .progress-step-num {
  background: var(--success);
  color: white;
}

.progress-step.active,
.progress-step.done {
  color: var(--text);
}

.progress-line {
  flex: 1;
  height: 3px;
  background: var(--line);
  border-radius: 2px;
}

.progress-line.done {
  background: var(--success);
}

/* ===========================================
   Forms
   =========================================== */
.form-group {
  margin-bottom: 20px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 6px;
}

.form-hint {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

input[type="text"],
input[type="date"],
select {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: 'Roboto', sans-serif;
  background: var(--bg-white);
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(179, 83, 0, 0.1);
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ===========================================
   Current Selection Display
   =========================================== */
.current-info {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 20px;
  color: white;
}

.current-info-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.8;
  margin-bottom: 4px;
}

.current-info-value {
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 18px;
  font-weight: 700;
}

/* ===========================================
   Accordion / Rules Groups
   =========================================== */
.accordion {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.accordion-item {
  border-bottom: 1px solid var(--line);
}

.accordion-item:last-child {
  border-bottom: none;
}

.accordion-header {
  padding: 14px 16px;
  background: var(--bg);
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--secondary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}

.accordion-header:hover {
  background: var(--line-light);
}

.accordion-header::after {
  content: '+';
  font-size: 18px;
  font-weight: 400;
  color: var(--primary);
  transition: transform 0.2s;
}

.accordion-item.open .accordion-header::after {
  content: '−';
}

.accordion-count {
  background: var(--primary);
  color: white;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  margin-left: auto;
  margin-right: 12px;
}

.accordion-body {
  display: none;
  padding: 12px 16px;
  background: var(--bg-white);
}

.accordion-item.open .accordion-body {
  display: block;
}

/* ===========================================
   Rule Items
   =========================================== */
.rule-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  align-items: flex-start;
}

.rule-item:hover {
  background: var(--bg);
}

.rule-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--primary);
  flex-shrink: 0;
  cursor: pointer;
}

.rule-item-content {
  flex: 1;
}

.rule-item-id {
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 700;
  color: var(--primary);
  font-size: 12px;
  display: inline-block;
  margin-right: 6px;
}

.rule-item-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
}

/* ===========================================
   Buttons
   =========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  border: 2px solid var(--line);
  background: var(--bg-white);
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Roboto', sans-serif;
  gap: 8px;
}

.btn:hover {
  background: var(--bg);
  border-color: var(--text-muted);
}

.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-secondary {
  background: var(--secondary);
  color: white;
  border-color: var(--secondary);
}

.btn-secondary:hover {
  background: var(--secondary-light);
  border-color: var(--secondary-light);
}

.btn-success {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}

.btn-icon {
  font-size: 16px;
}

/* ===========================================
   Preview Area
   =========================================== */
.preview-area {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.doc-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.doc-tab {
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-white);
  border: 2px solid var(--line);
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Roboto', sans-serif;
}

.doc-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.doc-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.preview-card {
  min-height: 450px;
}

.preview-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.preview-header-text {
  font-size: 13px;
  color: var(--text-muted);
}

.preview-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.preview-actions .btn {
  flex: none;
}

.preview-content {
  padding: 24px;
  font-size: 14px;
  line-height: 1.7;
}

.preview-content h3 {
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 20px;
  color: var(--secondary);
  margin-bottom: 8px;
}

.preview-content h4 {
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 14px;
  color: var(--primary);
  margin: 20px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.preview-content p {
  margin-bottom: 12px;
}

.preview-content ul,
.preview-content ol {
  margin: 8px 0 8px 20px;
}

.preview-content li {
  margin-bottom: 6px;
}

.preview-content em {
  color: var(--text-muted);
  font-size: 13px;
}

/* ===========================================
   Info Callout
   =========================================== */
.callout {
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.callout-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.callout-content {
  flex: 1;
}

.callout-title {
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 700;
  margin-bottom: 4px;
}

.callout-text {
  font-size: 14px;
  margin: 0;
}

.callout-info {
  background: #e0f2fe;
  border-left: 4px solid #0284c7;
}

.callout-info .callout-icon { color: #0284c7; }
.callout-info .callout-title { color: #0369a1; }

.callout-success {
  background: var(--success-light);
  border-left: 4px solid var(--success);
}

.callout-success .callout-icon { color: var(--success); }
.callout-success .callout-title { color: var(--success); }

.callout-tip {
  background: #fef3c7;
  border-left: 4px solid var(--primary);
}

.callout-tip .callout-icon { color: var(--primary); }
.callout-tip .callout-title { color: var(--primary-dark); }

/* ===========================================
   Export/Import Row
   =========================================== */
.config-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.config-row-label {
  font-weight: 500;
}

.config-row-actions {
  display: flex;
  gap: 8px;
}

/* ===========================================
   Footer
   =========================================== */
.footer {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid var(--line);
  margin-top: 40px;
  background: var(--bg-white);
}

.footer p {
  margin-bottom: 8px;
}

.footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.footer a:hover {
  text-decoration: underline;
}

/* ===========================================
   RESPONSIVE: Tablet (< 900px)
   =========================================== */
@media (max-width: 900px) {
  .main {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .preview-area {
    order: -1;
  }

  .wizard-box {
    max-width: 100%;
  }
}

/* ===========================================
   RESPONSIVE: Mobile (< 600px)
   =========================================== */
@media (max-width: 600px) {
  html {
    font-size: 15px;
  }

  .header {
    padding: 12px 16px;
  }

  .header-badge {
    display: none;
  }

  .site-title {
    font-size: 16px;
  }

  .main {
    padding: 16px;
  }

  .wizard-header {
    padding: 24px 20px;
  }

  .wizard-header h1 {
    font-size: 22px;
  }

  .wizard-body {
    padding: 24px 20px;
  }

  .wizard-btn {
    padding: 14px 18px;
    font-size: 14px;
  }

  .wizard-actions {
    flex-direction: column;
  }

  .wizard-btn-secondary {
    order: 1;
  }

  .progress-indicator {
    flex-wrap: wrap;
    gap: 12px;
  }

  .progress-step {
    font-size: 11px;
  }

  .progress-step span:last-child {
    display: none;
  }

  .progress-line {
    display: none;
  }

  .card-header {
    padding: 14px 16px;
  }

  .card-body {
    padding: 16px;
  }

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

  .doc-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .doc-tab {
    text-align: center;
    padding: 10px 12px;
  }

  .preview-header {
    flex-direction: column;
    align-items: stretch;
  }

  .preview-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .preview-actions .btn {
    justify-content: center;
  }

  .config-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .config-row-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .config-row-actions .btn {
    justify-content: center;
  }
}

/* ===========================================
   RESPONSIVE: Small Mobile (< 400px)
   =========================================== */
@media (max-width: 400px) {
  .wizard-intro {
    padding: 16px;
  }

  .doc-tabs {
    grid-template-columns: 1fr;
  }

  .preview-actions {
    grid-template-columns: 1fr;
  }
}

/* ===========================================
   Print Styles
   =========================================== */
@media print {
  .header,
  .sidebar,
  .doc-tabs,
  .preview-header,
  .footer,
  .wizard-overlay,
  .progress-indicator {
    display: none !important;
  }

  .main {
    display: block;
    padding: 0;
  }

  .card {
    border: none;
    box-shadow: none;
  }

  .preview-content {
    padding: 0;
  }
}
