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

:root {
  --primary: #2c5530;
  --primary-light: #4a7c4e;
  --background: #fefefe;
  --text: #1a1a1a;
  --text-light: #555;
  --card-bg: #f5f5f5;
  --border: 4px solid #1a1a1a;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  --radius: 0;
}

html {
  font-size: 24px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--background);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 2rem;
}

h1 {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.datetime {
  font-size: 1.25rem;
  color: var(--text);
  font-weight: 500;
}

/* Main content */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

/* Ask button */
.ask-button {
  width: 100%;
  padding: 1rem 2rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: white;
  background: var(--primary);
  border: var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  transition: transform 0.1s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.ask-button:hover {
  background: var(--primary-light);
}

.ask-button:active {
  transform: scale(0.98);
}

.ask-button.listening {
  background: #c0392b;
  animation: pulse-bg 1.5s infinite;
}

.mic-icon {
  font-size: 1.5rem;
}

@keyframes pulse-bg {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* Listening indicator */
.listening-indicator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  color: #c0392b;
  font-weight: 500;
}

.listening-indicator .pulse {
  width: 16px;
  height: 16px;
  background: #c0392b;
  border-radius: 50%;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

/* Question display */
.question-display {
  font-size: 1.1rem;
  color: var(--text-light);
  font-style: italic;
  text-align: center;
  padding: 0 1rem;
}

/* Answer card */
.answer-card {
  width: 100%;
  background: var(--card-bg);
  border: var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}

.answer-card.attention {
  animation: attention 2.5s ease-out;
}

@keyframes attention {
  0% {
    background: #ffeb3b;
    transform: scale(1.02);
  }
  20% {
    transform: scale(1);
  }
  100% {
    background: var(--card-bg);
    transform: scale(1);
  }
}

#answer-text {
  font-size: 1.25rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* Scoop section */
#scoop-content {
  font-size: 1rem;
  line-height: 1.6;
}

#scoop-content hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 1rem 0;
}

#scoop-content img {
  max-width: 100%;
  border-radius: 8px;
  margin: 1rem 0;
}

#scoop-content p {
  margin-bottom: 0.75rem;
}

#scoop-content p:last-child {
  margin-bottom: 0;
}

/* Collapsible sections */
.collapsible {
  width: 100%;
  margin-bottom: 1rem;
}

.collapsible-toggle {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1.1rem;
  font-weight: 600;
  background: var(--card-bg);
  border: var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}

.collapsible-toggle:hover {
  background: #e8e8e8;
}

.toggle-icon {
  font-size: 1.5rem;
  font-weight: bold;
}

.collapsible-content {
  background: var(--card-bg);
  border: var(--border);
  border-top: none;
  padding: 1rem 1.25rem;
}

.collapsible-content.hidden {
  display: none;
}

/* Events section */
#events-list {
  /* inherits from .collapsible-content */
}

.event-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #ddd;
  font-size: 1rem;
}

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

.event-title {
  font-weight: 500;
}

.event-countdown {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
}

.event-countdown.today {
  color: #c0392b;
}

.event-countdown.past {
  color: #999;
}

/* Suggestions */
.suggestions {
  width: 100%;
  margin: 1.5rem 0;
  padding: 1.25rem;
  background: var(--card-bg);
  border: var(--border);
}

.suggestions-label {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
  text-align: center;
}

.suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.chip {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  background: white;
  border: 2px solid var(--primary);
  border-radius: 20px;
  color: var(--primary);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.chip:hover, .chip:active {
  background: var(--primary);
  color: white;
}

/* Footer */
footer {
  margin-top: auto;
  padding-top: 1.5rem;
}

.today-info {
  background: var(--card-bg);
  border: var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.today-info p {
  margin-bottom: 0.5rem;
}

.today-info p:last-child {
  margin-bottom: 0;
}

.admin-toggle {
  display: block;
  margin: 1rem auto 0;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  background: transparent;
  border: 1px solid #ccc;
  border-radius: 4px;
  color: #999;
  cursor: pointer;
}

/* Admin panel */
.admin-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  z-index: 100;
  padding: 1rem;
  overflow-y: auto;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.admin-header h2 {
  font-size: 1.25rem;
  color: var(--primary);
}

.admin-close {
  font-size: 2rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
}

.log-content {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 1rem;
  max-height: 60vh;
  overflow-y: auto;
  font-size: 0.85rem;
}

.log-entry {
  padding: 0.5rem 0;
  border-bottom: 1px solid #ddd;
}

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

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

.log-answer {
  color: var(--text-light);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.log-time {
  color: #999;
  font-size: 0.75rem;
}

.log-unmatched {
  background: #fff3cd;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.admin-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  justify-content: center;
}

.admin-actions button {
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  border-radius: 8px;
  cursor: pointer;
}

#export-log {
  background: var(--primary);
  color: white;
  border: none;
}

#clear-log {
  background: white;
  color: #c0392b;
  border: 2px solid #c0392b;
}

/* Utility */
.hidden {
  display: none !important;
}

/* Larger text on bigger screens */
@media (min-width: 768px) {
  html {
    font-size: 28px;
  }
}

/* Ensure good tap targets */
button {
  min-height: 48px;
}
