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

:root {
  --primary: #6366f1;
  --accent: #8b5cf6;
  --bg: #ffffff;
  --text: #1f2937;
  --text-light: #6b7280;
  --border: #e5e7eb;
  --card-bg: #f9fafb;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111827;
    --text: #f9fafb;
    --text-light: #9ca3af;
    --border: #374151;
    --card-bg: #1f2937;
  }
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

.presentation {
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

/* Slides */
.slide {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateX(100%);
  transition: opacity 0.5s ease, transform 0.5s ease;
  padding: 4rem 2rem 6rem;
}

.slide.active {
  opacity: 1;
  transform: translateX(0);
  z-index: 2;
}

.slide.prev {
  transform: translateX(-100%);
}

.slide-content {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

/* Typography */
h1 {
  font-size: 3rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--text);
  text-align: center;
  line-height: 1.2;
}

h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--text);
  text-align: center;
  line-height: 1.2;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.subtitle {
  font-size: 1.25rem;
  color: var(--primary);
  text-align: center;
  margin: 0 0 2rem;
  font-weight: 500;
}

.description {
  font-size: 1.125rem;
  color: var(--text-light);
  text-align: center;
  margin: 2rem auto 0;
  max-width: 700px;
  line-height: 1.8;
}

.closing {
  font-size: 1.125rem;
  color: var(--text-light);
  text-align: center;
  margin: 2rem auto 0;
  max-width: 700px;
  line-height: 1.8;
  font-style: italic;
}

/* Diagrams */
.diagram {
  margin: 2rem 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

svg {
  max-width: 100%;
  height: auto;
}

/* Key Points */
.key-points {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: grid;
  gap: 1rem;
}

.key-points li {
  font-size: 1.125rem;
  padding: 1rem 1.5rem;
  background: var(--card-bg);
  border-left: 4px solid var(--primary);
  border-radius: 0.5rem;
  line-height: 1.6;
}

.key-points strong {
  color: var(--primary);
  font-weight: 600;
}

/* Hash Demo (Slide 3) */
.hash-demo {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
}

.hash-example {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.input-box,
.output-box,
.hash-function {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem;
  min-width: 150px;
}

.hash-function {
  background: var(--primary);
  color: white;
  font-weight: 600;
  text-align: center;
  padding: 1.5rem;
  border: none;
}

.label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.hash-example code {
  display: block;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  color: var(--accent);
  word-break: break-all;
}

.arrow {
  font-size: 1.5rem;
  color: var(--accent);
  font-weight: bold;
}

/* Mining Demo (Slide 6) */
.mining-demo {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
}

.mining-process {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
}

.mining-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
}

.step-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.step-text strong {
  display: block;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.step-text p {
  font-size: 0.875rem;
  color: var(--text-light);
  margin: 0;
}

.pow-example {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 0.5rem;
}

.attempt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: 0.375rem;
}

.attempt .label {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.attempt .hash {
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
}

.attempt .hash.invalid {
  color: var(--text-light);
}

.attempt .hash.valid {
  color: #10b981;
  font-weight: 600;
}

/* Transaction Flow (Slide 8) */
.transaction-flow {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.tx-example {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 2rem;
  align-items: center;
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 0.75rem;
}

.tx-party {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
}

.party-icon {
  font-size: 3rem;
  width: 4rem;
  height: 4rem;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.2;
}

.party-info strong {
  font-size: 1.125rem;
  display: block;
  margin-bottom: 0.25rem;
}

.address {
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  color: var(--text-light);
  background: var(--bg);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
}

.balance {
  font-size: 0.875rem;
  color: var(--accent);
  font-weight: 600;
}

.tx-details {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.tx-amount {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.amount {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.arrow-right {
  font-size: 2rem;
  color: var(--accent);
}

.tx-metadata {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.meta-item {
  font-size: 0.875rem;
  color: var(--text-light);
  white-space: nowrap;
}

.tx-steps {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tx-steps .step {
  padding: 0.75rem 1rem;
  background: var(--card-bg);
  border-left: 3px solid var(--accent);
  border-radius: 0.375rem;
  font-size: 0.9375rem;
}

/* Smart Contract Demo (Slide 9) */
.smart-contract-demo {
  width: 100%;
}

.contract-example {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.code-block {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 0.5rem;
  overflow: hidden;
}

.code-header {
  background: var(--primary);
  color: white;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.875rem;
}

.code-block pre {
  margin: 0;
  padding: 1.5rem;
  overflow-x: auto;
}

.code-block code {
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text);
}

.contract-flow {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.flow-step {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 0.5rem;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.step-num {
  width: 2.5rem;
  height: 2.5rem;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.step-content strong {
  display: block;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.step-content p {
  font-size: 0.875rem;
  color: var(--text-light);
  margin: 0;
}

.flow-arrow {
  text-align: center;
  font-size: 1.5rem;
  color: var(--accent);
  margin: 0.25rem 0;
}

/* Applications Grid (Slide 10) */
.applications-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.app-card {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.app-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(99, 102, 241, 0.1);
}

.app-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.app-card h3 {
  color: var(--primary);
  font-size: 1.25rem;
  margin: 0 0 0.75rem;
}

.app-card p {
  font-size: 0.9375rem;
  color: var(--text-light);
  margin: 0;
  line-height: 1.6;
}

/* Progress Bar */
.progress-bar {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  max-width: 600px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  z-index: 10;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  width: 10%;
  transition: width 0.5s ease;
  border-radius: 2px;
}

/* Navigation */
.navigation {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 2rem;
  z-index: 10;
}

.nav-btn {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.nav-btn:hover:not(:disabled) {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  transform: scale(1.1);
}

.nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.slide-counter {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  user-select: none;
  min-width: 4rem;
  text-align: center;
}

.separator {
  color: var(--text-light);
  margin: 0 0.25rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .slide {
    padding: 2rem 1rem 5rem;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .description,
  .closing {
    font-size: 1rem;
  }

  .key-points li {
    font-size: 1rem;
    padding: 0.875rem 1rem;
  }

  .tx-example {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .arrow-right {
    transform: rotate(90deg);
  }

  .contract-example {
    grid-template-columns: 1fr;
  }

  .mining-process {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .progress-bar {
    width: 90%;
  }

  .navigation {
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .mining-process {
    grid-template-columns: 1fr;
  }

  .hash-example {
    flex-direction: column;
  }

  .arrow {
    transform: rotate(90deg);
  }
}

/* Print Styles */
@media print {
  body {
    overflow: visible;
  }

  .presentation {
    overflow: visible;
    height: auto;
  }

  .slide {
    position: relative;
    transform: none;
    opacity: 1;
    page-break-after: always;
    page-break-inside: avoid;
    height: auto;
    min-height: 100vh;
  }

  .progress-bar,
  .navigation {
    display: none;
  }

  .slide-content {
    max-width: 100%;
  }
}
