/* Actualize Daily Planner — style.css */

:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-hover: #1c1c1c;
  --border: #2a2a2a;
  --text: #f0f0f0;
  --text-muted: #888;
  --accent: #4f8cff;
  --accent-hover: #6ba0ff;
  --accent-dim: rgba(79, 140, 255, 0.15);
  --must-do: #ff6b4f;
  --flexible: #4fcc8f;
  --fixed: #555;
  --overflow: #cc4f4f;
  --radius: 10px;
  --transition: 0.25s ease;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* Layout */
.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 32px;
}

.header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header h1 span {
  color: var(--accent);
}

.header p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 4px;
}

/* Steps */
.step {
  display: none;
  animation: fadeIn 0.3s ease;
}

.step.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Step 0: Auth */
.auth-section {
  text-align: center;
  padding: 60px 0;
}

.auth-section p {
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 0.95rem;
}

.google-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  color: #333;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: box-shadow var(--transition);
}

.google-btn:hover {
  box-shadow: 0 2px 16px rgba(255, 255, 255, 0.15);
}

.google-btn svg {
  width: 20px;
  height: 20px;
}

/* Step 1: Brain Dump */
.step-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 8px;
}

.step h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.brain-dump-area {
  width: 100%;
  min-height: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.6;
  padding: 16px;
  resize: vertical;
  transition: border-color var(--transition);
}

.brain-dump-area:focus {
  outline: none;
  border-color: var(--accent);
}

.brain-dump-area::placeholder {
  color: var(--text-muted);
}

/* Primary button */
.btn-primary {
  display: block;
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 14px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
  transition: background var(--transition);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

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

/* Secondary button */
.btn-secondary {
  display: block;
  width: 100%;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 10px;
  transition: border-color var(--transition), color var(--transition);
}

.btn-secondary:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

/* Loading spinner */
.spinner {
  display: none;
  text-align: center;
  padding: 40px 0;
}

.spinner.active {
  display: block;
}

.spinner-ring {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Step 2: Task Review */
.fixed-commitments {
  margin-bottom: 24px;
}

.fixed-commitments h3 {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.fixed-event {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--fixed);
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.fixed-event .time {
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.fixed-event .name {
  flex: 1;
}

.no-events {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
  padding: 8px 0;
}

/* Task cards */
.task-list {
  margin-bottom: 16px;
}

.task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  transition: border-color var(--transition);
}

.task-card:hover {
  border-color: #3a3a3a;
}

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

.task-name-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
  font-family: inherit;
  outline: none;
  padding: 2px 0;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
}

.task-name-input:focus {
  border-bottom-color: var(--accent);
}

.task-remove-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px;
  line-height: 1;
  transition: color var(--transition);
}

.task-remove-btn:hover {
  color: var(--overflow);
}

.task-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.field-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.field-select,
.field-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  padding: 8px 10px;
  outline: none;
  transition: border-color var(--transition);
}

.field-select:focus,
.field-input:focus {
  border-color: var(--accent);
}

.priority-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.priority-option {
  flex: 1;
  padding: 8px;
  font-size: 0.8rem;
  text-align: center;
  cursor: pointer;
  background: var(--bg);
  color: var(--text-muted);
  border: none;
  font-family: inherit;
  transition: background var(--transition), color var(--transition);
}

.priority-option.selected.must-do {
  background: rgba(255, 107, 79, 0.2);
  color: var(--must-do);
}

.priority-option.selected.flexible {
  background: rgba(79, 204, 143, 0.2);
  color: var(--flexible);
}

/* Step 3: Schedule */
.timeline {
  position: relative;
  margin: 16px 0;
}

.timeline-hour {
  display: flex;
  align-items: flex-start;
  min-height: 48px;
  border-top: 1px solid var(--border);
  position: relative;
}

.hour-label {
  width: 56px;
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding-top: 4px;
  text-align: right;
  padding-right: 12px;
}

.hour-slot {
  flex: 1;
  min-height: 48px;
  position: relative;
}

.schedule-block {
  position: absolute;
  left: 0;
  right: 0;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 500;
  overflow: hidden;
  z-index: 1;
}

.schedule-block.fixed {
  background: rgba(85, 85, 85, 0.3);
  border-left: 3px solid var(--fixed);
  color: var(--text-muted);
}

.schedule-block.must-do {
  background: rgba(255, 107, 79, 0.15);
  border-left: 3px solid var(--must-do);
  color: var(--text);
}

.schedule-block.flexible {
  background: rgba(79, 204, 143, 0.15);
  border-left: 3px solid var(--flexible);
  color: var(--text);
}

.block-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Overflow tasks */
.overflow-section {
  margin-top: 20px;
  padding: 14px;
  background: rgba(204, 79, 79, 0.1);
  border: 1px solid rgba(204, 79, 79, 0.3);
  border-radius: var(--radius);
}

.overflow-section h3 {
  font-size: 0.85rem;
  color: var(--overflow);
  margin-bottom: 8px;
}

.overflow-section li {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-left: 16px;
  margin-bottom: 4px;
}

/* Confirmation */
.confirmation {
  text-align: center;
  padding: 40px 0;
}

.confirmation .check-icon {
  width: 56px;
  height: 56px;
  background: rgba(79, 204, 143, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 1.5rem;
}

.confirmation h2 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.confirmation p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.confirmation a {
  color: var(--accent);
  text-decoration: none;
}

.confirmation a:hover {
  text-decoration: underline;
}

/* Error message */
.error-msg {
  background: rgba(204, 79, 79, 0.1);
  border: 1px solid rgba(204, 79, 79, 0.3);
  border-radius: var(--radius);
  color: var(--overflow);
  padding: 12px 14px;
  font-size: 0.85rem;
  margin-top: 12px;
  display: none;
}

.error-msg.visible {
  display: block;
}

/* User bar */
.user-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.user-bar.visible {
  display: flex;
}

.user-bar .user-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sign-out-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  text-decoration: underline;
  font-family: inherit;
}

.sign-out-btn:hover {
  color: var(--text);
}

/* Back button */
.back-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  font-family: inherit;
  padding: 0;
  margin-bottom: 16px;
  transition: color var(--transition);
}

.back-btn:hover {
  color: var(--text);
}

/* Responsive */
@media (max-width: 480px) {
  .container {
    padding: 16px 16px 80px;
  }

  .task-fields {
    grid-template-columns: 1fr;
  }

  .brain-dump-area {
    min-height: 180px;
    font-size: 16px; /* prevents iOS zoom */
  }

  .field-select,
  .field-input {
    font-size: 16px; /* prevents iOS zoom */
  }
}
