:root {
  --primary: #f5a623;
  --primary-dark: #e09000;
  --primary-light: #ffd280;
  --secondary: #ff6b35;
  --bg: #fff8f0;
  --card-bg: rgba(255, 255, 255, 0.85);
  --text: #2d2d2d;
  --text-light: #666;
  --success: #4caf50;
  --shadow: 0 8px 32px rgba(245, 166, 35, 0.15);
  --radius: 16px;
  --radius-sm: 10px;
}

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

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #fff8f0 0%, #ffe4c9 100%);
  min-height: 100vh;
  color: var(--text);
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  padding: 20px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(245, 166, 35, 0.3);
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.logo-icon {
  font-size: 32px;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.header h1 {
  color: white;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* Mode Tabs */
.mode-tabs {
  display: flex;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  margin: 16px;
  border-radius: var(--radius);
  padding: 6px;
  box-shadow: var(--shadow);
}

.tab {
  flex: 1;
  padding: 14px 20px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
}

.tab.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(245, 166, 35, 0.4);
}

.tab:hover:not(.active) {
  background: rgba(245, 166, 35, 0.1);
  color: var(--primary-dark);
}

/* Calculator */
.calculator {
  flex: 1;
  padding: 0 16px;
}

.inputs {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.input-row {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.input-group {
  flex: 1;
  position: relative;
}

.input-group label,
.slider-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-light);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Stepper */
.stepper {
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.stepper-btn {
  width: 44px;
  height: 44px;
  border: none;
  background: var(--primary);
  color: white;
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.stepper-btn:hover {
  background: var(--primary-dark);
}

.stepper-btn:active {
  transform: scale(0.95);
}

.stepper input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: none;
  background: white;
  text-align: center;
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.stepper input:focus {
  outline: none;
}

.unit {
  position: absolute;
  right: -24px;
  bottom: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-light);
}

/* Sliders */
.slider-group {
  margin-bottom: 24px;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.slider-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--success);
}

input[type="range"] {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--primary-light) 0%, var(--primary) 100%);
  appearance: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  border: 4px solid var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: transform 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  border: 4px solid var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}

/* Yeast Selector */
.yeast-selector {
  margin-top: 24px;
}

.yeast-buttons {
  display: flex;
  gap: 8px;
}

.yeast-btn {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--primary-light);
  background: white;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.yeast-btn:hover {
  border-color: var(--primary);
  background: rgba(245, 166, 35, 0.05);
}

.yeast-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Results */
.results {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.results h2 {
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

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

.result-card {
  background: linear-gradient(135deg, var(--primary-light) 0%, #fff 50%);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.result-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(245, 166, 35, 0.2);
}

.result-card.flour { border-color: #e8d4b8; }
.result-card.water { border-color: #b8d4e8; background: linear-gradient(135deg, #d4e8f5 0%, #fff 50%); }
.result-card.salt-result { border-color: #d8d8d8; background: linear-gradient(135deg, #e8e8e8 0%, #fff 50%); }
.result-card.yeast { border-color: #d4e8b8; background: linear-gradient(135deg, #e8f5d4 0%, #fff 50%); }

.result-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-light);
  margin-bottom: 8px;
}

.result-value {
  display: block;
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  transition: all 0.3s ease;
}

.result-unit {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-light);
  margin-top: 6px;
}

/* Footer */
.footer {
  padding: 20px;
  text-align: center;
}

.footer p {
  font-size: 14px;
  color: var(--text-light);
}

/* Responsive */
@media (max-width: 400px) {
  .input-row {
    flex-direction: column;
    gap: 20px;
  }
  
  .unit {
    position: static;
    display: block;
    margin-top: 6px;
    text-align: center;
  }
}

/* Animation for value changes */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.result-value.updating {
  animation: pulse 0.3s ease;
}
