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

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: #333;
  background: linear-gradient(135deg, #f0fdf4 0%, #eff6ff 100%);
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header Styles */
.header {
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #10b981, #3b82f6);
  border-radius: 50%;
}

.logo h1 {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
}

.nav {
  display: flex;
  gap: 24px;
}

.nav-link {
  color: #6b7280;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-link:hover {
  color: #111827;
}

/* Main Content */
.main {
  padding: 32px 0;
}

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

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 8px;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: #6b7280;
}

/* Wheel Section */
.wheel-section {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 32px;
  margin-bottom: 64px;
}

.wheel-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: white;
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.wheel-wrapper {
  position: relative;
  margin-bottom: 24px;
}

#wheelCanvas {
  cursor: pointer;
  transition: transform 0.1s ease;
  border-radius: 50%;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

#wheelCanvas:hover {
  transform: scale(1.02);
}

.wheel-pointer {
  position: absolute;
  top: 50%;
  right: -15px;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 20px solid #333;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  z-index: 10;
}

.wheel-controls {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Winner Display */
.winner-display {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 2px solid #f59e0b;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  margin-top: 24px;
  animation: slideIn 0.5s ease-out;
}

.winner-display.hidden {
  display: none;
}

.winner-display h3 {
  font-size: 1.5rem;
  color: #92400e;
  margin-bottom: 8px;
}

.winner-display p {
  font-size: 1.2rem;
  font-weight: 600;
  color: #b45309;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Controls Panel */
.controls-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Card Styles */
.card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.card-header {
  padding: 20px;
  border-bottom: 1px solid #e5e7eb;
}

.card-header h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-header p {
  color: #6b7280;
  font-size: 0.9rem;
}

.card-content {
  padding: 20px;
}

/* Add Segment */
.add-segment {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.add-segment input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}

.add-segment input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Segments List */
.segments-list {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.segment-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: #f9fafb;
  border-radius: 6px;
}

.segment-color {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
}

.segment-item input {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 13px;
}

.segment-item input:focus {
  outline: none;
  border-color: #3b82f6;
}

/* Statistics */
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.badge {
  background: #e5e7eb;
  color: #374151;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

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

.btn-primary {
  background: #3b82f6;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #2563eb;
  transform: translateY(-1px);
}

.btn-secondary {
  background: #6b7280;
  color: white;
}

.btn-secondary:hover:not(:disabled) {
  background: #4b5563;
  transform: translateY(-1px);
}

.btn-danger {
  background: #ef4444;
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
}

.btn-large {
  padding: 12px 24px;
  font-size: 16px;
}

.btn-icon {
  padding: 8px;
  width: 36px;
  height: 36px;
}

/* Description Section */
.description-section {
  text-align: center;
  margin-bottom: 64px;
}

.description-section h3 {
  font-size: 2rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 16px;
}

.description-section p {
  font-size: 1.1rem;
  color: #6b7280;
  max-width: 800px;
  margin: 0 auto 16px;
  line-height: 1.7;
}

.description-section .subtitle {
  color: #9ca3af;
  font-size: 1rem;
}

/* FAQ Section */
.faq-section {
  margin-bottom: 64px;
}

.faq-section h3 {
  font-size: 2rem;
  font-weight: 700;
  color: #111827;
  text-align: center;
  margin-bottom: 32px;
}

.faq-container {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-item {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.faq-question {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.faq-question h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #111827;
}

.faq-question i {
  color: #3b82f6;
}

.faq-answer {
  padding: 0 20px 20px;
  border-top: 1px solid #e5e7eb;
}

.faq-answer p {
  color: #6b7280;
  line-height: 1.6;
}

/* SEO Section */
.seo-section {
  background: white;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  margin-bottom: 64px;
}

.seo-content {
  max-width: 800px;
  margin: 0 auto;
}

.seo-content h3 {
  font-size: 2rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 24px;
}

.seo-content h4 {
  font-size: 1.3rem;
  font-weight: 600;
  color: #111827;
  margin: 24px 0 12px;
}

.seo-content p {
  color: #6b7280;
  margin-bottom: 16px;
  line-height: 1.7;
}

.seo-content ul {
  margin: 16px 0;
  padding-left: 20px;
}

.seo-content li {
  color: #6b7280;
  margin-bottom: 8px;
  line-height: 1.6;
}

.search-terms {
  background: #f9fafb;
  padding: 20px;
  border-radius: 8px;
  margin-top: 24px;
}

.search-terms h5 {
  font-weight: 600;
  color: #111827;
  margin-bottom: 8px;
}

.search-terms p {
  font-size: 0.9rem;
  color: #6b7280;
  margin: 0;
}

/* Footer */
.footer {
  background: #111827;
  color: white;
  padding: 48px 0 24px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  margin-bottom: 32px;
}

.footer-section h4 {
  font-weight: 700;
  margin-bottom: 16px;
}

.footer-section h5 {
  font-weight: 600;
  margin-bottom: 12px;
}

.footer-section p {
  color: #9ca3af;
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer-section ul {
  list-style: none;
}

.footer-section li {
  color: #9ca3af;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.footer-bottom {
  border-top: 1px solid #374151;
  padding-top: 24px;
  text-align: center;
}

.footer-bottom p {
  color: #9ca3af;
  font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .wheel-section {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .controls-panel {
    order: -1;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

  .header-content {
    flex-direction: column;
    height: auto;
    padding: 16px 0;
    gap: 16px;
  }

  .nav {
    gap: 16px;
  }

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

  .wheel-container {
    padding: 20px;
  }

  #wheelCanvas {
    width: 300px;
    height: 300px;
  }

  .wheel-controls {
    flex-direction: column;
    width: 100%;
  }

  .btn-large {
    width: 100%;
  }

  .description-section h3 {
    font-size: 1.5rem;
  }

  .faq-section h3 {
    font-size: 1.5rem;
  }

  .seo-content h3 {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.8rem;
  }

  #wheelCanvas {
    width: 250px;
    height: 250px;
  }

  .add-segment {
    flex-direction: column;
  }

  .add-segment input {
    margin-bottom: 8px;
  }
}

/* Animations */
.spinning {
  animation: spin 3s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(var(--spin-rotation, 1440deg));
  }
}

/* Loading States */
.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .spinning {
    animation-duration: 0.5s;
  }

  .btn:hover {
    transform: none;
  }

  #wheelCanvas:hover {
    transform: none;
  }
}

/* Focus Styles */
.btn:focus,
input:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .header,
  .footer,
  .controls-panel {
    display: none;
  }

  .wheel-section {
    grid-template-columns: 1fr;
  }
}
