﻿/* =========================================================
   NotifAi styles.css (clean consolidated)
   - Removes duplicates
   - Fixes modal [hidden] issue
   - Keeps premium theme + calendar styles
   ========================================================= */

:root{
  --primary:#130323;
  --white:#ffffff;
  --lime:#c1ff72;

  --bg:#f7f6fb;
  --surface:#ffffff;

  --text:#130323;
  --muted: rgba(19,3,35,0.65);

  --shadow-sm: 0 8px 20px rgba(19,3,35,0.08);
  --shadow-md: 0 14px 32px rgba(19,3,35,0.10);

  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

*{ box-sizing:border-box; }

html, body{ height:100%; }

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 20% 0%, rgba(193,255,114,0.22), transparent 55%),
    radial-gradient(800px 520px at 95% 20%, rgba(19,3,35,0.08), transparent 60%),
    var(--bg);
}

a{ color:inherit; text-decoration:none; }

.container{
  min-height:100vh;
  display:flex;
  justify-content:center;
  align-items:flex-start;
  padding:56px 16px 28px;
}

.card{
  width:min(980px, 92vw);
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-xl);
  padding: 30px;`r`n  overflow: clip;`r`nbox-shadow: var(--shadow-md);
  border: 0;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
}

.brandMark{
  width:38px;
  height:38px;
  border-radius:999px;
  display:grid;
  place-items:center;
  background: rgba(193,255,114,.55);
  box-shadow: var(--shadow-sm);
  font-weight:800;
  color:var(--primary);
}

.brandName{
  display:flex;
  flex-direction:column;
  line-height:1.05;
}
.brandName strong{ font-size:16px; letter-spacing:.2px; }
.brandName span{ font-size:12px; color:var(--muted); }

h1{
  margin: 0 0 8px;
  font-size: 30px;
  letter-spacing: -0.02em;
}
h2{
  margin: 18px 0 10px;
  font-size: 18px;
  letter-spacing: -0.01em;
}
p{ margin: 0 0 12px; line-height:1.5; }
.muted{ color: var(--muted); font-size:13px; }

hr{
  border:0;
  height:1px;
  background: rgba(19,3,35,0.08);
  margin:14px 0;
}

/* Buttons */
.btn{
  appearance:none;
  border:0;
  cursor:pointer;
  font-weight: 900;
  border-radius: 14px;
  padding: 10px 14px;
  background: var(--primary);
  color: var(--white);
  box-shadow: var(--shadow-sm);
  transition: transform .08s ease, box-shadow .15s ease;
}
.btn:hover{ transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active{ transform: translateY(0px); box-shadow: var(--shadow-sm); }

.btn.secondary{
  background: rgba(19,3,35,0.06);
  color: var(--primary);
  box-shadow: none;
}
.btn[disabled]{ opacity:.55; cursor:not-allowed; transform:none; box-shadow:none; }

/* Inputs */
.input, .select{
  padding: 10px 12px;
  border-radius: 14px;
  border: 0;
  background: rgba(255,255,255,0.92);
  box-shadow: var(--shadow-sm);
  font: inherit;
  color: var(--primary);
}
.select{ cursor:pointer; }

.preBox{
  background: rgba(19,3,35,0.03);
  border-radius: var(--radius-lg);
  padding: 12px;
  overflow:auto;
}

/* Tabs */
.tabs{
  display:flex;
  gap:10px;
  padding:10px;
  margin-bottom: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.92);
  box-shadow: var(--shadow-sm);
  overflow-x:auto;
  -webkit-overflow-scrolling: touch;
}

.tabs::-webkit-scrollbar{ height: 8px; }
.tabs::-webkit-scrollbar-thumb{ background: rgba(0,0,0,0.08); border-radius: 999px; }

.tabs .tab{
  flex: 0 0 auto;
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 12px;
  border-radius: 16px;
  text-decoration:none;
  font-weight: 900;
  color: var(--primary);
  background: rgba(19,3,35,0.05);
}
.tabs .tab:hover{ background: rgba(193,255,114,0.35); }
.tabs .tab.active{
  background: var(--primary);
  color: var(--white);
}
.tab-icon{
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display:grid;
  place-items:center;
  background: rgba(193,255,114,0.45);
  flex: 0 0 auto;
}
.tabs .tab.active .tab-icon{ background: rgba(255,255,255,0.18); }
.tab-icon svg{ width:18px; height:18px; fill: currentColor; opacity:.95; }
.tab-label{ white-space: nowrap; }

.tab:focus-visible{
  outline: 3px solid rgba(193,255,114,0.85);
  outline-offset: 2px;
}

/* Dashboard stats cards */
.stats{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
@media (max-width: 760px){
  .stats{ grid-template-columns: 1fr; }
  .card{ padding: 18px; }
}

.stat-card{
  display:block;
  text-decoration:none;
  color: inherit;
  cursor:pointer;

  background: rgba(255,255,255,0.92);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform .08s ease, box-shadow .15s ease;
}
.stat-card:hover{ transform: translateY(-1px); box-shadow: var(--shadow-md); }
.stat-label{ font-weight: 800; color: rgba(19,3,35,0.70); }
.stat-value{ font-size: 28px; font-weight: 950; margin-top: 6px; letter-spacing:-0.02em; }

/* Reminders list */
.reminders-ul { list-style:none; padding:0; margin:0; display:grid; gap:10px; }
.reminder-item { background: rgba(255,255,255,0.7); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow-sm); }
.reminder-title { font-weight: 800; }
.reminder-meta { font-size: 13px; opacity: .75; margin-top: 4px; }

/* Usage cards */
.usage{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:14px;
  margin-top: 12px;
}
@media (max-width: 720px){
  .usage{ grid-template-columns: 1fr; }
}
.usage-card{
  background: rgba(255,255,255,0.75);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

/* Friends */
.friends-controls{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin: 10px 0 14px;
}
.friends-list{ display:grid; gap:10px; }
.friend-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.92);
  box-shadow: var(--shadow-sm);
}
.avatar{
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display:grid;
  place-items:center;
  font-weight: 950;
  background: rgba(193, 255, 114, 0.35);
  color: var(--primary);
  flex: 0 0 auto;
}
.friend-main{ flex:1; min-width:0; }
.friend-name{
  font-weight: 950;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.friend-phone{ font-size: 13px; opacity: .75; }
.friend-meta{ display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }

/* Pills */
.pill{
  background: rgba(19,3,35,0.06);
  color: var(--primary);
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 900;
  font-size: 12px;
}
.pill.status.pending{ background: rgba(193,255,114,0.28); }
.pill.status.accepted{ background: rgba(193,255,114,0.45); }

/* Upgrade banner */
.upgrade-banner{
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(193,255,114,0.35);
  color: var(--primary);
  font-weight: 950;
  box-shadow: var(--shadow-sm);
}

/* Donut */
.donut-card{
  display:flex;
  gap:18px;
  align-items:center;
  flex-wrap:wrap;
  margin-top: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.92);
  box-shadow: var(--shadow-sm);
}
.donut-chart svg{ width:220px; height:220px; display:block; }
.donut-legend{ display:grid; gap:10px; min-width:220px; }
.legend-item{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
.legend-left{ display:flex; align-items:center; gap:10px; min-width:0; }
.swatch{ width:12px; height:12px; border-radius:999px; flex: 0 0 auto; }
.legend-name{ font-weight: 900; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.legend-count{ font-weight: 900; opacity: .85; }
.donut-tooltip{
  position: fixed;
  z-index: 9999;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(19,3,35,0.92);
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  pointer-events: none;
  box-shadow: 0 12px 28px rgba(0,0,0,.18);
}

/* ---------------- Calendar ---------------- */
.page-head { margin-bottom: 12px; }

.calendar-shell { margin-top: 10px; }

.calendar-topbar{
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.cal-left, .cal-right { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.cal-center { display:flex; justify-content:center; }
.cal-month{ font-weight: 950; font-size: 18px; color: var(--primary); }

.cal-legend { display:flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.legend-pill{
  display:flex; align-items:center; gap:8px;
  background: rgba(255,255,255,.75);
  border-radius: 999px;
  padding: 6px 10px;
  box-shadow: var(--shadow-sm);
  font-size: 12px;
  color: rgba(19, 3, 35, 0.75);
}
.legend-pill .dot{
  width: 10px; height: 10px; border-radius: 999px;
  background: var(--lime);
  box-shadow: 0 0 0 6px rgba(193,255,114,.25);
}
.legend-pill[data-cat="Work"] .dot { background: #c1ff72; }
.legend-pill[data-cat="Personal"] .dot { background: #ffd6f6; }
.legend-pill[data-cat="Health"] .dot { background: #bfe7ff; }
.legend-pill[data-cat="Social"] .dot { background: #ffe8b8; }
.legend-pill[data-cat="Other"] .dot { background: #dcdcff; }

.calendar-weekdays{
  display:grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
  color: rgba(19,3,35,.65);
  padding: 0 2px;
}
.calendar-weekdays > div{ padding: 6px 8px; }

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

.day-cell{
  text-align:left;
  background: rgba(255,255,255,0.78);
  border: 0;
  border-radius: 18px;
  padding: 10px;
  min-height: 108px;
  box-shadow: 0 12px 26px rgba(19,3,35,0.08);
  cursor:pointer;
  transition: transform .08s ease, box-shadow .12s ease;
}
.day-cell:hover{ transform: translateY(-1px); box-shadow: 0 16px 30px rgba(19,3,35,0.10); }
.day-cell.is-out{ opacity: 0.55; }
.day-cell.is-today{
  box-shadow: 0 16px 34px rgba(19,3,35,0.12);
  outline: 2px solid rgba(193,255,114,.6);
}

.day-top{ display:flex; justify-content:space-between; align-items:center; margin-bottom: 8px; }
.day-num{ font-weight: 950; color: rgba(19,3,35,.9); }
.day-add{
  width: 26px; height: 26px; border-radius: 999px;
  display:grid; place-items:center;
  background: rgba(193,255,114,.35);
  color: rgba(19,3,35,.9);
  font-weight: 950;
}

.day-list{ display:flex; flex-direction:column; gap:6px; }
.day-more{ font-size: 12px; opacity:.8; }

.reminder-chip{
  display:flex; align-items:center; gap: 8px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1;
  overflow:hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.reminder-chip .chip-dot{ width:8px; height:8px; border-radius: 999px; }
.reminder-chip .chip-text{ flex:1; overflow:hidden; text-overflow:ellipsis; }
.reminder-chip .chip-badge{ font-weight: 950; opacity:.75; }

.cat-work{ background: rgba(193,255,114,.35); color: rgba(19,3,35,.92); }
.cat-work .chip-dot{ background: #c1ff72; }

.cat-personal{ background: rgba(255,214,246,.55); color: rgba(19,3,35,.9); }
.cat-personal .chip-dot{ background: #ffd6f6; }

.cat-health{ background: rgba(191,231,255,.6); color: rgba(19,3,35,.9); }
.cat-health .chip-dot{ background: #bfe7ff; }

.cat-social{ background: rgba(255,232,184,.65); color: rgba(19,3,35,.9); }
.cat-social .chip-dot{ background: #ffe8b8; }

.cat-other{ background: rgba(220,220,255,.7); color: rgba(19,3,35,.9); }
.cat-other .chip-dot{ background: #dcdcff; }

/* ---------------- Modal (calendar reminder) ---------------- */
.no-scroll { overflow: hidden; }

/* KEY FIX: hidden must always hide */
.modal-overlay[hidden]{ display: none !important; }
.modal-overlay:not([hidden]){ display: grid !important; }

.modal-overlay{
  position: fixed;
  inset: 0;
  background: rgba(19,3,35,.22);
  place-items: center;
  padding: 18px;
  z-index: 9999;
}

.modal{
  width: min(560px, 92vw);
  background: rgba(255,255,255,.92);
  border-radius: 22px;
  box-shadow: 0 28px 70px rgba(19,3,35,.22);
  padding: 16px;
}

.modal-head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 4px 10px;
}

.icon-btn{
  width: 38px; height: 38px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  background: rgba(19,3,35,.08);
  color: rgba(19,3,35,.85);
  font-weight: 950;
}

.modal-body{ padding: 4px; }
.field{ display:flex; flex-direction: column; gap:6px; margin:10px 0; }
.field-row{ display:grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.label{ font-size: 12px; font-weight: 900; color: rgba(19,3,35,.75); }
.input:focus{ box-shadow: 0 0 0 4px rgba(193,255,114,.35); outline: none; }

.modal-actions{
  display:flex;
  align-items:center;
  gap: 10px;
  margin-top: 12px;
}
.modal-actions .spacer{ flex:1; }

/* ---------------- Slide-in panel (optional) ---------------- */
.panel-overlay{
  position: fixed;
  inset: 0;
  background: rgba(19,3,35,.18);
  z-index: 50;
  display: none;
}

.task-panel{
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 92vw);
  height: 100%;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(19,3,35,.18);
  border-radius: 18px 0 0 18px;
  padding: 16px;
  z-index: 60;
  transform: translateX(100%);
  transition: transform .18s ease;
}
.task-panel.open{ transform: translateX(0); }

.task-panel.open + .panel-overlay,
.panel-overlay.open{ display: block; }

/* Legal footer */
.legal-footer a{
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(19,3,35,.25);
}
.legal-footer a:hover{
  text-decoration-color: var(--lime);
  opacity: .95;
}
.legal-top{ margin-bottom: 12px; }
.btn.btn-ghost{
  background: transparent;
  border: 0;
  padding: 8px 10px;
  box-shadow: none;
}


@supports not (overflow: clip){
  .card{ overflow: hidden; }
}


/* --- Calendar overflow fix: allow grid columns to shrink inside the card --- */
.calendar-weekdays,
.calendar-grid{
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
}

.day-cell{
  min-width: 0;
}

.day-list,
.reminder-chip,
.reminder-chip .chip-text{
  min-width: 0;
}


/* --- Fix: prevent nested .card blocks from overflowing (Friends page) --- */
/* Default: any .card inside content should just fill its parent */
.card{
  width: 100%;
  max-width: 100%;
}

/* Only the top-level page card should be capped to the app width */
.container > main.card,
.container > .card{
  max-width: 980px;
}

