:root {
  --primary: #2e7d32;
  --primary-dark: #4caf50;
  --secondary: #f5f5f5;
  --text: #334155;
  --light-text: #64748b;
  --border: #e2e8f0;
  --danger: #ef4444;
  --success: #10b981;
}

/* * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
}

body {
  background-color: #f8fafc;
  color: var(--text);
  line-height: 1.5;
  font-size: 16px;
} */

.container1 {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

.main {
  background-color: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 20px 15px;
  margin-bottom: 20px;
  margin-top: 60px;
  border-radius: 8px;
}

h1 {
  color: var(--primary);
  font-size: 1.8rem;
  font-weight: 600;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: var(--text);
}

h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: var(--text);
}

.tab-bar {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}

.tab-bar::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Edge */
}

.tab {
  padding: 10px 15px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-weight: 500;
  color: var(--light-text);
  transition: all 0.2s;
  white-space: nowrap;
}

.tab.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}

.tab:hover:not(.active) {
  color: var(--text);
  background-color: var(--secondary);
}

.panel {
  display: none;
  animation: fadeIn 0.3s;
}

.panel.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 20px 15px;
  margin-bottom: 20px;
  width: 100%;
}

form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
}

label {
  font-weight: 500;
  margin-top: 15px;
  margin-bottom: 10px;
  display: block;
}

input[type="text"],
input[type="datetime-local"],
textarea,
select {
  width: 100%;
  padding: 12px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 16px;
  --webkit-appearance: none; /* Fix for iOS */
}

.form-group {
  margin-bottom: 15px;
  width: 100%;
}

button,
.btn {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 12px 15px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: background-color 0.2s;
  width: 100%;
  max-width: 100%;
  text-align: center;
}

button:hover,
.btn:hover {
  background-color: var(--primary-dark);
}

.btn-danger {
  background-color: var(--danger);
}

.btn-danger:hover {
  background-color: #dc2626;
}

.symptom-levels {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 5px;
}

.symptom-level {
  flex: 1;
  text-align: center;
  padding: 10px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 60px;
}

.symptom-level:hover {
  background-color: var(--secondary);
}

.symptom-level.selected {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
}

.log-item {
  border-bottom: 1px solid var(--border);
  padding: 15px 0;
}

.log-item:last-child {
  border-bottom: none;
}

.log-item-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 15px;
}

.log-date {
  font-weight: 500;
}

.log-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.log-actions button {
  padding: 8px 12px;
  font-size: 14px;
  width: auto;
}

.log-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.log-section {
  width: 100%;
}

.log-section h4 {
  margin-bottom: 8px;
  color: var(--light-text);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tag {
  display: inline-block;
  background-color: var(--secondary);
  padding: 5px 10px;
  border-radius: 4px;
  margin-right: 5px;
  margin-bottom: 8px;
  font-size: 14px;
}

.symptom-tag {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.symptom-level-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.level-1 {
  background-color: #22c55e;
}
.level-2 {
  background-color: #f59e0b;
}
.level-3 {
  background-color: #ef4444;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--light-text);
}

.chart-container {
  height: 250px;
  margin-bottom: 20px;
  width: 100%;
  overflow-x: auto;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.filter {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Mobile-specific styles */
@media (min-width: 768px) {
  /* Restore desktop layouts for larger screens */
  .log-item-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .log-content {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .log-section {
    flex: 1;
    min-width: 200px;
  }

  button,
  .btn {
    width: auto;
  }

  .chart-container {
    height: 300px;
  }

  .main {
    padding: 20px;
  }

  .card {
    padding: 20px;
  }
}

/* Fix for iPhone notch and safe areas */
@supports (padding: max(0px)) {
  .container1 {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }

  body {
    padding-bottom: max(0px, env(safe-area-inset-bottom));
  }
}

/* Adjust font sizes for very small screens */
@media (max-width: 375px) {
  body {
    font-size: 14px;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  h3 {
    font-size: 1.1rem;
  }

  .symptom-level {
    font-size: 10px;
  }
}
