/* CSS Variables */
:root {
  --color-bg: #151515;
  --color-text: #fff;
  --font-mono: 'JetBrains Mono', monospace;
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 20px;
  --spacing-xl: 24px;
  --spacing-xxl: 32px;
  --spacing-huge: 40px;
  --line-height-tight: 1.2;
}

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

body {
  font-family: var(--font-mono);
  background: #fff;
  overflow-x: hidden;
}

/* Main container - two column layout */
.container {
  display: flex;
  min-height: 100dvh;
  background: var(--color-bg);
}

/* Left Column: Receipt Panel */
.receipt-panel {
  flex: 0 0 auto;
  width: 100%;
  max-width: 400px;
  min-width: 300px;
  padding: 32px var(--spacing-xxl);
  background: #fff;
  color: var(--color-bg);
  overflow-y: auto;
  height: 100dvh;
}

/* Title */
.title {
  font-family: serif;
  font-size: 30px;
  line-height: var(--line-height-tight);
  letter-spacing: -0.08em;
  text-align: center;
  margin-bottom: var(--spacing-md);
  font-weight: normal;
}

/* Subtitle */
.subtitle {
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: center;
  margin-bottom: 20px;
}

.subtitle div {
  margin-bottom: 2px;
}

.subtitle div:last-child {
  margin-bottom: 0;
}

/* How to Use Section */
.how-to-use {
  margin-bottom: 24px;
  margin-top: 20px;
}

.section-header {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 12px;
  font-weight: normal;
  letter-spacing: 0.02em;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.section-header::before,
.section-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: repeating-linear-gradient(
    to right,
    #151515 0,
    #151515 2px,
    transparent 2px,
    transparent 4px
  );
}

.section-header::before {
  margin-right: 12px;
}

.section-header::after {
  margin-left: 12px;
}

.use-list {
  margin-bottom: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.use-list div {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  margin-bottom: 2px;
  letter-spacing: 0.02em;
  padding: 2px 6px;
}

.divider {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
  color: var(--color-bg);
  letter-spacing: 0;
  margin: 16px -40px;
  padding: 0 40px;
  opacity: 0.3;
  letter-spacing: 2px;
}

/* Poem */
.poem {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-align: center;
  margin: 16px 0 0 0;
  line-height: 1.6;
}

.poem div {
  margin-bottom: 2px;
}

.poem div:last-child {
  margin-bottom: 0;
}

/* Upload Button */
.upload-button {
  width: 100%;
  height: 44px;
  background: #151515;
  color: #fff;
  border: none;
  border-radius: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  cursor: pointer;
  margin: 32px 0 32px 0;
  transition: all 0.2s ease;
  font-weight: 500;
  letter-spacing: 0.05em;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.upload-button:hover {
  background: #333;
  transform: translateY(-1px);
}

.upload-button:active {
  background: #555;
  transform: translateY(0);
}

.upload-button.drag-over {
  background: #444;
}

/* Version Section */
.version-section {
  margin-top: 48px;
  margin-bottom: 48px;
}

.version-group {
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.version-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: normal;
  text-transform: none;
  letter-spacing: 0.02em;
  min-width: 140px;
  text-align: left;
  color: #151515;
}

.algorithm-list,
.color-list,
.export-list {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-align: right;
  flex: 1;
}

.algorithm-list div,
.color-list div,
.export-list div {
  padding: 2px 0;
}

.version-content {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-align: right;
  flex: 1;
}

/* Latest Update Section */
.latest-update {
  margin-bottom: 48px;
}

.update-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}

.update-item .label {
  font-weight: normal;
}

/* Footer */
.footer {
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 12px 0;
}

.footer-nav-link {
  color: rgba(21, 21, 21, 0.6);
  text-decoration: none;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color 0.2s ease;
}

.footer-nav-link:hover {
  color: #151515;
  text-decoration: underline;
}

.footer-title {
  font-size: 11px;
  margin-bottom: 4px;
}

.footer-credits {
  font-size: 11px;
  margin-bottom: 4px;
}

.footer-copyright {
  font-size: 11px;
  margin-bottom: 20px;
}

/* QR Code */
.qr-code {
  margin: 20px 0;
}

.qr-placeholder {
  font-size: 11px;
  margin-bottom: 4px;
  color: #666;
}

.qr-text {
  font-size: 11px;
  margin-bottom: 16px;
}

/* Final Buttons */
.final-buttons {
  margin-top: 16px;
}

.link-button {
  background: none;
  border: none;
  border-radius: 0;
  color: #151515;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-decoration: underline;
  cursor: pointer;
  margin: 4px 0;
  display: block;
  width: 100%;
  text-align: center;
  font-weight: normal;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.link-button:hover {
  color: #333;
}

/* Right Column: Horse Illustrations */
.horse-column {
  flex: 1;
  background: #151515;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.horse-container {
  position: relative;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  padding-right: 60px;
}

.horse-track {
  display: flex;
  flex-direction: column;
  animation: infiniteScroll 60s linear infinite;
  max-width: 400px;
  width: 100%;
  will-change: transform;
}

.horse-image {
  width: 100%;
  height: auto;
  max-width: 400px;
  object-fit: contain;
  display: block;
  margin: 0;
}

@keyframes infiniteScroll {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-50%);
  }
}

/* Premium Info Section */
.info-section {
  position: absolute;
  bottom: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  margin: 0;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background-color: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
}

.info-section:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.info-label {
  font-weight: normal;
  letter-spacing: 0.5px;
}

.info-square {
  width: 8px;
  height: 8px;
  background: #fff;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.info-section:hover .info-square {
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }

  .receipt-panel {
    flex: none;
    width: 100%;
    max-width: none;
    margin-right: 0;
    padding: 40px 24px;
    height: auto;
  }

  .horse-column {
    margin-top: 40px;
    height: 60vh;
  }

  .horse-container {
    height: 100%;
    padding-right: 24px;
  }

  .info-section {
    right: 24px;
    bottom: 24px;
    left: auto;
  }
}

@media (max-width: 480px) {
  .receipt-panel {
    padding: 30px 20px;
  }

  .title {
    font-size: 24px;
    line-height: 30px;
  }

  .subtitle,
  .use-list div,
  .poem div,
  .version-label,
  .algorithm-list div,
  .color-list div,
  .export-list div,
  .version-content,
  .update-item,
  .footer-title,
  .link-button {
    font-size: 12px;
  }

  .footer-credits,
  .footer-copyright,
  .qr-placeholder,
  .qr-text {
    font-size: 2px;
    opacity: 0;
  }

  .section-header {
    font-size: 12px;
    opacity: 1;
  }

  .section-header::before,
  .section-header::after {
    background: repeating-linear-gradient(
      to right,
      #151515 0,
      #151515 3px,
      transparent 3px,
      transparent 6px
    );
    height: 1.5px; /* Slightly thicker for mobile */
  }

  .upload-button {
    height: 44px;
    font-size: 11px;
  }
}

/* Tablet styles */
@media (min-width: 769px) and (max-width: 1024px) {
  .receipt-panel {
    max-width: 350px;
    padding: 50px 24px;
  }

  .horse-container {
    padding-right: 40px;
  }

  .info-section {
    right: 40px;
    bottom: 40px;
    left: auto;
  }
}

/* INFO Modal */
.info-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.info-modal.active {
  display: flex;
  opacity: 1;
  align-items: center;
  justify-content: center;
}

.info-modal-content {
  background: #000;
  border: 1px solid #333;
  max-width: 600px;
  max-height: 80vh;
  margin: 20px;
  font-family: 'JetBrains Mono', monospace;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.info-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 16px 24px;
  border-bottom: 1px solid #333;
}

.info-modal-header h2 {
  color: #fff;
  font-size: 12px;
  font-weight: normal;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-family: 'JetBrains Mono', monospace;
}

.info-modal-close {
  background: none;
  border: none;
  color: #666;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.info-modal-close:hover {
  color: #fff;
}

.info-modal-body {
  padding: 20px;
  color: #ccc;
  font-size: 12px;
  line-height: 1.5;
  font-family: 'JetBrains Mono', monospace;
}

.info-modal-body h3 {
  color: #fff;
  font-size: 11px;
  font-weight: normal;
  margin: 20px 0 8px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: 'JetBrains Mono', monospace;
}

.info-modal-body p {
  margin: 0 0 16px 0;
}

.info-modal-body ul {
  margin: 0 0 16px 0;
  padding-left: 20px;
}

.info-modal-body li {
  margin-bottom: 8px;
}

.info-modal-body strong {
  color: #fff;
  font-weight: 600;
}

.info-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #333;
}

.info-footer p {
  color: #999;
  font-size: 13px;
  font-style: italic;
  margin: 0;
}