/**
 * ADHC Phase 2 — Sprint 3A — Reminder Center Styles
 * ===================================================
 * Healthcare-themed, mobile-first, senior-friendly.
 * All selectors prefixed .rem-* — zero conflict with Phase 1.
 * CSS-only animations, no libraries.
 */

/* ── Variables ──────────────────────────────────────────────────────────── */
:root {
  --rem-teal:       #0d9488;
  --rem-teal-dark:  #0f766e;
  --rem-teal-light: #ccfbf1;
  --rem-panel-w:    370px;
  --rem-radius:     20px;
  --rem-radius-sm:  12px;
  --rem-shadow:     0 8px 40px rgba(0,0,0,0.18);
  --rem-font:       'Inter', system-ui, sans-serif;
}

/* ── Overlay ──────────────────────────────────────────────────────────── */
#adhc-rem-overlay {
  display:    none;
  position:   fixed;
  inset:      0;
  background: rgba(15,23,42,0.42);
  z-index:    11100;
  backdrop-filter: blur(2px);
  opacity:    0;
  transition: opacity 0.3s ease;
}
#adhc-rem-overlay.rem-overlay-visible {
  display: block;
  opacity: 1;
}

/* ── Panel ────────────────────────────────────────────────────────────── */
#adhc-rem-panel {
  position:      fixed;
  top:           0;
  right:         0;
  bottom:        0;
  width:         var(--rem-panel-w);
  max-width:     100vw;
  z-index:       11101;
  display:       flex;
  flex-direction: column;
  background:    #ffffff;
  border-left:   1.5px solid rgba(13,148,136,0.12);
  box-shadow:    var(--rem-shadow);
  font-family:   var(--rem-font);
  overflow:      hidden;
  transform:     translateX(100%);
  transition:    transform 0.35s cubic-bezier(0.25,1,0.5,1);
  will-change:   transform;
}
#adhc-rem-panel.rem-panel-open {
  transform: translateX(0);
}

/* ── Header ───────────────────────────────────────────────────────────── */
.rem-panel-header {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  padding:         1rem 1.1rem 0.85rem;
  background:      linear-gradient(135deg, var(--rem-teal) 0%, var(--rem-teal-dark) 100%);
  color:           #fff;
  flex-shrink:     0;
}

.rem-panel-title-wrap {
  display:     flex;
  align-items: center;
  gap:         0.65rem;
}

.rem-panel-icon {
  font-size:   1.6rem;
  line-height: 1;
  background:  rgba(255,255,255,0.18);
  border-radius: 50%;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid rgba(255,255,255,0.28);
  flex-shrink: 0;
}

.rem-panel-title    { font-size: 1rem; font-weight: 800; line-height: 1.2; }
.rem-panel-subtitle { font-size: 0.7rem; opacity: 0.8; font-weight: 500; }

.rem-panel-close {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  border: 1.5px solid rgba(255,255,255,0.28);
  color: #fff; font-size: 1rem; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0; min-width: 36px; min-height: 36px;
}
.rem-panel-close:hover   { background: rgba(255,255,255,0.3); transform: scale(1.1); }
.rem-panel-close:active  { transform: scale(0.95); }

/* ── Tab Bar ──────────────────────────────────────────────────────────── */
.rem-tab-bar {
  display:     flex;
  border-bottom: 2px solid #f1f5f9;
  flex-shrink: 0;
  background:  #fafbfc;
}

.rem-tab {
  flex: 1;
  padding: 0.7rem 0.5rem;
  border: none;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -2px;
  transition: all 0.18s ease;
  font-family: var(--rem-font);
  min-height: 44px;
}

.rem-tab.active {
  color: var(--rem-teal);
  border-bottom-color: var(--rem-teal);
  background: #f0fdfb;
}

.rem-tab:hover:not(.active) { background: #f8fafc; color: #374151; }

/* ── Content area ─────────────────────────────────────────────────────── */
.rem-content {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  -webkit-overflow-scrolling: touch;
}

.rem-content::-webkit-scrollbar { width: 4px; }
.rem-content::-webkit-scrollbar-thumb { background: rgba(13,148,136,0.2); border-radius: 2px; }

/* ── Empty state ──────────────────────────────────────────────────────── */
.rem-empty {
  display:        flex;
  flex-direction: column;
  align-items:    center;
  justify-content: center;
  padding:        3rem 1rem;
  gap:            0.75rem;
  flex:           1;
  text-align:     center;
}

.rem-empty-icon { font-size: 2.5rem; }
.rem-empty-text { font-size: 0.88rem; color: #64748b; font-weight: 600; }

/* ── Reminder Card ────────────────────────────────────────────────────── */
.rem-card {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--rem-radius-sm);
  padding: 0.85rem 0.9rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: box-shadow 0.2s ease;
}

.rem-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }

/* Priority left border */
.rem-priority-critical { border-left: 4px solid #ef4444 !important; }
.rem-priority-high     { border-left: 4px solid #f59e0b !important; }
.rem-priority-normal   { border-left: 4px solid #3b82f6 !important; }
.rem-priority-low      { border-left: 4px solid #10b981 !important; }

.rem-card-top {
  display:         flex;
  justify-content: space-between;
  align-items:     flex-start;
  gap:             0.5rem;
  margin-bottom:   0.4rem;
}

.rem-card-title {
  display:     flex;
  align-items: flex-start;
  gap:         0.4rem;
  flex-wrap:   wrap;
  flex:        1;
}

.rem-priority-badge {
  display:       inline-flex;
  align-items:   center;
  padding:       2px 7px;
  border-radius: 999px;
  font-size:     0.58rem;
  font-weight:   800;
  white-space:   nowrap;
  flex-shrink:   0;
}

.rem-card-name {
  font-size:   0.88rem;
  font-weight: 800;
  color:       #0f172a;
  line-height: 1.3;
}

.rem-card-time {
  font-size:   0.68rem;
  color:       #64748b;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.rem-card-desc {
  font-size:   0.8rem;
  color:       #475569;
  line-height: 1.4;
  margin-bottom: 0.65rem;
  font-weight: 500;
}

.rem-snoozed-badge {
  font-size:   0.72rem;
  color:       #64748b;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background:  #f8fafc;
  border-radius: 6px;
  padding:     3px 8px;
  display:     inline-block;
}

.rem-done-label {
  font-size:   0.78rem;
  font-weight: 700;
  color:       #64748b;
  margin-top:  0.25rem;
}

/* ── Card Actions ─────────────────────────────────────────────────────── */
.rem-card-actions {
  display:   flex;
  flex-wrap: wrap;
  gap:       0.4rem;
  margin-top: 0.25rem;
}

.rem-btn {
  display:       inline-flex;
  align-items:   center;
  gap:           0.3rem;
  padding:       0.42rem 0.8rem;
  border-radius: 999px;
  border:        none;
  font-size:     0.75rem;
  font-weight:   700;
  cursor:        pointer;
  transition:    all 0.18s ease;
  font-family:   var(--rem-font);
  min-height:    34px;
}

.rem-btn-complete {
  background: var(--rem-teal);
  color:      #fff;
}
.rem-btn-complete:hover { background: var(--rem-teal-dark); }

.rem-btn-dismiss {
  background: #f1f5f9;
  color:      #64748b;
  border:     1px solid #e2e8f0;
}
.rem-btn-dismiss:hover { background: #e2e8f0; }

.rem-btn-snooze {
  background: #fef9c3;
  color:      #854d0e;
  border:     1px solid #fde68a;
}
.rem-btn-snooze:hover { background: #fef08a; }

.rem-snooze-wrap {
  display:     flex;
  align-items: center;
  gap:         0.3rem;
}

.rem-snooze-sel {
  padding:       0.35rem 0.5rem;
  border-radius: 999px;
  border:        1px solid #e2e8f0;
  font-size:     0.72rem;
  font-weight:   600;
  font-family:   var(--rem-font);
  color:         #475569;
  background:    #fff;
  cursor:        pointer;
  max-width:     110px;
}

/* ── Footer ───────────────────────────────────────────────────────────── */
.rem-footer {
  padding:      0.65rem 0.85rem 0.75rem;
  border-top:   1.5px solid #f1f5f9;
  background:   #fafbfc;
  flex-shrink:  0;
}

.rem-add-btn {
  width:          100%;
  min-height:     44px;
  border-radius:  var(--rem-radius-sm);
  border:         1.5px dashed rgba(13,148,136,0.4);
  background:     rgba(13,148,136,0.05);
  color:          var(--rem-teal-dark);
  font-size:      0.82rem;
  font-weight:    700;
  cursor:         pointer;
  font-family:    var(--rem-font);
  display:        flex;
  align-items:    center;
  justify-content: center;
  gap:            0.4rem;
  transition:     all 0.18s ease;
}
.rem-add-btn:hover { background: rgba(13,148,136,0.1); border-color: var(--rem-teal); }

/* ── Add Form ─────────────────────────────────────────────────────────── */
.rem-add-form {
  display:        flex;
  flex-direction: column;
  gap:            0.5rem;
}

.rem-add-title {
  font-size:   0.9rem;
  font-weight: 800;
  color:       #0f172a;
  margin-bottom: 0.25rem;
}

.rem-form-label {
  font-size:   0.72rem;
  font-weight: 700;
  color:       #64748b;
  margin-bottom: 0;
}

.rem-form-input {
  width:         100%;
  padding:       0.55rem 0.8rem;
  border:        1.5px solid #e2e8f0;
  border-radius: var(--rem-radius-sm);
  font-size:     0.85rem;
  font-family:   var(--rem-font);
  color:         #0f172a;
  background:    #f8fafc;
  outline:       none;
  transition:    border-color 0.2s;
}
.rem-form-input:focus { border-color: var(--rem-teal); background: #fff; }

.rem-add-form-btns {
  display: flex;
  gap:     0.5rem;
  margin-top: 0.5rem;
}

/* ── Mobile ───────────────────────────────────────────────────────────── */
@media (max-width: 414px) {
  #adhc-rem-panel { width: 100vw; border-left: none; }
  .rem-card-actions { gap: 0.3rem; }
  .rem-btn { font-size: 0.7rem; padding: 0.38rem 0.65rem; }
  .rem-tab { font-size: 0.75rem; }
}

@media (max-width: 375px) {
  .rem-snooze-wrap { flex-wrap: wrap; }
  .rem-snooze-sel  { max-width: 90px; }
}

/* ── Reduce motion ────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  #adhc-rem-panel, .rem-btn { transition: none !important; }
}

/* ── Mark All Complete Bar ──────────────────────────────────────────────── */
.rem-mark-all-bar {
  display:         flex;
  align-items:     center;
  justify-content: flex-end;
  padding:         6px 16px 4px;
  border-bottom:   1px solid rgba(13,148,136,0.10);
  background:      #f0fdfa;
  flex-shrink:     0;
}

.rem-btn-mark-all {
  display:         inline-flex;
  align-items:     center;
  gap:             6px;
  padding:         6px 14px;
  border:          1.5px solid var(--rem-teal);
  border-radius:   var(--rem-radius-sm);
  background:      #ffffff;
  color:           var(--rem-teal-dark);
  font-size:       0.78rem;
  font-weight:     600;
  cursor:          pointer;
  transition:      background 0.18s, color 0.18s, transform 0.12s;
  white-space:     nowrap;
}

.rem-btn-mark-all:hover {
  background: var(--rem-teal);
  color:      #ffffff;
  transform:  translateY(-1px);
}

.rem-btn-mark-all:active {
  transform: translateY(0);
  background: var(--rem-teal-dark);
  color:      #ffffff;
}

.rem-btn-mark-all i {
  font-size: 0.82rem;
}

/* ── Show All / Collapse bar (Done tab) ─────────────────────────────────── */
.rem-show-all-bar {
  display:         flex;
  justify-content: center;
  padding:         12px 16px 16px;
}

.rem-show-all-btn {
  display:         inline-flex;
  align-items:     center;
  gap:             6px;
  padding:         8px 18px;
  border:          1.5px dashed var(--rem-teal);
  border-radius:   var(--rem-radius-sm);
  background:      transparent;
  color:           var(--rem-teal-dark);
  font-size:       0.78rem;
  font-weight:     600;
  cursor:          pointer;
  transition:      background 0.18s, color 0.18s;
  white-space:     nowrap;
}

.rem-show-all-btn:hover {
  background: var(--rem-teal-light);
  border-style: solid;
}

.rem-show-all-btn--collapse {
  border-color: #94a3b8;
  color:        #64748b;
}

.rem-show-all-btn--collapse:hover {
  background:   #f1f5f9;
  border-color: #64748b;
}

/* Show-all button inside empty state */
.rem-empty .rem-show-all-btn {
  margin-top: 10px;
}
