/* Reset and base styles */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "San Francisco", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background-color: #fff;
  color: #111;
  line-height: 1.5;
  min-height: 100vh;
  padding: 2rem;
  font-size: 16px;
}

main {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  background: #f9f9f9;
  border-radius: 12px;
  padding: 2rem 2.5rem 2.5rem;
  box-shadow: 0 4px 20px rgb(0 0 0 / 0.08);
}

h1 {
  font-weight: 600;
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: #111;
  text-align: center;
}

.subtitle {
  text-align: center;
  color: #666;
  font-size: 1rem;
  margin-bottom: 2rem;
  font-weight: 500;
}

.tool-selector {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  background: white;
  padding: 0.5rem;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.05);
}

.tool-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  background: transparent;
  color: #666;
}

.tool-btn.active {
  background: #8b138b;
  color: white;
}

.tool-btn:hover:not(.active) {
  background: #f0f0f0;
}

.tool-section {
  display: none;
}

.tool-section.active {
  display: block;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.section-header h3 {
  margin: 0;
  color: #333;
  font-size: 1.2rem;
}

.add-btn {
  background: #34c759;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.add-btn:hover {
  background: #2fb344;
}

.position-card, .hedge-option-card, .bracket-position {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.05);
  border: 1px solid #e0e0e0;
}

.position-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.position-title {
  font-weight: 600;
  color: #8b138b;
}

.remove-position, .remove-hedge, .remove-bracket {
  background: #ff3b30;
  color: white;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.input-group {
  display: flex;
  flex-direction: column;
}

.input-group label {
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: #333;
  font-size: 0.9rem;
}

input[type="text"], input[type="number"], select {
  padding: 0.6rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

input:focus, select:focus {
  border-color: #8b138b;
  outline-offset: 2px;
  outline: 2px solid rgba(139, 19, 139, 0.2);
}

.hedge-options {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.05);
}

.hedge-strategy {
  margin-top: 1.5rem;
}

.strategy-options {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.5rem;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.radio-option input[type="radio"] {
  margin: 0;
  accent-color: #8b138b;
}

.hedge-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #ddd;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  margin-top: 0.5rem;
}

.hedge-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #8b138b;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.2);
}

.slider-value {
  text-align: center;
  font-weight: 600;
  color: #8b138b;
  margin-top: 0.5rem;
}

.results {
  margin-top: 2rem;
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.05);
}

.error {
  margin-top: 1rem;
  padding: 1rem;
  background-color: #ffebeb;
  color: #d32f2f;
  border-radius: 6px;
  font-weight: 600;
}

.profit-positive {
  color: #2e7d32;
}

.profit-negative {
  color: #d32f2f;
}

.scenario-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.scenario-table th,
.scenario-table td {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid #e0e0e0;
}

.scenario-table th {
  background: #f8f8f8;
  font-weight: 600;
}

/* About section styles */
.about-content {
  background: white;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.05);
}

.about-content h2 {
  color: #8b138b;
  margin-bottom: 1.5rem;
}

.about-content h3 {
  color: #8b138b;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.about-content h4 {
  color: #333;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.about-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e0e0e0;
}

.about-section:last-child {
  border-bottom: none;
}

.when-to-hedge {
  background: #f8f5ff;
  padding: 1rem;
  border-radius: 6px;
  margin-top: 1rem;
}

.steps {
  margin-top: 1rem;
}

.step {
  background: #f8f5ff;
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.example {
  background: #e8f5e8;
  padding: 1rem;
  border-radius: 6px;
  margin-top: 1rem;
}

.odds-table table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
}

.odds-table th,
.odds-table td {
  text-align: center;
  padding: 0.5rem;
  border: 1px solid #e0e0e0;
}

.odds-table th {
  background: #8b138b;
  color: white;
  font-weight: 600;
}

@media (max-width: 768px) {
  .tool-selector {
    flex-wrap: wrap;
  }
  
  .tool-btn {
    flex: 1 1 calc(50% - 0.25rem);
    min-width: calc(50% - 0.25rem);
  }
  
  .input-row {
    grid-template-columns: 1fr;
  }
  
  .strategy-options {
    flex-direction: column;
    gap: 0.75rem;
  }
}
