/* Demo Page Styles */
:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --success-color: #10b981;
  --error-color: #ef4444;
  --warning-color: #f59e0b;
  --info-color: #3b82f6;
  --neutral-color: #6b7280;
  --bg-dark: #0f172a;
  --bg-light: #f8fafc;
  --text-dark: #1e293b;
  --text-light: #f1f5f9;
}

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

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
  transition: all 0.3s ease;
}

body.dark {
  background: var(--bg-dark);
  color: var(--text-light);
}

.hero {
  background: var(--primary-gradient);
  color: white;
  padding: 4rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  animation: float 20s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(1deg);
  }
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.hero p {
  font-size: 1.25rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.demo-card {
  background: white;
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

body.dark .demo-card {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.1);
}

.demo-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.demo-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--primary-gradient);
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.demo-card p {
  margin-bottom: 1.5rem;
  opacity: 0.8;
}

.demo-card pre {
  background: #f8fafc;
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.85rem;
  margin: 1rem 0;
  border-left: 4px solid var(--info-color);
}

body.dark .demo-card pre {
  background: #0f172a;
  color: var(--text-light);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-dark);
}

body.dark .form-group label {
  color: var(--text-light);
}

.form-control {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: white;
  font-family: inherit;
}

body.dark .form-control {
  background: #334155;
  border-color: #475569;
  color: var(--text-light);
}

.form-control:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
  background: #f1f5f9;
  color: var(--text-dark);
  border: 2px solid #e2e8f0;
}

body.dark .btn-secondary {
  background: #334155;
  color: var(--text-light);
  border-color: #475569;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.settings-panel {
  background: #f8fafc;
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 2px solid #e2e8f0;
}

body.dark .settings-panel {
  background: #1e293b;
  border-color: #334155;
}

.settings-panel h3 {
  margin-bottom: 1rem;
  color: var(--text-dark);
}

body.dark .settings-panel h3 {
  color: var(--text-light);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 26px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: var(--success-color);
}

input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

.theme-toggle {
  position: fixed;
  top: 2rem;
  right: 2rem;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  font-size: 1.25rem;
  transition: all 0.3s ease;
  z-index: 1000;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

body.dark .theme-toggle {
  background: rgba(30, 41, 59, 0.9);
  color: var(--text-light);
}

.theme-toggle:hover {
  transform: scale(1.1);
}

.stats-display {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.stat-item {
  background: rgba(102, 126, 234, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
}

body.dark .stat-item {
  background: rgba(102, 126, 234, 0.2);
}

.documentation {
  margin-top: 3rem;
  padding: 2rem;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

body.dark .documentation {
  background: #1e293b;
}

.documentation h2 {
  margin-bottom: 1rem;
  color: var(--text-dark);
}

body.dark .documentation h2 {
  color: var(--text-light);
}

.code-example {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1rem 0;
  font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
  font-size: 0.9rem;
}

.code-example .keyword {
  color: #c792ea;
}

.code-example .string {
  color: #c3e88d;
}

.code-example .comment {
  color: #636f88;
  font-style: italic;
}

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

  .hero p {
    font-size: 1.1rem;
  }

  .container {
    padding: 2rem 1rem;
  }

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

  .demo-card {
    padding: 1.5rem;
  }

  .btn-group {
    flex-direction: column;
  }

  .btn {
    justify-content: center;
  }

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

  .theme-toggle {
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
  }

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

@media (max-width: 480px) {
  .hero {
    padding: 3rem 1rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .demo-card {
    padding: 1rem;
    border-radius: 16px;
  }

  .settings-panel {
    padding: 1rem;
  }
}

/* Print Styles */
@media print {
  .theme-toggle,
  .btn-group,
  .settings-panel {
    display: none !important;
  }

  .demo-card {
    break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .demo-card {
    border: 2px solid var(--text-dark) !important;
  }

  .btn-primary {
    background: #000080 !important;
    border: 2px solid #000080 !important;
  }

  .form-control {
    border: 2px solid var(--text-dark) !important;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }

  .hero::before {
    animation: none;
  }
}
