 {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Poppins', 'Segoe UI', sans-serif;
}

body {
  background-color: #f8f9fa;
  color: #333;
  line-height: 1.6;
  padding: 0;
  margin: 0;
}

/* Header styles */
.header {
  background: linear-gradient(135deg, #9370DB 0%, #6a5acd 100%);
  color: white;
  text-align: center;
  padding: 3rem 1rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.header h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.header p {
  font-size: 1.2rem;
  opacity: 0.95;
}

/* Container styles */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  background-color: white;
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
  border-left: 4px solid #9370DB;
}

h2 {
  color: #444;
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
  font-weight: 600;
  position: relative;
  padding-bottom: 0.5rem;
}

h2:after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 60px;
  background-color: #9370DB;
}

/* Form styles */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  font-weight: 500;
  margin-bottom: 0.5rem;
  display: block;
  color: #555;
}

input[type="time"], input[type="text"] {
  padding: 0.9rem 1rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  width: 100%;
  max-width: 300px;
  transition: border-color 0.3s;
}

input:focus {
  outline: none;
  border-color: #9370DB;
  box-shadow: 0 0 0 2px rgba(147, 112, 219, 0.2);
}

button {
  background-color: #9370DB;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.9rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

button:hover {
  background-color: #8a65d7;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

button:active {
  transform: translateY(0);
}

/* Weather section styles */
.weather-inputs {
  display: flex;
  gap: 1rem;
  margin: 1rem 0;
  align-items: center;
  flex-wrap: wrap;
}

#cityInput {
  flex: 1;
  max-width: 300px;
}

#weatherDisplay {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background-color: #f9f7ff;
  border-radius: 8px;
}

.weather-result h3 {
  color: #6a5acd;
  margin-bottom: 0.8rem;
  font-size: 1.3rem;
}

.weather-info {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.weather-info p {
  background-color: white;
  padding: 1rem;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.weather-tip {
  margin-top: 1.5rem;
  font-style: italic;
  color: #555;
  background-color: #f3f0fa;
  padding: 1rem;
  border-radius: 6px;
  border-left: 3px solid #9370DB;
}

/* Results section styles */
#results {
  display: none;
}

#results.active {
  display: block;
  animation: fadeIn 0.5s ease-out;
}

.results-card {
  background-color: #f9f7ff;
  padding: 1.5rem;
  border-radius: 8px;
  margin-top: 1rem;
}

.results-title {
  font-weight: 600;
  color: #6a5acd;
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.sleep-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.stat-card {
  background-color: white;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  text-align: center;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #9370DB;
  margin: 0.5rem 0;
}

.stat-label {
  color: #666;
  font-size: 0.9rem;
}

/* Footer styles */
.footer {
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 3rem;
  color: #666;
  font-size: 0.9rem;
  border-top: 1px solid #eee;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .header {
    padding: 2rem 1rem;
  }
  
  .header h1 {
    font-size: 2.2rem;
  }
  
  .section {
    padding: 1.5rem;
  }
  
  .form-group {
    margin-bottom: 1rem;
  }
  
  input[type="time"], input[type="text"] {
    width: 100%;
    max-width: none;
  }
  
  .weather-inputs {
    flex-direction: column;
    align-items: flex-start;
  }
  
  #cityInput {
    width: 100%;
    max-width: none;
  }
}
