:root {
  /* Light Mode Palette */
  --bg-color: #f8f9fa;
  --container-bg: #ffffff;
  --text-primary: #212529;
  --text-secondary: #6c757d;
  --accent-color: #4caf50;
  --accent-hover: #43a047;
  --number-bg: #e9ecef;
  --number-text: #495057;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --transition-speed: 0.3s;
}

[data-theme='dark'] {
  /* Dark Mode Palette */
  --bg-color: #121212;
  --container-bg: #1e1e1e;
  --text-primary: #f8f9fa;
  --text-secondary: #adb5bd;
  --accent-color: #66bb6a;
  --accent-hover: #81c784;
  --number-bg: #2d2d2d;
  --number-text: #e9ecef;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  transition: background-color var(--transition-speed), color var(--transition-speed);
  padding: 2rem 0;
}

.main-container {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 90%;
}

.tab-content {
  display: none;
  width: 100%;
  justify-content: center;
}

.tab-content.active {
  display: flex;
}

.lotto-machine, .ai-card {
  text-align: center;
  background-color: var(--container-bg);
  padding: 3rem;
  border-radius: 1.5rem;
  box-shadow: var(--shadow-lg);
  width: 400px;
  max-width: 100%;
  transition: background-color var(--transition-speed), box-shadow var(--transition-speed);
}

h1 {
  margin-top: 0;
  font-size: 1.75rem;
  color: var(--text-primary);
}

.description {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* Navigation */
.app-nav {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  background-color: var(--container-bg);
  padding: 0.5rem;
  border-radius: 1rem;
  box-shadow: var(--shadow-md);
}

.nav-btn {
  padding: 0.5rem 1.5rem;
  border: none;
  background: none;
  border-radius: 0.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  font-weight: 600;
  transition: all 0.2s;
}

.nav-btn.active {
  background-color: var(--accent-color);
  color: #ffffff;
}

/* Lotto Styles */
.number-display {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin: 2.5rem 0;
  min-height: 3.5rem;
}

.number {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background-color: var(--number-bg);
  color: var(--number-text);
  font-size: 1.25rem;
  font-weight: bold;
  box-shadow: var(--shadow-sm);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.generate-btn, .start-btn {
  padding: 0.75rem 1.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  border: none;
  border-radius: 0.75rem;
  background-color: var(--accent-color);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 14px 0 rgba(76, 175, 80, 0.39);
  transition: all var(--transition-speed);
  width: 100%;
}

.generate-btn:hover, .start-btn:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
}

/* AI Test Styles */
.webcam-wrapper {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto 2rem;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--accent-color);
  background-color: var(--number-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.webcam-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}

.placeholder-webcam {
  color: var(--text-secondary);
}

.result-labels {
  margin-top: 2rem;
  text-align: left;
}

.result-item {
  margin-bottom: 1rem;
}

.label-text {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.progress-bar-bg {
  height: 0.5rem;
  background-color: var(--number-bg);
  border-radius: 0.25rem;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background-color: var(--accent-color);
  width: 0%;
  transition: width 0.3s ease-out;
}

/* Theme Switcher Styles */
.theme-toggle-container {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
}

.divider {
  height: 1px;
  background-color: var(--number-bg);
  margin: 2.5rem 0;
  width: 100%;
}

.partnership-section h2 {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.partnership-form {
  text-align: left;
}

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

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

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--number-bg);
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  box-sizing: border-box;
}

.submit-btn {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 0.5rem;
  background-color: var(--text-primary);
  color: var(--container-bg);
  cursor: pointer;
}

.comments-container {
  width: 100%;
  max-width: 400px;
  margin: 2rem 0;
  padding: 2rem;
  background-color: var(--container-bg);
  border-radius: 1.5rem;
  box-shadow: var(--shadow-lg);
  box-sizing: border-box;
}
