/* ==========================================================================
   MAJSTER PRO MP0230 - MOBILNY ASYSTENT I INSTRUKCJA WARSZTATOWA
   Domyślny Czysty Biały / Jasny Motyw (Light Theme - Maksymalna Czytelność)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Outfit:wght@600;700;800;900&family=JetBrains+Mono:wght@600;700;800&display=swap');

:root {
  --primary: #ff6b00;
  --primary-hover: #e55d00;
  --primary-glow: rgba(255, 107, 0, 0.25);
  
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-alt: #f1f5f9;
  --bg-input: #f8fafc;
  
  --cyan: #0284c7;
  --cyan-glow: rgba(2, 132, 199, 0.2);
  --green: #16a34a;
  --red: #dc2626;
  --amber: #d97706;

  --text-main: #0f172a;
  --text-sub: #475569;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 14px -2px rgba(0, 0, 0, 0.07), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 15px;
  min-height: 100vh;
  padding-bottom: 30px;
}

/* ==========================================================================
   GÓRNY NAGŁÓWEK I MENU SEGMENTOWE (JASNY DESIGN)
   ========================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px 12px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.03);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--text-main);
}

.badge-pro {
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
}

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

.menu-burger-btn {
  background: #ffffff;
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}

.menu-burger-btn:hover {
  background: var(--bg-card-alt);
  border-color: var(--primary);
}

/* Nowy Segmentowy Pasek Nawigacji (Nowoczesny iOS/SaaS styl na białym) */
.segmented-nav {
  max-width: 680px;
  margin: 10px auto 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  background: #e2e8f0;
  padding: 4px;
  border-radius: 12px;
}

.seg-btn {
  background: transparent;
  border: none;
  padding: 6px 2px;
  border-radius: 8px;
  color: var(--text-sub);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.seg-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.seg-label {
  font-family: 'Outfit', sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: -0.2px;
  white-space: nowrap;
}

.seg-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.65);
}

.seg-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* ==========================================================================
   SZUFLADA / MODAL SPISU TREŚCI (DRAWER)
   ========================================================================== */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: flex-end;
  justify-content: center;
}

.drawer-overlay.open {
  display: flex;
  animation: fadeInOverlay 0.2s ease-out;
}

@keyframes fadeInOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}

.drawer-panel {
  width: 100%;
  max-width: 600px;
  background: #ffffff;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  border: 1px solid var(--border);
  padding: 20px 18px 30px;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.15);
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.drawer-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.drawer-close {
  background: none;
  border: none;
  color: var(--text-sub);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.drawer-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-item {
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  color: var(--text-main);
  width: 100%;
}

.drawer-item:hover, .drawer-item.active {
  background: #fff7ed;
  border-color: var(--primary);
}

.drawer-item .d-icon {
  font-size: 1.5rem;
}

.drawer-item .d-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
}

.drawer-item .d-desc {
  font-size: 0.78rem;
  color: var(--text-sub);
  margin-top: 2px;
}

/* Główny kontener aplikacji */
.app-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px;
}

/* Treść zakładek */
.tab-pane {
  display: none;
  animation: fadeIn 0.2s ease-out;
}

.tab-pane.active {
  display: block;
}

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

/* Karty uniwersalne (Czysty biały styl) */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-desc {
  font-size: 0.88rem;
  color: var(--text-sub);
  margin-bottom: 14px;
  line-height: 1.45;
}

/* ==========================================================================
   ZAKŁADKA 1: SZYBKI KALKULATOR NASTAW
   ========================================================================== */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.preset-chip {
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 11px 10px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  box-shadow: var(--shadow-sm);
}

.preset-chip:active, .preset-chip.active {
  background: #fff7ed;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.preset-chip .p-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--text-main);
  display: block;
}

.preset-chip .p-sub {
  font-size: 0.72rem;
  color: var(--text-sub);
  display: block;
  margin-top: 2px;
}

.slider-box {
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 14px;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.slider-val {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
}

.slider-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-sub);
}

.range-input {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #cbd5e1;
  outline: none;
  -webkit-appearance: none;
}

.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 2px 6px rgba(255, 107, 0, 0.4);
  cursor: pointer;
}

.result-box {
  background: #ffffff;
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 4px 16px rgba(255, 107, 0, 0.1);
}

.result-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.res-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-main);
}

.res-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.res-stat {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  text-align: center;
}

.res-stat .lbl {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
}

.res-stat .val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--cyan);
}

.res-stat .sub {
  font-size: 0.68rem;
  color: var(--text-sub);
}

.cable-schematic-mini {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 12px;
}

.cable-schematic-mini h5 {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.cable-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
}

.cable-row:last-child {
  border-bottom: none;
}

.cable-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.78rem;
}

.cable-badge.plus { background: #fee2e2; color: #b91c1c; }
.cable-badge.minus { background: #e0f2fe; color: #0369a1; }
.cable-badge.euro { background: #ffedd5; color: #c2410c; }

.quick-advice {
  background: #e0f2fe;
  border-left: 3px solid var(--cyan);
  padding: 10px 12px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.84rem;
  color: #0369a1;
  line-height: 1.45;
}

/* ==========================================================================
   ZAKŁADKA 2: REALNY PANEL SPAWARKI (FOTO 1:1)
   ========================================================================== */
.real-panel-container {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--primary);
  box-shadow: var(--shadow-md);
  background: #000;
  margin-bottom: 14px;
}

.real-panel-img {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
}

.hotspot-btn {
  position: absolute;
  cursor: pointer;
  z-index: 10;
  border-radius: 6px;
  border: 2px solid rgba(255, 107, 0, 0.8);
  background: rgba(255, 107, 0, 0.2);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  animation: pulse-border 2.5s infinite;
}

.hotspot-btn.round {
  border-radius: 50%;
}

@keyframes pulse-border {
  0%, 100% {
    border-color: rgba(255, 107, 0, 0.9);
    box-shadow: 0 0 6px rgba(255, 107, 0, 0.5);
  }
  50% {
    border-color: rgba(2, 132, 199, 1);
    box-shadow: 0 0 12px rgba(2, 132, 199, 0.7);
  }
}

.hotspot-btn:hover, .hotspot-btn.active {
  border-color: #0284c7 !important;
  background: rgba(2, 132, 199, 0.45) !important;
  box-shadow: 0 0 20px #0284c7, inset 0 0 10px rgba(2, 132, 199, 0.5) !important;
  transform: scale(1.06);
}

.tap-hint-bar {
  text-align: center;
  font-size: 0.8rem;
  color: var(--amber);
  margin-bottom: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.button-grid-selector {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.btn-select-item {
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 6px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-main);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.btn-select-item:hover {
  background: var(--bg-card-alt);
  border-color: var(--primary);
}

.btn-select-item:active, .btn-select-item.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-explain-box {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.btn-explain-box .b-tag {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.btn-explain-box .b-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}

.btn-explain-box .b-loc {
  font-size: 0.78rem;
  color: var(--cyan);
  font-weight: 600;
  margin-bottom: 10px;
  display: block;
}

.btn-explain-box .b-text {
  font-size: 0.88rem;
  color: var(--text-sub);
  line-height: 1.5;
  margin-bottom: 12px;
}

.btn-explain-box .b-text strong {
  color: var(--text-main);
}

.btn-explain-box .b-text code {
  background: #e0f2fe;
  color: var(--cyan);
  padding: 2px 5px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  font-weight: 700;
}

.btn-explain-box .b-tip {
  background: #f0fdf4;
  border-left: 3px solid var(--green);
  padding: 8px 10px;
  font-size: 0.82rem;
  color: #166534;
  border-radius: 0 4px 4px 0;
  line-height: 1.45;
}

/* ==========================================================================
   ZAKŁADKA 3: BIEGUNOWOŚĆ I KABLE
   ========================================================================== */
.schematic-img-box {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 14px;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.schematic-img-box img {
  width: 100%;
  height: auto;
  display: block;
}

.schematic-caption {
  padding: 8px 12px;
  font-size: 0.78rem;
  color: var(--cyan);
  background: #f8fafc;
  border-top: 1px solid var(--border);
  text-align: center;
  font-weight: 600;
}

.polarity-card-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.polarity-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}

.polarity-card.featured {
  border-color: #f59e0b;
  background: #fffbeb;
}

.polarity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.polarity-name {
  font-family: 'Outfit', sans-serif;
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-main);
}

.polarity-badge {
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
}

.p-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  padding: 3px 0;
  color: var(--text-sub);
}

.p-item strong {
  color: var(--text-main);
}

/* ==========================================================================
   ZAKŁADKA 4: PIERWSZY START
   ========================================================================== */
.step-list-mini {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.step-item-mini {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.step-badge-num {
  background: var(--primary);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 900;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-info h4 {
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 4px;
  font-weight: 800;
}

.step-info p {
  font-size: 0.82rem;
  color: var(--text-sub);
  line-height: 1.4;
}

.step-info .hint {
  font-size: 0.78rem;
  color: var(--amber);
  margin-top: 4px;
  display: block;
  font-weight: 600;
}

/* ==========================================================================
   ZAKŁADKA 5: BŁĘDY I POMOC (AKORDEON)
   ========================================================================== */
.trouble-accordion {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trouble-pill {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.trouble-pill-header {
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-main);
}

.trouble-pill-body {
  padding: 0 14px 12px;
  display: none;
  font-size: 0.82rem;
  color: var(--text-sub);
  border-top: 1px solid var(--border);
  margin-top: 6px;
  padding-top: 8px;
  line-height: 1.45;
}

.trouble-pill.open .trouble-pill-body {
  display: block;
}

.trouble-pill.open {
  border-color: var(--primary);
  background: #fff7ed;
}

.trouble-pill.open .trouble-pill-header {
  color: var(--primary);
}

.fix-bullet {
  color: #166534;
  font-weight: 600;
  display: block;
  margin-top: 4px;
}

/* ==========================================================================
   MEDIA QUERIES (RESPONSYWNOŚĆ)
   ========================================================================== */
@media (max-width: 380px) {
  .brand { font-size: 1rem; }
  .seg-label { font-size: 0.68rem; }
  .seg-icon { font-size: 1rem; }
  .button-grid-selector { grid-template-columns: 1fr; }
}
