/* ============================================================
   Reminders app — all selectors scoped under .app-reminders
   Uses shell CSS custom properties for automatic dark-mode support.
   ============================================================ */

/* ---------- Root layout ---------- */
.app-reminders .rem-root {
  display: flex;
  height: 100%;
  overflow: hidden;
  background: var(--win-bg);
  color: var(--win-fg);
  font-family: var(--font-system, system-ui, sans-serif);
}

/* ---------- Sidebar ---------- */
.app-reminders .rem-sidebar {
  width: 220px;
  flex: 0 0 220px;
  background: var(--sidebar-bg);
  border-right: 0.5px solid var(--sidebar-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 14px 12px 20px;
}

/* Smart list 2×2 grid of cards */
.app-reminders .rem-smart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.app-reminders .rem-smart-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 10px 12px 8px;
  cursor: default;
  position: relative;
  transition: background 0.12s ease, transform 0.1s ease;
  border: 1px solid var(--card-border);
}

.app-reminders .rem-smart-card:hover {
  background: var(--win-hover);
  transform: scale(1.02);
}

.app-reminders .rem-smart-card.active {
  background: var(--card-bg);
  box-shadow: 0 0 0 2px var(--accent);
}

.app-reminders .rem-sc-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  margin-bottom: 6px;
}

.app-reminders .rem-sc-count {
  font-size: 22px;
  font-weight: 700;
  color: var(--win-fg);
  line-height: 1;
  min-height: 26px;
}

.app-reminders .rem-sc-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--win-muted);
  margin-top: 2px;
}

/* "My Lists" section */
.app-reminders .rem-sb-section {
  flex: 1;
}

.app-reminders .rem-sb-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--win-muted);
  padding: 6px 4px 6px;
}

.app-reminders .rem-sb-add-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--control-bg);
  color: var(--win-muted);
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  transition: background 0.1s ease;
  flex: 0 0 auto;
}

.app-reminders .rem-sb-add-btn:hover {
  background: var(--accent);
  color: #fff;
}

.app-reminders .rem-sb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 8px;
  cursor: default;
  font-size: 13.5px;
  color: var(--sidebar-fg);
  transition: background 0.1s ease;
}

.app-reminders .rem-sb-row:hover {
  background: var(--win-hover);
}

.app-reminders .rem-sb-row.active {
  background: var(--accent);
  color: #fff;
}

.app-reminders .rem-sb-row.active .rem-sb-count {
  color: rgba(255,255,255,0.75);
}

.app-reminders .rem-sb-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.app-reminders .rem-sb-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-reminders .rem-sb-count {
  font-size: 12px;
  color: var(--win-muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Main pane ---------- */
.app-reminders .rem-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--win-bg);
  position: relative;
  min-width: 0;
}

/* Header */
.app-reminders .rem-header {
  padding: 18px 22px 8px;
  flex: 0 0 auto;
}

.app-reminders .rem-header-count {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
}

.app-reminders .rem-header-title {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
}

/* Add row */
.app-reminders .rem-add-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 22px 10px;
  border-bottom: 0.5px solid var(--win-border);
  flex: 0 0 auto;
}

.app-reminders .rem-add-icon {
  font-size: 20px;
  font-weight: 300;
  width: 22px;
  text-align: center;
  line-height: 1;
}

.app-reminders .rem-add-input {
  flex: 1;
  font-size: 14px;
  color: var(--win-fg);
  background: transparent;
  border: none;
  outline: none;
  padding: 4px 0;
}

.app-reminders .rem-add-input::placeholder {
  color: var(--win-muted);
}

/* Reminder list */
.app-reminders .rem-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0 20px;
}

/* Reminder row */
.app-reminders .rem-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px 9px 20px;
  border-bottom: 0.5px solid var(--win-border);
  cursor: default;
  position: relative;
  transition: background 0.1s ease;
}

.app-reminders .rem-row:hover {
  background: var(--win-hover);
}

/* Show delete btn only on hover */
.app-reminders .rem-del-btn {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--control-bg);
  color: var(--win-muted);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.app-reminders .rem-row:hover .rem-del-btn {
  opacity: 1;
  pointer-events: all;
}

.app-reminders .rem-del-btn:hover {
  background: #ff3b30;
  color: #fff;
}

/* Check circle */
.app-reminders .rem-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.8px solid #c7c7cc;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
  cursor: default;
  background: transparent;
}

.app-reminders .rem-circle:hover {
  opacity: 0.75;
}

/* Priority badge */
.app-reminders .rem-pri {
  font-size: 11px;
  font-weight: 700;
  width: 26px;
  text-align: center;
  flex: 0 0 auto;
  letter-spacing: -0.5px;
}

/* Row body */
.app-reminders .rem-row-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.app-reminders .rem-row-text {
  font-size: 14px;
  color: var(--win-fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.15s ease, text-decoration 0.15s ease;
}

.app-reminders .rem-row.done .rem-row-text {
  color: var(--win-muted);
  text-decoration: line-through;
  text-decoration-color: var(--win-muted);
}

.app-reminders .rem-row-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--win-muted);
  overflow: hidden;
}

.app-reminders .rem-due {
  font-size: 11.5px;
  color: var(--win-muted);
}

.app-reminders .rem-due.today-due {
  color: #ff9f0a;
  font-weight: 600;
}

.app-reminders .rem-due.overdue {
  color: #ff3b30;
  font-weight: 600;
}

.app-reminders .rem-notes-hint {
  color: var(--win-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}

.app-reminders .rem-meta-sep {
  color: var(--win-border);
}

/* Flag button */
.app-reminders .rem-flag-btn {
  opacity: 0.25;
  font-size: 13px;
  flex: 0 0 auto;
  transition: opacity 0.12s ease;
  cursor: default;
}

.app-reminders .rem-flag-btn.active {
  opacity: 1;
}

.app-reminders .rem-row:hover .rem-flag-btn {
  opacity: 0.7;
}

.app-reminders .rem-row:hover .rem-flag-btn.active {
  opacity: 1;
}

/* Completed section */
.app-reminders .rem-comp-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 20px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--win-muted);
  cursor: default;
  user-select: none;
}

.app-reminders .rem-comp-header::before {
  content: '▶';
  font-size: 10px;
  transition: transform 0.15s ease;
}

.app-reminders .rem-comp-header.open::before {
  transform: rotate(90deg);
}

/* ---------- Detail panel ---------- */
.app-reminders .rem-detail {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 240px;
  background: var(--sidebar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 0.5px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  z-index: 10;
  box-shadow: -4px 0 18px rgba(0,0,0,0.08);
  animation: rem-slide-in 0.18s var(--ease-out, ease-out) forwards;
}

@keyframes rem-slide-in {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

.app-reminders .rem-detail-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--win-fg);
  border-bottom: 0.5px solid var(--sidebar-border);
  flex: 0 0 auto;
}

.app-reminders .rem-detail-close {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--control-bg);
  color: var(--win-muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

.app-reminders .rem-detail-close:hover {
  background: var(--win-border);
  color: var(--win-fg);
}

.app-reminders .rem-detail-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px 14px;
  border-bottom: 0.5px solid var(--card-border);
}

.app-reminders .rem-detail-toggle-row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.app-reminders .rem-detail-field label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--win-muted);
}

.app-reminders .rem-detail-input {
  width: 100%;
  background: var(--field-bg);
  border: 0.5px solid var(--win-border);
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 13.5px;
  color: var(--win-fg);
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
  font-family: var(--font-system, system-ui, sans-serif);
}

.app-reminders .rem-detail-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10,132,255,0.18);
}

.app-reminders .rem-detail-textarea {
  width: 100%;
  background: var(--field-bg);
  border: 0.5px solid var(--win-border);
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--win-fg);
  outline: none;
  resize: vertical;
  min-height: 64px;
  font-family: var(--font-system, system-ui, sans-serif);
  line-height: 1.5;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.app-reminders .rem-detail-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10,132,255,0.18);
}

.app-reminders .rem-detail-select {
  width: 100%;
  background: var(--field-bg);
  border: 0.5px solid var(--win-border);
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 13.5px;
  color: var(--win-fg);
  outline: none;
  font-family: var(--font-system, system-ui, sans-serif);
  cursor: default;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 9px;
  padding-right: 28px;
}

/* Toggle in detail panel */
.app-reminders .rem-detail-toggle {
  width: 38px;
  height: 22px;
  border-radius: 11px;
  background: #c7c7cc;
  position: relative;
  transition: background 0.18s ease;
  flex: 0 0 auto;
  cursor: default;
}

.app-reminders .rem-detail-toggle.on {
  background: #34c759;
}

.app-reminders .rem-detail-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: transform 0.18s ease;
}

.app-reminders .rem-detail-toggle.on::after {
  transform: translateX(16px);
}

/* ---------- Scrollbars in Reminders ---------- */
.app-reminders .rem-sidebar::-webkit-scrollbar,
.app-reminders .rem-list::-webkit-scrollbar,
.app-reminders .rem-detail::-webkit-scrollbar {
  width: 7px;
}

.app-reminders .rem-sidebar::-webkit-scrollbar-thumb,
.app-reminders .rem-list::-webkit-scrollbar-thumb,
.app-reminders .rem-detail::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 4px;
}

.app-reminders .rem-sidebar::-webkit-scrollbar-track,
.app-reminders .rem-list::-webkit-scrollbar-track,
.app-reminders .rem-detail::-webkit-scrollbar-track {
  background: transparent;
}
