
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

body {
  background-color: #ffffff;
  color: #1d1d1f;
  line-height: 1.47059;
  letter-spacing: -0.022em;
  width: 100%;
  overflow-x: hidden;
}

.container {
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 20px;
  box-sizing: border-box;
}

h1 {
  text-align: center;
  color: #1d1d1f;
  font-size: 48px;
  font-weight: 600;
  letter-spacing: -0.003em;
  margin-bottom: 40px;
}

.input-section {
  display: flex;
  margin-bottom: 40px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

#url-input {
  flex: 1;
  padding: 15px 20px;
  border: none;
  background-color: #f5f5f7;
  border-radius: 12px 0 0 12px;
  font-size: 19px;
  font-weight: bold;
  transition: all 0.2s ease;
}

#url-input:focus {
  outline: none;
  background-color: #eaeaec;
}

#analyze-btn {
  padding: 15px 25px;
  background-color: #0071e3;
  color: white;
  border: none;
  border-radius: 0 12px 12px 0;
  cursor: pointer;
  font-size: 17px;
  font-weight: 500;
  transition: all 0.2s ease;
}

#analyze-btn:hover {
  background-color: #0077ed;
}

#loading {
  text-align: center;
  padding: 30px;
  font-size: 21px;
  color: #86868b;
  font-weight: 500;
}

.hidden {
  display: none;
}

.summary {
  background-color: #f5f5f7;
  border-radius: 20px;
  padding: 30px;
  text-align: center;
  margin-bottom: 40px;
}

.summary h2 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 20px;
}

.total-co2 {
  font-size: 56px;
  font-weight: 600;
  color: #1d1d1f;
  margin: 20px 0;
  line-height: 1.3;
  white-space: pre-line;
}

.details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.chart-container {
  background-color: #f5f5f7;
  border-radius: 20px;
  padding: 30px;
  height: 100%;
}

.factors {
  background-color: #f5f5f7;
  border-radius: 20px;
  padding: 30px;
}

.factors h3 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 25px;
}

.factor-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.factor-card {
  background-color: #ffffff;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.factor-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.factor-card h4 {
  color: #1d1d1f;
  margin-bottom: 15px;
  font-weight: 600;
  font-size: 18px;
}

.factor-card span {
  font-size: 22px;
  font-weight: 500;
  color: #0071e3;
}

h2, h3 {
  color: #1d1d1f;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  h1 {
    font-size: 32px;
    margin-bottom: 30px;
  }
  
  .container {
    padding: 20px 15px;
  }
  
  .details {
    grid-template-columns: 1fr;
  }
  
  .factor-grid {
    grid-template-columns: 1fr;
  }
  
  .total-co2 {
    font-size: 36px;
    word-break: break-word;
    white-space: pre-line;
  }
  
  .input-section {
    flex-direction: column;
    margin-bottom: 30px;
  }
  
  #url-input {
    border-radius: 12px;
    margin-bottom: 10px;
    width: 100%;
  }
  
  #analyze-btn {
    border-radius: 12px;
    width: 100%;
  }
  
  .summary, .chart-container, .factors {
    padding: 20px;
  }
  
  .chart-container {
    height: 250px;
  }
  
  .factor-card {
    padding: 15px;
  }
  
  .factor-card h4 {
    font-size: 16px;
  }
  
  .factor-card span {
    font-size: 18px;
  }
}

/* Small phone responsiveness */
@media (max-width: 375px) {
  h1 {
    font-size: 28px;
  }
  
  .total-co2 {
    font-size: 28px;
  }
  
  .summary h2, .factors h3 {
    font-size: 22px;
  }
}

/* Fix for iOS Safari viewport issues */
@supports (-webkit-touch-callout: none) {
  body, html {
    height: -webkit-fill-available;
  }
  
  .container {
    min-height: -webkit-fill-available;
  }
}

/* Ensure correct tap target sizes for touch devices */
button, 
input[type="text"] {
  min-height: 44px;
}
