/* ============================================
   Bot Racer — Web Interface Styles
   Monaco Grand Prix Theme
   ============================================ */

@font-face {
  font-family: 'CenturyGothic';
  src: url('/centurygothic.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'CenturyGothic';
  src: url('/centurygothic_bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --color-bg: #0a0a0e;
  --color-surface: #141418;
  --color-surface-hover: #1a1a22;
  --color-border: rgba(255, 255, 255, 0.1);
  --color-text: #ffffff;
  --color-text-muted: #8888a0;
  --color-primary: #ce181e;
  --color-primary-hover: #a81015;
  --color-success: #22c55e;
  --color-error: #ef4444;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 30px;
  --font: 'CenturyGothic', 'Outfit', system-ui, -apple-system, sans-serif;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- Settins ---- */
.btn-reset {
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background-color: transparent;
  cursor: pointer;
}

/* ---- Container ---- */
.container {
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin: 0 auto;
  padding: 40px 25px 80px;
}

/* ---- Language Switcher ---- */
.language-switcher {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 20px;
}

.lang-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.lang-btn:hover {
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.lang-btn.active {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(206, 24, 30, 0.22);
}

/* ---- Logo ---- */
.logo {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
  text-decoration: none;
}

.logo-image {
  max-width: 252px;
  width: 100%;
  height: auto;
}

/* ---- Hero ---- */
.hero {
  text-align: center;
  margin-bottom: 40px;
}

.hero h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 15px;
  line-height: 140%;
  text-align: center;
}

.subtitle {
  max-width: 520px;
  margin: 0 auto;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 150%;
  text-align: center;
}

.hero-compact {
  margin-bottom: 24px;
}

/* ---- Consent Section ---- */
.consent-section {
  margin-bottom: 24px;
}

.consent-card {
  border-radius: 15px;
  padding: 24px 20px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
}

.consent-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0 4px;
  border-radius: 8px;
  background: rgba(206, 24, 30, 0.5);
  font-weight: 400;
  font-size: 1.125rem;
  line-height: 140%;
  text-align: center;
}

.consent-title {
  margin-top: 20px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 150%;
}

.consent-text {
  display: grid;
  gap: 12px;
  margin-top: 15px;
  font-weight: 400;
  font-size: 0.875rem;
  line-height: 150%;
}

.consent-text a {
  text-decoration: underline;
  text-decoration-skip-ink: none;
  color: #fda4a8;
  transition: filter 0.3s;
}

.consent-text a:hover {
  filter: brightness(80%);
}

.consent-accordion-btn {
  padding: 0 5px;
}

.consent-accordion-body {
  display: none;
}

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

.consent-accordion-btn svg {
  transition: transform 0.2s ease;
}

.consent-accordion-btn--open svg {
  transform: rotate(180deg);
}

.consent-confirmation {
  margin-top: 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 0.875rem;
  line-height: 150%;
  cursor: pointer;
  user-select: none;
}

.consent-confirmation input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Custom Radio Button */
.consent-checkmark {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  margin-top: 0;
  background-color: rgba(217, 217, 217, 0.05);
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
}

.consent-checkmark::after {
  content: '';
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--color-primary);
  border: none;
  transform: scale(0);
  opacity: 0;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.consent-confirmation input:checked + .consent-checkmark::after {
  transform: scale(1);
  opacity: 1;
}

.consent-confirmation input:focus-visible + .consent-checkmark {
  outline: 2px solid rgba(255, 255, 255, 0.45);
  outline-offset: 3px;
}

.consent-card .btn-primary {
  margin-top: 15px;
}

.consent-card .error-message {
  margin-top: 15px;
}

/* ---- Upload Section ---- */
.upload-section {
  margin-bottom: 24px;
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.dropzone {
  position: relative;
  overflow: hidden;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  padding: 50px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: var(--color-surface);
}

.dropzone:hover {
  border-color: rgba(206, 24, 30, 0.5);
  background: var(--color-surface-hover);
}

.dropzone.dragover {
  border-color: var(--color-primary);
  background: rgba(206, 24, 30, 0.05);
  transform: scale(1.01);
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.dropzone-icon {
  display: flex;
  margin-bottom: 10px;
}

.dropzone-title {
  font-weight: 700;
  font-size: 1rem;
  line-height: 150%;
  text-align: center;
}

.dropzone-hint {
  font-size: 0.875rem;
}

.dropzone-formats {
  font-size: 0.625rem;
  line-height: 150%;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
}

.source-overlay {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.3s ease,
    visibility 0s linear 0.3s;
  position: fixed;
  inset: 0;
  background: rgba(83, 83, 83, 0.5);
  z-index: 100;
  display: flex;
  align-items: flex-end;
}

.source-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  transition: all 0.3s ease;
}

.source-sheet {
  position: absolute;
  right: 50%;
  top: 50%;
  transform: translate(50%, -50%);
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 342px;
  width: 100%;
  background: var(--color-bg);
  border: 1px solid #fff;
  border-radius: 18px;
  padding: 50px 10px;
}

.source-option {
  width: 100%;
  padding: 10px 15px;
  background: var(--color-primary);
  border: none;
  border-radius: 20px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 20px;
  line-height: 120%;
  text-align: center;
  color: #fff;
  cursor: pointer;
  transition: filter 0.3s;
}

.source-option:last-child {
  background: #2a2a3a;
}

.source-option:hover {
  filter: brightness(80%);
}

/* Preview */
.dropzone-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.dropzone-preview img {
  max-width: 240px;
  max-height: 240px;
  border-radius: var(--radius-md);
  object-fit: cover;
}

.btn-remove {
  position: absolute;
  top: 2px;
  right: 20%;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.btn-remove:hover {
  background: var(--color-error);
}

/* ---- Buttons ---- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 30px;
  border: none;
  border-radius: var(--radius-lg);
  background-color: var(--color-primary);
  font-family: var(--font);
  color: var(--color-text);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 140%;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  background-color: var(--color-primary-hover);
  box-shadow: 0 6px 20px rgba(206, 24, 30, 0.3);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: transparent;
  color: var(--color-text-muted);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--color-text);
}

.btn-loader {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---- Error ---- */
.error-message {
  margin-top: 15px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  font-size: 0.9rem;
  text-align: center;
}

/* ============================================
   Status Page
   ============================================ */

.status-page .container {
  max-width: 500px;
}

.status-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.status-icon {
  margin-bottom: 20px;
}

.svg-icon {
  height: 80px;
  object-fit: contain;
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.status-icon.breathing {
  animation: breathe 2.5s ease-in-out infinite;
  will-change: transform;
}

.status-title {
  margin-bottom: 20px;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 140%;
  text-align: center;
}

.status-message {
  margin-bottom: 40px;
  font-weight: 400;
  font-size: 0.875rem;
  line-height: 150%;
  text-align: center;
}

/* Animation steps */
.fade {
  opacity: 1;
  transform: scale(1);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
  will-change: opacity, transform;
}

.fade-out {
  opacity: 0;
  transform: scale(0.98);
}

/* Progress */
.progress-wrapper {
  margin-bottom: 20px;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  position: relative;
  height: 100%;
  background: repeating-linear-gradient(
    -45deg,
    var(--color-primary),
    var(--color-primary) 10px,
    #a01015 10px,
    #a01015 20px
  );
  background-size: 28px 28px;
  animation: stripes 0.6s linear infinite;
}

.progress-fill.completed {
  background: var(--color-primary);
  animation: none;
}

@keyframes stripes {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 28px 0;
  }
}

.progress-fill.error {
  background: var(--color-error);
}

.progress-steps {
  margin-top: 16px;
}

.step-label {
  font-weight: 700;
  font-size: 1rem;
  line-height: 150%;
  text-align: center;
}

/* Fun Facts */
.fun-facts {
  margin-top: 20px;
}

.fun-fact {
  font-size: 0.75rem;
  line-height: 150%;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  transition: opacity 0.3s;
}

/* Discover */
.discover-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}

/* Video Section */
.video-section {
  display: flex;
  flex-direction: column;
  gap: 40px;
  animation: fadeIn 0.4s ease-out forwards;
}

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

/* Animation scene */
.scene {
  opacity: 0;
  transform: scale(0.98);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
}

.scene.show {
  opacity: 1;
  transform: scale(1);
}

.result-video {
  width: 100%;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  background: #000;
  outline: none;
}

.video-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Error */
.error-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

.error-detail {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* Share Link */
.share-link {
  margin-top: 40px;
  text-align: center;
}

.share-link p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 15px;
}

.link-box {
  display: flex;
  gap: 15px;
  max-width: 460px;
  margin: 0 auto;
}

.link-box input {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background-color: var(--color-surface);
  font-weight: 400;
  font-size: 0.75rem;
  line-height: 150%;
  text-align: center;
  color: var(--color-text);
  font-family: var(--font);
  outline: none;
}

.link-box input:focus {
  border-color: rgba(255, 255, 255, 0.2);
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .hero h1 {
    font-size: 1.375rem;
  }

  .consent-card {
    padding: 15px;
  }

  .consent-title {
    font-size: 1.2rem;
  }

  .status-card {
    padding: 15px;
  }

  .link-box {
    flex-direction: column;
  }

  .svg-icon {
    height: 73px;
  }
}
