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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #1a1a2e;
  min-height: 100vh;
  padding: 20px;
  color: #e0e0e0;
}

.app {
  max-width: 1400px;
  margin: 0 auto;
}

.header {
  background: #16213e;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  text-align: center;
  margin-bottom: 30px;
  border: 1px solid #2a3f5f;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
}

.header h1 {
  color: #4db8ff;
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.subtitle {
  color: #b0b0b0;
  font-size: 1.1rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #2E86AB;
}

.user-name {
  font-weight: 600;
  color: #e0e0e0;
}

/* Auth Container */
.auth-container {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  background: #16213e;
  padding: 60px 40px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  text-align: center;
  max-width: 500px;
  width: 100%;
  border: 1px solid #2a3f5f;
}

.auth-card h1 {
  color: #4db8ff;
  font-size: 3rem;
  margin-bottom: 15px;
}

.auth-subtitle {
  color: #b0b0b0;
  font-size: 1.3rem;
  margin-bottom: 20px;
}

.auth-description {
  color: #a0a0a0;
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 40px;
}

.btn-large {
  padding: 18px 36px;
  font-size: 1.2rem;
  width: 100%;
}

.auth-form {
  width: 100%;
  margin-bottom: 20px;
}

.auth-form .form-group {
  margin-bottom: 15px;
}

.auth-form input {
  width: 100%;
  padding: 15px;
  font-size: 1rem;
  border: 2px solid #2a3f5f;
  border-radius: 8px;
  box-sizing: border-box;
  background: #0f1626;
  color: #e0e0e0;
}

.auth-form input:focus {
  outline: none;
  border-color: #4db8ff;
}

.container {
  background: #16213e;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 1px solid #2a3f5f;
}

/* Controls */
.controls {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
  flex-wrap: wrap;
  align-items: center;
}

.viewing-range {
  margin-top: 20px;
  font-size: 12px;
  color: #666;
  text-align: center;
}

.view-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-left: auto;
}

.view-controls label {
  font-weight: 600;
  color: #e0e0e0;
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: #2E86AB;
  color: white;
}

.btn-primary:hover {
  background: #236a8a;
}

.btn-secondary {
  background: #E63946;
  color: white;
}

.btn-secondary:hover {
  background: #c42d39;
}

.auth-toggle-button {
  margin-top: 10px;
}

.btn-warning {
  background: #F77F00;
  color: white;
}

.btn-warning:hover {
  background: #d66d00;
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.9rem;
}

.btn-delete {
  padding: 6px 12px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.85rem;
  margin-top: 10px;
}

.btn-delete:hover {
  background: #c82333;
}

/* Migraine Form */
.migraine-form {
  background: #0f1626;
  padding: 25px;
  border-radius: 10px;
  margin-bottom: 25px;
  border: 2px solid #E63946;
}

.migraine-form h3 {
  color: #E63946;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #e0e0e0;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 2px solid #2a3f5f;
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  background: #0f1626;
  color: #e0e0e0;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #4db8ff;
}

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

/* Chart */
.chart-container {
  margin-bottom: 30px;
}

.chart-canvas-wrapper {
  height: 400px;
  position: relative;
}

.chart-container h2 {
  color: #e0e0e0;
  margin-bottom: 20px;
  font-size: 1.8rem;
}

.loading {
  text-align: center;
  padding: 50px;
  font-size: 1.2rem;
  color: #b0b0b0;
}

.no-data {
  text-align: center;
  padding: 50px;
  background: #0f1626;
  border-radius: 10px;
  color: #b0b0b0;
  border: 1px solid #2a3f5f;
}

.chart-legend {
  margin-top: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #2E86AB;
}

.chart-legend p {
  margin: 5px 0;
  color: #555;
}

/* Custom Tooltip */
.custom-tooltip {
  background: white;
  padding: 15px;
  border: 2px solid #2E86AB;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.custom-tooltip .label {
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.custom-tooltip .pressure {
  color: #2E86AB;
  font-weight: 600;
  margin: 5px 0;
}

.custom-tooltip .change {
  margin: 3px 0;
  font-size: 0.9rem;
}

.custom-tooltip .change.negative {
  color: #E63946;
}

.custom-tooltip .change.positive {
  color: #06A77D;
}

.custom-tooltip .type {
  margin-top: 8px;
  font-size: 0.85rem;
  color: #666;
}

/* Migraine Logs */
.migraine-logs {
  margin-bottom: 30px;
}

.migraine-logs h2 {
  color: #e0e0e0;
  margin-bottom: 20px;
  font-size: 1.8rem;
}

.no-logs {
  text-align: center;
  padding: 30px;
  color: #b0b0b0;
  background: #0f1626;
  border-radius: 8px;
  border: 1px solid #2a3f5f;
}

.log-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 1024px) {
  .log-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .log-list {
    grid-template-columns: 1fr;
  }
}

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

.change-chart-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.change-chart-label {
  font-size: 14px;
  font-weight: normal;
}

.change-chart-input {
  width: 80px;
  padding: 5px;
  font-size: 14px;
  border: 1px solid #2a3f5f;
  border-radius: 4px;
  background: #0f1626;
  color: #e0e0e0;
}

.log-item {
  padding: 20px;
  border-radius: 10px;
  border-left: 5px solid;
  background: #0f1626;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  border: 1px solid #2a3f5f;
}

.log-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.log-item.severity-mild {
  border-left-color: #FFC107;
}

.log-item.severity-moderate {
  border-left-color: #F77F00;
}

.log-item.severity-severe {
  border-left-color: #E63946;
}

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

.log-date {
  font-weight: 600;
  color: #e0e0e0;
  font-size: 1.1rem;
}

.severity-badge {
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  color: white;
}

.severity-badge.mild {
  background: #FFC107;
}

.severity-badge.moderate {
  background: #F77F00;
}

.severity-badge.severe {
  background: #E63946;
}

.log-comment {
  color: #b0b0b0;
  line-height: 1.6;
  margin-bottom: 10px;
}

/* Info Section */
.info-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 25px;
  border-radius: 10px;
  margin-top: 30px;
}

.info-section h3 {
  margin-bottom: 15px;
  font-size: 1.5rem;
}

.info-section p {
  line-height: 1.8;
  margin-bottom: 10px;
  opacity: 0.95;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

/* Alert Modal */
.alert-modal-content {
  background: #16213e;
  border-radius: 15px;
  max-width: 450px;
  width: 100%;
  padding: 40px 30px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid #2a3f5f;
  text-align: center;
}

.alert-modal-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  color: #4db8ff;
}

.alert-modal-message {
  font-size: 1.2rem;
  color: #e0e0e0;
  margin-bottom: 30px;
  line-height: 1.6;
}

.alert-modal-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.alert-modal-actions .btn {
  min-width: 120px;
}

.modal-content {
  background: #16213e;
  border-radius: 15px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid #2a3f5f;
}

.modal-header {
  padding: 25px 30px;
  border-bottom: 1px solid #2a3f5f;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  color: #4db8ff;
  margin: 0;
  font-size: 1.8rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  color: #b0b0b0;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: #2a3f5f;
  color: #e0e0e0;
}

.modal-body {
  padding: 30px;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.modal-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.modal-form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-form-field label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #b0b0b0;
  letter-spacing: 0.02em;
}

.modal-form-field input,
.modal-form-field select,
.modal-form-field textarea {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #2a3f5f;
  background: #0f1626;
  color: #e0e0e0;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.modal-form-field input:focus,
.modal-form-field select:focus,
.modal-form-field textarea:focus {
  outline: none;
  border-color: #4db8ff;
  box-shadow: 0 0 0 2px rgba(77, 184, 255, 0.2);
}

.modal-form-field textarea {
  resize: vertical;
  min-height: 100px;
}

.modal-form-field.full-width {
  grid-column: 1 / -1;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.modal-action-btn {
  min-width: 110px;
}

.modal-chart-container {
  margin-top: 30px;
  padding: 20px;
  background: #0f1626;
  border-radius: 10px;
  border: 1px solid #2a3f5f;
}

.modal-chart-container h3 {
  color: #e0e0e0;
  margin-bottom: 15px;
  font-size: 1.3rem;
}

.modal-chart-wrapper {
  height: 300px;
  position: relative;
}

/* Responsive */
@media (max-width: 768px) {
  .header h1 {
    font-size: 1.8rem;
  }
  
  .controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .view-controls {
    margin-left: 0;
    flex-direction: column;
    align-items: stretch;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .modal-content {
    max-width: 100%;
  }
  
  .modal-header {
    padding: 20px;
  }
  
  .modal-body {
    padding: 20px;
  }
  
  .log-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}
