@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

/* NO FLASH - PŘED :root */
html[data-theme="light"] body,
body.light {
  background: #f3f4f6 !important;
  color: #111827 !important;
}

html[data-theme="dark"] body,
body.dark {
  background: #0f172a !important;
  color: #e5e7eb !important;
}

/* tutorial.css - CLEAN MOBILE-FIRST CENTERED */
:root[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #020617;
  --bg-card: #0b1120;
  --bg-hover: #111827;
  --text-primary: #e5e7eb;
  --text-secondary: #9ca3af;
  --text-muted: #94a3b8;
  --border: #1e293b;
  --toggle-bg: #111827;
  --toggle-on: #0f172a;
  --toggle-knob: #f9fafb;
  --success-bg: #022c22;
  --success-border: #14532d;
  --success-text: #bbf7d0;
  --bg-primary-rgb: 15, 23, 42;
  --accent: #60a5fa;
  --accent-hover: #3b82f6;
}

:root[data-theme="light"] {
  --bg-primary: #f3f4f6;
  --bg-secondary: #ffffff;
  --bg-card: #f9fafb;
  --bg-hover: #e5e7eb;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --toggle-bg: #e5e7eb;
  --toggle-on: #f3f4f6;
  --toggle-knob: #f9fafb;
  --success-bg: #d5f1cc;
  --success-border: #b8e3b0;
  --success-text: #166534;
  --bg-primary-rgb: 243, 244, 246;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', Roboto, Inter;
  background: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* CENTERED CONTAINER */
.container {
  background: var(--bg-secondary);
  padding: 16px;
  width: 100%;
  max-width: 768px;
  min-height: 100vh;
  padding-bottom: 88px;
  margin: 0 auto;
}

/* HERO - VIZUÁLNÍ HIERARCHIE */
.hero {
  text-align: center;
  padding: 24px 0 20px;
  margin-bottom: 8px;
}

.hero h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
  font-weight: 400;
  margin-bottom: 0;
}

/* ACCORDION SECTION */
.accordion-section {
  margin-bottom: 12px;
}

/* ACCORDION - ČISTÝ DESIGN S HIERARCHIÍ */
.accordion-item {
  background: var(--bg-card) !important;
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  scroll-margin-top: 80px;
}

.accordion-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.accordion-header {
  width: 100%;
  padding: 16px 18px;
  background: var(--bg-card) !important;
  border: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary) !important;
  text-align: left;
  line-height: 1.3;
  transition: background 0.15s ease;
  letter-spacing: -0.01em;
  min-height: 56px;
}

.accordion-header:hover {
  background: var(--bg-hover) !important;
}

.accordion-header:active {
  transform: scale(0.995);
}

.accordion-icon {
  font-size: 16px;
  color: var(--accent);
  margin-left: 12px;
  flex-shrink: 0;
  transition: transform 0.25s ease;
  font-weight: 700;
}

.accordion-item.open .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  padding: 0px 18px 0px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border-top: 1px solid transparent;
  text-align: left;
}

.accordion-content.active {
  max-height: 5000px;
  border-top: 1px solid var(--border);
}

/* ✅ COMPLETED STATES - THEORY ACCORDION - HIGHEST SPECIFICITY */
button.accordion-header.completed,
.accordion-header.completed {
  background: var(--success-bg) !important;
  border-color: var(--success-border) !important;
}

button.accordion-header.completed:hover,
.accordion-header.completed:hover {
  background: color-mix(in srgb, var(--success-bg) 90%, var(--success-border)) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.25);
}

/* All text inside completed accordion header */
button.accordion-header.completed,
button.accordion-header.completed span,
button.accordion-header.completed .accordion-icon,
.accordion-header.completed,
.accordion-header.completed span,
.accordion-header.completed .accordion-icon {
  color: var(--success-text) !important;
}

/* TERM DEFINITION - LEPŠÍ SPACING */
.term-definition {
  margin: 0;
  padding: 18px;
  border-bottom: 1px solid var(--border);
}

.term-definition:first-child {
  padding-top: 20px;
}

.term-definition:last-child {
  border-bottom: none;
  padding-bottom: 20px;
}

.term-definition h4,
.term-definition .term-title {
  font-size: 16px;
  margin: 0 0 8px 0;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.term-definition p,
.term-definition .term-desc {
  margin: 0;
  line-height: 1.65;
  font-size: 14px;
  color: var(--text-secondary) !important;
  font-weight: 400;
}

/* PROGRESS BAR */
#theory-progress-container {
  margin: 20px 0 24px;
}

.progress-bar {
  width: 100%;
  background: var(--bg-card);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin: 16px 0 8px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-hover) 100%);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 999px;
}

.progress-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 6px;
  text-align: center;
}

/* USER INFO + THEME TOGGLE */
.user-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.user-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.user-avatar-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: white;
}

.user-details {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.user-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
}

.user-fid {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.theme-toggle-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.theme-toggle {
  position: relative;
  width: 56px;
  height: 28px;
  border-radius: 999px;
  border: none;
  background: var(--toggle-bg);
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  transition: background 0.2s ease;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.theme-toggle-knob {
  position: absolute;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle-icon {
  position: absolute;
  right: 8px;
  font-size: 14px;
  pointer-events: none;
  opacity: 0.7;
}

.theme-toggle.on {
  background: var(--accent);
}

.theme-toggle.on .theme-toggle-knob {
  transform: translateX(26px);
}

/* TRY IT YOURSELF SECTION */
.try-section {
  background: var(--bg-card);
  border-radius: 16px;
  border: 2px solid var(--border);
  padding: 24px 20px;
  margin: 20px 0 24px 0;
}

.try-section h3 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.practice-info {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 18px;
}

/* WALLET INPUT FIELD */
.wallet-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
  transition: all 0.2s ease;
  margin-bottom: 10px;
}

.wallet-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
  background: var(--bg-secondary);
}

.wallet-input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
}

/* INPUT HINT */
.input-hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-weight: 500;
  line-height: 1.5;
}

/* CTA BUTTON - PRIMARY ACTION */
.cta-button {
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
  text-transform: none;
  letter-spacing: 0;
  min-height: 54px;
  margin: 12px 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.cta-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.cta-button:active:not(:disabled) {
  transform: translateY(0);
}

.cta-button:disabled {
  background: var(--bg-hover);
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
}

/* PRACTICE HINT */
.practice-hint {
  background: rgba(96, 165, 250, 0.1);
  border-left: 3px solid #60a5fa;
  padding: 12px 16px;
  border-radius: 8px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.practice-hint strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* WARNING BOX */
.warning-box {
  background: rgba(251, 191, 36, 0.1);
  border-left: 3px solid #fbbf24;
  padding: 14px 16px;
  border-radius: 8px;
  margin: 16px 0;
  font-size: 14px;
  line-height: 1.6;
}

:root[data-theme="dark"] .warning-box {
  background: rgba(251, 191, 36, 0.08);
  color: #fcd34d;
}

:root[data-theme="light"] .warning-box {
  background: #fef3c7;
  color: #92400e;
}

.warning-box strong {
  font-weight: 700;
  display: block;
  margin-bottom: 6px;
}

/* INFO BOX */
.info-box {
  background: var(--success-bg);
  border-left: 3px solid var(--success-border);
  color: var(--success-text);
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin: 16px 0;
  line-height: 1.6;
}

.info-box strong {
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
}

/* ERROR BOX - Červený styl pro chyby */
.error-box {
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid #ef4444;
  color: #fca5a5;
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin: 16px 0;
  line-height: 1.6;
}

.error-box strong {
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
}

.error-box a {
  color: inherit;
  text-decoration: underline;
}

/* Light mode verze */
:root[data-theme="light"] .error-box {
  background: #fee2e2;
  color: #991b1b;
  border-color: #ef4444;
}

/* STATUS MESSAGE */
#receiveStatus {
  padding: 14px 16px;
  border-radius: 12px;
  font-weight: 600;
  text-align: center;
  margin: 16px 0;
  display: none;
  font-size: 14px;
  line-height: 1.5;
  animation: slideDown 0.3s ease;
}

#receiveStatus.show {
  display: block;
}

#receiveStatus.success {
  background: var(--success-bg);
  color: var(--success-text);
  border: 2px solid var(--success-border);
}

#receiveStatus.error {
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  border: 2px solid #ef4444;
}

:root[data-theme="light"] #receiveStatus.error {
  background: #fee2e2;
  color: #991b1b;
  border-color: #ef4444;
}

#receiveStatus.processing {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 2px solid var(--border);
}

/* SMOOTH ANIMATIONS */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* LINK STYLING IN ACCORDION */
.accordion-content a {
  color: #60a5fa;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.accordion-content a:hover {
  color: #3b82f6;
  text-decoration: underline;
}

:root[data-theme="light"] .accordion-content a {
  color: #2563eb;
}

:root[data-theme="light"] .accordion-content a:hover {
  color: #1d4ed8;
}

/* BETTER TEXT FORMATTING IN ACCORDION */
.accordion-content ul,
.accordion-content ol {
  margin: 12px 0 12px 24px;
  padding: 0;
}

.accordion-content li {
  margin: 8px 0;
  line-height: 1.6;
  color: var(--text-secondary);
}

.accordion-content strong {
  color: var(--text-primary);
  font-weight: 700;
}

.accordion-content p {
  margin: 12px 0;
  line-height: 1.65;
}

/* CODE/ADDRESS STYLING */
.accordion-content code,
#walletInput {
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
}

/* FOOTER */
footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  padding: 24px 0 16px;
  border-top: 1px solid var(--border);
  margin-top: 32px;
  line-height: 1.5;
}

footer strong {
  color: var(--text-secondary);
  font-weight: 600;
}

/* BOTTOM NAV */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(var(--bg-primary-rgb), 0.97);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.bottom-nav a {
  flex: 1;
  text-align: center;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  font-weight: 600;
}

.bottom-nav-icon {
  font-size: 22px;
  transition: transform 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bottom-nav-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom-nav a:active .bottom-nav-icon {
  transform: scale(0.9);
}

.bottom-nav a span {
  line-height: 1;
}

.bottom-nav a.active {
  color: var(--accent);
  font-weight: 700;
}

.bottom-nav a.active .bottom-nav-icon {
  transform: scale(1.08);
}

/* RESPONSIVE - MOBILE FIRST */
@media (max-width: 640px) {
  .container {
    padding: 14px;
  }

  .hero {
    padding: 20px 0 16px;
  }

  .hero h1 {
    font-size: 24px;
  }

  .subtitle {
    font-size: 14px;
  }

  .accordion-header {
    font-size: 15px;
    padding: 14px 16px;
  }

  .term-definition {
    padding: 16px;
  }

  .term-definition h4,
  .term-definition .term-title {
    font-size: 15px;
  }

  .term-definition p,
  .term-definition .term-desc {
    font-size: 13px;
  }
}

@media (max-width: 380px) {
  .hero h1 {
    font-size: 22px;
  }

  .subtitle {
    font-size: 13px;
  }

  .accordion-header {
    font-size: 14px;
  }
}

/* LANDSCAPE MODE */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    padding: 12px 0;
  }

  .hero h1 {
    font-size: 20px;
  }

  .bottom-nav {
    height: 56px;
  }
}

/* SOURCES */
.sources {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  text-align: center;
  scroll-margin-top: 80px;
  padding-bottom: 50px;
}

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

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

/* BONUS SECTION */
.bonus-section {
  background: rgba(96, 165, 250, 0.10);
  border-radius: 12px;
  border: 1px solid rgba(96, 165, 250, 0.35);
  padding: 16px 18px;
  margin: 18px 0 8px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

:root[data-theme="dark"] .bonus-section {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(59, 130, 246, 0.6);
}

:root[data-theme="light"] .bonus-section {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.bonus-section h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.bonus-section p {
  margin: 0;
}

.bonus-section strong {
  color: var(--text-primary);
}

/* modal */

.custom-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.custom-modal-content {
    background: var(--bg-card); /* Použije barvu karty podle tématu */
    border: 1px solid var(--border);
    border-radius: 24px;
    width: 90%;
    max-width: 400px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: scaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
}

.modal-header {
    padding: 24px 24px 10px;
}

.modal-title {
    font-size: 20px;
    font-weight: 800;
    margin: 0;
    /* Barva se určí podle typu (success/danger) níže */
}

.modal-body {
    padding: 10px 24px 24px;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.5;
}

.modal-footer {
    padding: 16px;
    background: var(--bg-hover);
    border-top: 1px solid var(--border);
}


.modal-btn {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 12px 0;
    width: 100%;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
}

.modal-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

.modal-btn:active {
    transform: scale(0.98);
}

.modal-success .modal-title { color: #22c55e; }
.modal-success .modal-btn {
    background: #22c55e;
    color: #022c22;
    border: none;
}

.modal-danger .modal-title { color: #ef4444; }
.modal-danger .modal-btn {
    background: #ef4444;
    color: white;
    border: none;
}

.modal-warning .modal-title { color: #eab308; }
.modal-warning .modal-btn {
    background: #eab308;
    color: black;
    border: none;
}

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

@keyframes scaleUp {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}