/* ============================================
   Bot Racer — Web Interface Styles
   ============================================ */

:root {
  --color-bg: #0a0a0f;
  --color-surface: #12121a;
  --color-surface-hover: #1a1a25;
  --color-border: rgba(255, 255, 255, 0.06);
  --color-text: #e8e8ef;
  --color-text-muted: #8888a0;
  --color-primary: #e62020;
  --color-primary-light: #ff4444;
  --color-gradient-1: #e62020;
  --color-gradient-2: #ff6b35;
  --color-gradient-3: #ff9500;
  --color-success: #22c55e;
  --color-error: #ef4444;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-glow: 0 0 60px rgba(230, 32, 32, 0.15);
  --font: '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;
}

/* ---- Background glow ---- */
.bg-glow {
  position: fixed;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(230, 32, 32, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

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

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

.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: rgba(230, 32, 32, 0.7);
  box-shadow: 0 0 0 2px rgba(230, 32, 32, 0.22);
}

/* ---- Logo ---- */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.logo-icon {
  font-size: 28px;
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

.hero .logo {
  margin-bottom: 28px;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--color-gradient-1), var(--color-gradient-2), var(--color-gradient-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--color-text-muted);
  line-height: 1.6;
  max-width: 460px;
  margin: 0 auto;
}

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

/* ---- Upload Section ---- */
.upload-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--color-surface);
  position: relative;
  overflow: hidden;
}

.dropzone:hover {
  border-color: rgba(230, 32, 32, 0.3);
  background: var(--color-surface-hover);
}

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

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

.dropzone-icon {
  font-size: 48px;
  margin-bottom: 8px;
}

.dropzone-title {
  font-size: 1.1rem;
  font-weight: 500;
}

.dropzone-hint {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.dropzone-formats {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  opacity: 0.7;
  margin-top: 4px;
}

/* 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: 0;
  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;
  gap: 8px;
  padding: 16px 32px;
  border: none;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--color-gradient-1), var(--color-gradient-2));
  color: white;
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  box-shadow: 0 4px 24px rgba(230, 32, 32, 0.25);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 32px rgba(230, 32, 32, 0.35);
}

.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 {
  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;
}

/* ---- Features ---- */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 48px;
}

.feature {
  text-align: center;
  padding: 24px 12px;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  transition: transform 0.3s, border-color 0.3s;
}

.feature:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.1);
}

.feature-icon {
  font-size: 28px;
  display: block;
  margin-bottom: 10px;
}

.feature h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.feature p {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

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

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

.status-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  text-align: center;
}

.status-icon {
  font-size: 48px;
  margin-bottom: 16px;
  animation: pulse 2s ease-in-out infinite;
}

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

.status-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.status-message {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-bottom: 28px;
  line-height: 1.5;
}

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

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

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-gradient-1), var(--color-gradient-2), var(--color-gradient-3));
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

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

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

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

.step-label.active {
  color: var(--color-text);
}

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

.fun-fact {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-style: italic;
  transition: opacity 0.3s;
  line-height: 1.5;
}

/* Download */
.download-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.btn-download {
  font-size: 1.1rem;
  padding: 18px 36px;
}

/* 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: 24px;
  text-align: center;
}

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

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

.link-box input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font);
  font-size: 0.85rem;
  outline: none;
}

.link-box input:focus {
  border-color: rgba(230, 32, 32, 0.3);
}

.btn-copy {
  padding: 10px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-copy:hover {
  background: var(--color-surface-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

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

  .features {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .feature {
    display: flex;
    align-items: center;
    text-align: left;
    gap: 16px;
    padding: 16px 20px;
  }

  .feature-icon {
    margin-bottom: 0;
    font-size: 24px;
  }

  .dropzone {
    padding: 36px 16px;
  }

  .status-card {
    padding: 28px 20px;
  }

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