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

body {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  color: #ece7f6;
  min-height: 100vh;
  padding: 32px 16px;
  background: #050308;
  background-image:
    radial-gradient(ellipse 80% 55% at 50% -10%, rgba(139, 92, 246, 0.22), transparent 60%),
    radial-gradient(ellipse 60% 45% at 85% 110%, rgba(168, 85, 247, 0.12), transparent 65%),
    radial-gradient(ellipse 55% 40% at 8% 90%, rgba(109, 40, 217, 0.14), transparent 60%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* ---- floating purple light orbs ---- */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}
.orb-1 {
  width: 420px; height: 420px;
  top: -140px; left: -120px;
  background: radial-gradient(circle, #7c3aed 0%, transparent 70%);
  animation: drift 16s ease-in-out infinite alternate;
}
.orb-2 {
  width: 360px; height: 360px;
  bottom: -120px; right: -100px;
  background: radial-gradient(circle, #a855f7 0%, transparent 70%);
  animation: drift 20s ease-in-out infinite alternate-reverse;
}
.orb-3 {
  width: 260px; height: 260px;
  top: 42%; right: 12%;
  background: radial-gradient(circle, #d946ef 0%, transparent 70%);
  opacity: 0.3;
  animation: drift 24s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(40px, 30px) scale(1.15); }
}

.container {
  max-width: 760px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

header { text-align: center; margin-bottom: 28px; }
h1 {
  font-size: 1.6rem;
  font-weight: 700;
  background: linear-gradient(120deg, #f5f3ff, #c4b5fd 55%, #e879f9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 40px rgba(168, 85, 247, 0.35);
}
.subtitle { color: #a99cc4; margin-top: 8px; font-size: 0.9rem; }

/* ---- glass panel mixin look ---- */
#add-form {
  display: flex;
  gap: 10px;
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 22px;
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    0 0 32px rgba(139, 92, 246, 0.10);
}
#add-form input {
  flex: 1;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  color: #ece7f6;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}
#add-form input::placeholder { color: #6f6488; }
#add-form input:focus {
  border-color: rgba(168, 85, 247, 0.65);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18), 0 0 18px rgba(168, 85, 247, 0.25);
}
#new-address { flex: 2; }
#add-form button {
  background: linear-gradient(135deg, #8b5cf6, #d946ef);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 22px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: filter 0.25s, transform 0.15s, box-shadow 0.25s;
}
#add-form button:hover {
  filter: brightness(1.12);
  box-shadow: 0 10px 32px rgba(168, 85, 247, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
#add-form button:active { transform: scale(0.97); }

.empty {
  text-align: center;
  color: #8d81a8;
  padding: 40px 0;
}

/* ---- glass rows ---- */
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  direction: ltr; /* email on the left, time + toggle on the right */
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow:
    0 14px 40px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    0 0 28px rgba(139, 92, 246, 0.07);
  transition: background 0.4s, border-color 0.4s, box-shadow 0.4s;
}

.row .addr {
  flex: 2;
  direction: ltr;
  text-align: left;
  font-size: 1rem;
  font-weight: 500;
  word-break: break-all;
  color: #f1edfa;
}

.time-cell {
  flex: 1;
  min-width: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.time-input {
  width: 100%;
  max-width: 130px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  color: #ece7f6;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 1rem;
  text-align: center;
  outline: none;
  direction: ltr;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.time-input:focus {
  border-color: rgba(168, 85, 247, 0.65);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18), 0 0 18px rgba(168, 85, 247, 0.25);
}
.time-input.invalid {
  border-color: rgba(251, 113, 133, 0.65);
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.3);
}
.time-input.saving {
  opacity: 0.75;
  border-color: rgba(168, 85, 247, 0.5);
}
.time-input.saved {
  border-color: rgba(52, 211, 153, 0.6);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.28);
  transition: border-color 0.2s, box-shadow 0.2s;
}

/* date + small time shown while toggle is on */
.target-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.25;
}
.t-date {
  font-size: 1.15rem;
  font-weight: 700;
  direction: ltr;
  color: #e9d5ff;
  text-shadow: 0 0 18px rgba(196, 132, 252, 0.45);
}
.t-time { font-size: 0.75rem; opacity: 0.85; direction: ltr; }

/* locked state — red glass until target time */
.row.locked {
  background: rgba(244, 63, 94, 0.10);
  border-color: rgba(251, 113, 133, 0.55);
  box-shadow:
    0 14px 40px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 34px rgba(244, 63, 94, 0.30);
}
.row.locked .t-date { color: #ff9dab; text-shadow: 0 0 18px rgba(251, 113, 133, 0.55); }

/* arrived state — green glass after target time */
.row.arrived {
  background: rgba(16, 185, 129, 0.09);
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow:
    0 14px 40px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 34px rgba(16, 185, 129, 0.25);
}
.row.arrived .t-date { color: #86efac; text-shadow: 0 0 18px rgba(52, 211, 153, 0.5); }

.hidden { display: none !important; }

/* ---- toggle switch (purple glow) ---- */
.switch { position: relative; display: inline-block; width: 52px; height: 28px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 28px;
  cursor: pointer;
  transition: background 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  right: 4px;
  top: 3px;
  background: linear-gradient(135deg, #fff, #ddd6fe);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  transition: transform 0.25s;
}
.switch input:checked + .slider {
  background: linear-gradient(135deg, #8b5cf6, #c026d3);
  border-color: rgba(216, 180, 254, 0.5);
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.switch input:checked + .slider::before { transform: translateX(-24px); }

/* ---- delete ---- */
.del {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 10px;
  color: #a99cc4;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 6px 12px;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.del:hover {
  color: #fb7185;
  border-color: rgba(251, 113, 133, 0.55);
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.25);
}

/* ---- suggestion card (bottom-right) ---- */
.suggest {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 40;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(216, 180, 254, 0.35);
  border-radius: 16px;
  padding: 14px 18px;
  min-width: 220px;
  max-width: 300px;
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 34px rgba(139, 92, 246, 0.28);
  transition: opacity 0.4s, transform 0.4s;
}
.suggest-label {
  font-size: 0.75rem;
  color: #c4b5fd;
  margin-bottom: 6px;
}
.suggest-addr {
  direction: ltr;
  text-align: left;
  font-weight: 700;
  font-size: 1rem;
  word-break: break-all;
  color: #f1edfa;
}
.suggest-when {
  margin-top: 3px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #e9d5ff;
  text-shadow: 0 0 16px rgba(196, 132, 252, 0.45);
}
.suggest-when.ltr { direction: ltr; text-align: left; }
.suggest-countdown {
  margin-top: 6px;
  font-size: 0.78rem;
  color: #a99cc4;
}

/* ---- modal (frosted) ---- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 3, 8, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.modal-box {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 26px;
  width: min(92vw, 380px);
  text-align: center;
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 44px rgba(139, 92, 246, 0.22);
}
.modal-box h3 { margin-bottom: 6px; }
.modal-hint { color: #a99cc4; font-size: 0.85rem; margin-bottom: 16px; direction: ltr; }
#dt-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  color: #ece7f6;
  padding: 10px;
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  color-scheme: dark;
  transition: border-color 0.25s, box-shadow 0.25s;
}
#dt-input:focus {
  border-color: rgba(168, 85, 247, 0.65);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
}
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions button {
  flex: 1;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.05);
  color: #ece7f6;
  font-family: inherit;
  font-size: 0.95rem;
  padding: 10px;
  cursor: pointer;
  transition: background 0.25s, box-shadow 0.25s;
}
.modal-actions button:hover { background: rgba(255, 255, 255, 0.1); }
.modal-actions button.primary {
  background: linear-gradient(135deg, #8b5cf6, #d946ef);
  border-color: rgba(255, 255, 255, 0.18);
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.modal-actions button.primary:hover {
  filter: brightness(1.12);
  box-shadow: 0 10px 32px rgba(168, 85, 247, 0.55);
}

@media (max-width: 560px) {
  .row { flex-wrap: wrap; }
  .row .addr { flex-basis: 100%; }
  #add-form { flex-wrap: wrap; }
  #add-form input, #add-form button { flex-basis: 100%; }
  .orb { filter: blur(80px); }
  .suggest { right: 12px; bottom: 12px; left: 12px; max-width: none; }
}
