/* style.css — Productivity Calendar */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0f0f0f;
  color: #e0e0e0;
  min-height: 100vh;
}

.hidden { display: none !important; }

/* --- Auth Screen --- */

#auth-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  gap: 20px;
}

#auth-screen h1 {
  font-size: 2rem;
  color: #fff;
}

#sign-in-btn {
  padding: 14px 32px;
  font-size: 1.1rem;
  border: none;
  border-radius: 8px;
  background: #4285f4;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
}

#sign-in-btn:hover { background: #3367d6; }

.auth-blurb {
  max-width: 440px;
  text-align: center;
  color: #aaa;
  font-size: 0.95rem;
  line-height: 1.6;
}

.auth-tech {
  color: #555;
  font-size: 0.8rem;
  margin-top: 24px;
}

#auth-error {
  color: #ff6b6b;
  font-size: 0.95rem;
  min-height: 1.4em;
}

/* --- App Header --- */

#app-screen {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px;
}

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

.calendar-header h2 {
  font-size: 1.5rem;
  color: #fff;
  min-width: 220px;
  text-align: center;
}

.nav-btn, #sign-out-btn {
  padding: 8px 16px;
  border: 1px solid #333;
  border-radius: 6px;
  background: #1a1a1a;
  color: #ccc;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
}

.nav-btn:hover, #sign-out-btn:hover { background: #2a2a2a; }

#info-btn {
  font-size: 0.95rem;
  padding: 6px 12px;
  font-weight: 700;
  min-width: 32px;
}

#sign-out-btn {
  font-size: 0.85rem;
  padding: 6px 14px;
}

/* --- Info Overlay --- */

#info-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.info-modal {
  background: #1e1e1e;
  border-radius: 12px;
  padding: 28px;
  width: 90%;
  max-width: 440px;
  position: relative;
}

.info-modal h3 {
  font-size: 1.2rem;
  color: #fff;
  margin-bottom: 14px;
}

.info-modal p {
  color: #aaa;
  font-size: 0.95rem;
  line-height: 1.6;
}

.info-tech {
  margin-top: 18px;
  color: #555 !important;
  font-size: 0.8rem !important;
}

#info-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: #888;
  font-size: 1.5rem;
  cursor: pointer;
}

#info-close:hover { color: #fff; }

/* --- Stats Bar --- */

#stats-bar {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 16px;
  padding: 14px 20px;
  background: #1a1a1a;
  border-radius: 8px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-label {
  font-size: 0.8rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: #ccc;
}

/* --- Calendar Grid --- */

#calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.day-header {
  text-align: center;
  padding: 8px 0;
  font-weight: 600;
  font-size: 0.85rem;
  color: #888;
  text-transform: uppercase;
}

.day-cell {
  background: #1a1a1a;
  border-radius: 8px;
  padding: 8px;
  min-height: 80px;
  cursor: pointer;
  transition: background-color 0.3s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.day-cell:hover { filter: brightness(1.2); }

.day-cell.other-month {
  opacity: 0.35;
}

.day-cell.today {
  outline: 2px solid #4285f4;
  outline-offset: -2px;
}

.day-number {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
}

.progress-wrap {
  flex: 1;
  display: flex;
  align-items: flex-end;
}

.progress-bar {
  height: 5px;
  border-radius: 3px;
  background-color: transparent;
  transition: width 0.3s, background-color 0.3s;
}

.progress-text {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.85);
  text-align: right;
}

/* --- Lightbox --- */

#lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.lightbox {
  background: #1e1e1e;
  border-radius: 12px;
  padding: 28px;
  width: 90%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
}

.lightbox h3 {
  font-size: 1.15rem;
  color: #fff;
  margin-bottom: 16px;
}

#lightbox-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: #888;
  font-size: 1.5rem;
  cursor: pointer;
}

#lightbox-close:hover { color: #fff; }

/* Task list */

.task-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #2a2a2a;
  position: relative;
}

.task-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #4caf50;
  cursor: pointer;
}

.task-label {
  flex: 1;
  font-size: 0.95rem;
}

.task-edit, .task-delete {
  background: none;
  border: 1px solid #444;
  color: #aaa;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 4px;
  flex-shrink: 0;
}

.task-edit:hover { color: #4285f4; border-color: #4285f4; background: #1a2433; }
.task-delete:hover { color: #ff6b6b; border-color: #ff6b6b; background: #2a1a1a; }

/* --- Edit Form Inline --- */

.edit-form-inline {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  margin: 6px 0;
  background: #252525;
  border-radius: 8px;
  border: 1px solid #444;
}

.edit-title-input,
.edit-end-date,
.edit-recurrence-select {
  width: 100%;
  padding: 9px;
  border: 1px solid #333;
  border-radius: 6px;
  background: #1a1a1a;
  color: #e0e0e0;
  font-size: 0.95rem;
}

.edit-day-checkboxes {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.edit-day-checkboxes label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: #ccc;
  cursor: pointer;
}

.edit-label {
  font-size: 0.85rem;
  color: #aaa;
}

.edit-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.edit-actions button {
  padding: 9px 12px;
  border: none;
  border-radius: 6px;
  background: #333;
  color: #e0e0e0;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: left;
}

.edit-actions button:hover {
  background: #3a3a3a;
  color: #4285f4;
}

.edit-cancel {
  color: #888 !important;
  border-top: 1px solid #444;
  margin-top: 4px;
}

.delete-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 4px;
  margin-top: 8px;
  width: 100%;
}

.delete-menu button {
  padding: 10px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #e0e0e0;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: left;
}

.delete-menu button:hover {
  background: #3a3a3a;
}

.delete-menu button:not(.delete-menu-cancel):hover {
  color: #ff6b6b;
}

.delete-menu-cancel {
  color: #888 !important;
  border-top: 1px solid #444;
  margin-top: 2px;
  padding-top: 10px;
}

.empty-msg {
  color: #666;
  padding: 12px 0;
  font-style: italic;
}

#add-task-btn {
  margin-top: 16px;
  width: 100%;
  padding: 10px;
  border: 1px dashed #444;
  border-radius: 8px;
  background: transparent;
  color: #4285f4;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s;
}

#add-task-btn:hover { background: #1a2433; }

/* --- Task Form --- */

#task-form {
  margin-top: 16px;
  padding: 16px;
  background: #252525;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#task-form label {
  font-size: 0.85rem;
  color: #aaa;
}

#task-form input[type="text"],
#task-form input[type="date"],
#task-form select {
  width: 100%;
  padding: 10px;
  border: 1px solid #333;
  border-radius: 6px;
  background: #1a1a1a;
  color: #e0e0e0;
  font-size: 0.95rem;
}

#day-checkboxes {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

#day-checkboxes label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: #ccc;
  cursor: pointer;
}

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

.form-actions button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
}

#submit-task {
  background: #4285f4;
  color: #fff;
}

#submit-task:hover { background: #3367d6; }

#cancel-task {
  background: #333;
  color: #ccc;
}

#cancel-task:hover { background: #444; }

/* --- Responsive --- */

@media (max-width: 600px) {
  .day-cell { min-height: 60px; padding: 4px; }
  .day-number { font-size: 0.75rem; }
  .calendar-header h2 { font-size: 1.1rem; min-width: 160px; }
  .lightbox { padding: 20px; }
}
