/* Reset browser weird spacing */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Page base */
body {
  min-height: 100vh;
  background: #111;
  color: #00ff99;
  font-family: Arial, sans-serif;

  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* Main app container */
.container {
  margin-top: 80px;
  width: 100%;
  max-width: 420px;
  text-align: center;
}

/* Inputs */
input {
  width: 100%;
  padding: 10px;
  margin: 8px 0;
  border-radius: 6px;
  border: none;
  outline: none;
}

/* Buttons */
button {
  margin: 8px 4px;
  padding: 10px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
  transition: box-shadow 0.25s ease, transform 0.2s ease, opacity 0.2s ease;
}

button:hover {
  opacity: 1;
  transform: translateY(-2px) scale(1.04);
  box-shadow:
    0 0 8px #00ff99,
    0 0 20px #00ff99aa,
    0 0 40px #9b59f680,
    0 4px 16px rgba(155, 89, 246, 0.35);
}

/* Actions */
.actions {
  margin-top: 16px;
}

/* Overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

/* Modal */
.modal-box {
  background: #111;
  width: 90%;
  max-width: 400px;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 0 25px rgba(0,255,150,0.25);
}

/* Textarea */
#reflectionText {
  width: 100%;
  padding: 10px;
  background: #1a1a1a;
  color: #e8e8e8;
  border-radius: 6px;
  border: none;
  resize: none;
}

/* Save */
#saveReflectionBtn {
  margin-top: 14px;
  width: 100%;
}

/* Calendar */
.calendar-box {
  background: #111;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(0,255,170,0.3);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 40px);
  gap: 10px;
}

.calendar-day {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
}

.calendar-day.past {
  color: #555;
}

.calendar-day.active {
  border: 2px solid #00ffae;
  color: #00ffae;
  cursor: pointer;
}

.calendar-day.active:hover {
  background: rgba(0,255,170,0.15);
}

/* Header */
.calendar-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  margin-bottom: 12px;
}

.calendar-selectors {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.calendar-selectors select {
  background: #111;
  color: #00ffae;
  border: 1px solid #00ffae;
  border-radius: 6px;
  padding: 4px 8px;
}

/* ✅ AI SUMMARY MODAL */
.summary-box {
  background: #111;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  padding: 0;
  border-radius: 12px;
  box-shadow: 0 0 30px rgba(0,255,150,0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.summary-header {
  background: linear-gradient(135deg, #00ff99 0%, #00cc77 100%);
  color: #111;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.summary-header h3 {
  margin: 0;
  font-size: 1.4em;
}

#closeSummaryBtn {
  background: rgba(0,0,0,0.2);
  color: #111;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
}

#closeSummaryBtn:hover {
  background: rgba(0,0,0,0.3);
}

.summary-content {
  padding: 30px;
  overflow-y: auto;
  max-height: calc(80vh - 80px);
}

/* Date Range Selector */
.date-range-selector {
  background: rgba(0,255,150,0.05);
  border: 1px solid rgba(0,255,150,0.2);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
}

.date-inputs {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

.date-input-group {
  flex: 1;
}

.date-input-group label {
  display: block;
  color: #00ff99;
  font-size: 0.85em;
  margin-bottom: 5px;
  font-weight: bold;
}

.date-input-group input[type="date"] {
  width: 100%;
  padding: 8px;
  background: #1a1a1a;
  color: #e8e8e8;
  border: 1px solid rgba(0,255,150,0.3);
  border-radius: 6px;
  font-size: 0.9em;
  color-scheme: dark;
}

.date-input-group input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
  opacity: 0.8;
}

.date-input-group input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

.date-input-group input[type="date"]:focus {
  outline: none;
  border-color: #00ff99;
}

.quick-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.quick-btn {
  background: rgba(0,255,150,0.1);
  color: #00ff99;
  border: 1px solid rgba(0,255,150,0.3);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85em;
  cursor: pointer;
  transition: all 0.2s;
}

.quick-btn:hover {
  background: rgba(0,255,150,0.2);
  border-color: #00ff99;
}

#applyDateRangeBtn {
  background: #00ff99;
  color: #111;
  font-weight: bold;
  padding: 10px 20px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  width: 100%;
  font-size: 0.95em;
}

#applyDateRangeBtn:hover {
  background: #00cc77;
}

#emotionChart {
  display: block;
  margin: 0 auto 30px;
}

.summary-stats {
  background: rgba(0,255,150,0.1);
  border: 1px solid rgba(0,255,150,0.3);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
}

.summary-stats p {
  margin: 8px 0;
  color: #00ff99;
  font-size: 0.95em;
}

.summary-detail {
  color: #e8e8e8;
  line-height: 1.6;
  text-align: left;
  white-space: pre-wrap;
}

.summary-detail strong {
  color: #00ff99;
}

/* Mobile responsiveness */
@media (max-width: 600px) {
  .summary-box {
    width: 95%;
    max-height: 90vh;
  }
  
  .summary-content {
    padding: 20px;
  }
  
  #emotionChart {
    width: 180px;
    height: 200px;
  }
}
