/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #6C63FF;
  --primary-dark: #5A52D5;
  --primary-light: #EEF0FF;
  --accent: #FF6584;
  --green: #43D9AD;
  --orange: #FF9F43;
  --blue: #54A0FF;
  --bg: #F4F6FB;
  --card: #FFFFFF;
  --text: #1A1A2E;
  --text-muted: #8892A4;
  --border: #E8ECF4;
  --shadow: 0 4px 24px rgba(108,99,255,0.10);
  --shadow-lg: 0 8px 40px rgba(108,99,255,0.18);
  --radius: 18px;
  --radius-sm: 12px;
  --font: 'Nunito', sans-serif;
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

/* ===== SCREENS ===== */
.screen {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  overflow-y: auto;
  background: var(--bg);
  transition: all 0.35s cubic-bezier(.4,0,.2,1);
}
.screen.active { display: flex; }

/* ===== SPLASH SCREEN ===== */
#splashScreen {
  background: linear-gradient(145deg, #6C63FF 0%, #9B59B6 50%, #FF6584 100%);
  overflow: hidden;
}
.splash-bg { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.splash-circles { position: absolute; inset: 0; overflow: hidden; }
.circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}
.c1 { width: 300px; height: 300px; top: -80px; right: -80px; }
.c2 { width: 200px; height: 200px; bottom: 60px; left: -60px; }
.c3 { width: 150px; height: 150px; bottom: 200px; right: 30px; background: rgba(255,255,255,0.05); }

.splash-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 30px;
  text-align: center;
  gap: 20px;
}

.app-logo { margin-bottom: 8px; }
.logo-ring {
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: 3px solid rgba(255,255,255,0.4);
  display: flex; align-items: center; justify-content: center;
  animation: pulse-ring 2s infinite;
}
.logo-icon { width: 48px; height: 48px; color: white; }

@keyframes pulse-ring {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,255,255,0.3); }
  50% { transform: scale(1.05); box-shadow: 0 0 0 20px rgba(255,255,255,0); }
}

.welcome-text {
  font-family: 'Poppins', sans-serif;
  font-size: 36px;
  font-weight: 800;
  color: white;
  line-height: 1.2;
}
.name-highlight {
  background: rgba(255,255,255,0.25);
  padding: 2px 14px;
  border-radius: 30px;
  display: inline-block;
}
.welcome-sub { color: rgba(255,255,255,0.85); font-size: 16px; font-weight: 500; }

.splash-features {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 8px 0;
}
.feat-pill {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
}
.feat-pill svg { width: 14px; height: 14px; }

.btn-start {
  display: flex; align-items: center; gap: 10px;
  background: white;
  color: var(--primary);
  border: none;
  padding: 16px 40px;
  border-radius: 50px;
  font-size: 18px;
  font-weight: 800;
  font-family: var(--font);
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  transition: transform 0.2s, box-shadow 0.2s;
  margin-top: 10px;
}
.btn-start:active { transform: scale(0.97); }
.btn-start svg { width: 20px; height: 20px; }

/* ===== APP HEADER ===== */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 52px 20px 16px;
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.header-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  font-size: 20px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.header-greeting { font-size: 16px; font-weight: 700; color: var(--text); }
.header-date { font-size: 12px; color: var(--text-muted); font-weight: 500; }

.btn-add-header {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  color: white;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(108,99,255,0.4);
  transition: transform 0.2s;
}
.btn-add-header:active { transform: scale(0.93); }
.btn-add-header svg { width: 22px; height: 22px; }

/* ===== PROGRESS CARD ===== */
.progress-card {
  margin: 16px;
  background: linear-gradient(135deg, var(--primary) 0%, #9B59B6 100%);
  border-radius: var(--radius);
  padding: 20px;
  color: white;
  box-shadow: var(--shadow-lg);
}
.progress-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.progress-label { font-size: 13px; opacity: 0.85; font-weight: 600; margin-bottom: 4px; }
.progress-count { font-size: 22px; font-weight: 800; }

.progress-circle-wrap { position: relative; width: 64px; height: 64px; }
.progress-ring { transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255,255,255,0.2); stroke-width: 6; }
.ring-fill {
  fill: none;
  stroke: white;
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease;
}
.progress-pct {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: white;
}

.progress-bar-wrap { }
.progress-bar-track {
  height: 8px;
  background: rgba(255,255,255,0.2);
  border-radius: 10px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: white;
  border-radius: 10px;
  transition: width 0.6s ease;
}

/* ===== TABS ===== */
.tabs {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
}
.tab {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 30px;
  background: var(--card);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}
.tab.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* ===== REMINDER LIST ===== */
.reminder-list {
  flex: 1;
  padding: 0 16px 100px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 60px 20px; gap: 12px;
}
.empty-icon svg { width: 56px; height: 56px; color: var(--text-muted); opacity: 0.4; }
.empty-title { font-size: 18px; font-weight: 700; color: var(--text-muted); }
.empty-sub { font-size: 14px; color: var(--text-muted); opacity: 0.7; }

/* ===== REMINDER CARD ===== */
.reminder-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 14px;
  border-left: 4px solid var(--primary);
  transition: transform 0.2s, opacity 0.3s;
  animation: slideIn 0.3s ease;
}
.reminder-card.done { opacity: 0.55; }
.reminder-card.done .reminder-title { text-decoration: line-through; }

@keyframes slideIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.reminder-color-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.reminder-info { flex: 1; min-width: 0; }
.reminder-title { font-size: 16px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reminder-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.reminder-time { font-size: 13px; color: var(--text-muted); font-weight: 600; display: flex; align-items: center; gap: 4px; }
.reminder-time svg { width: 12px; height: 12px; }
.reminder-repeat { font-size: 11px; background: var(--primary-light); color: var(--primary); padding: 2px 8px; border-radius: 20px; font-weight: 700; }
.reminder-voice-badge { font-size: 11px; background: #FFF3E0; color: var(--orange); padding: 2px 8px; border-radius: 20px; font-weight: 700; display: flex; align-items: center; gap: 3px; }
.reminder-voice-badge svg { width: 10px; height: 10px; }

.reminder-actions { display: flex; gap: 6px; }
.btn-reminder-action {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform 0.2s;
}
.btn-reminder-action:active { transform: scale(0.9); }
.btn-reminder-action svg { width: 16px; height: 16px; }
.btn-done-action { background: #E8FFF5; color: var(--green); }
.btn-delete-action { background: #FFF0F0; color: var(--accent); }

/* ===== FAB ===== */
.fab {
  position: fixed;
  bottom: 28px; right: 24px;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none;
  color: white;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(108,99,255,0.45);
  z-index: 20;
  transition: transform 0.2s;
}
.fab:active { transform: scale(0.93); }
.fab svg { width: 28px; height: 28px; }

/* ===== ADD SCREEN ===== */
.screen-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 52px 20px 16px;
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.btn-back {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg);
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-back svg { width: 20px; height: 20px; color: var(--text); }
.screen-title { font-size: 20px; font-weight: 800; color: var(--text); }

.add-form {
  padding: 20px 16px 100px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-label {
  font-size: 14px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 6px;
}
.form-label svg { width: 16px; height: 16px; color: var(--primary); }

.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: var(--font);
  color: var(--text);
  background: white;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
.form-input:focus { border-color: var(--primary); }
.form-select { cursor: pointer; }

/* ===== REPEAT OPTIONS ===== */
.repeat-options { display: flex; gap: 8px; flex-wrap: wrap; }
.repeat-btn {
  flex: 1;
  min-width: 70px;
  padding: 10px 8px;
  border: 2px solid var(--border);
  border-radius: 30px;
  background: white;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.repeat-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

/* ===== VOICE RECORDER ===== */
.voice-recorder { display: flex; flex-direction: column; gap: 10px; }
.btn-record {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  background: white;
  cursor: pointer;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s;
}
.btn-record.recording {
  border-color: var(--accent);
  background: #FFF0F3;
  color: var(--accent);
}
.record-icon-wrap {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.btn-record.recording .record-icon-wrap { background: var(--accent); }
.btn-record.recording .record-icon-wrap svg { color: white; }
.record-icon-wrap svg { width: 20px; height: 20px; color: var(--primary); }

.record-timer {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  background: #FFF0F3;
  border-radius: 30px;
  width: fit-content;
}
.rec-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 1s infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
#timerDisplay { font-size: 14px; font-weight: 700; color: var(--accent); }

.voice-preview {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: #E8FFF5;
  border-radius: var(--radius-sm);
  color: var(--green);
  font-weight: 600;
  font-size: 14px;
}
.voice-preview svg { width: 20px; height: 20px; }
.btn-delete-voice {
  margin-left: auto;
  background: none; border: none;
  color: var(--accent); cursor: pointer;
  display: flex; align-items: center;
}
.btn-delete-voice svg { width: 18px; height: 18px; }

/* ===== COLOR OPTIONS ===== */
.color-options { display: flex; gap: 12px; }
.color-dot {
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s;
  border: 3px solid transparent;
}
.color-dot.active { transform: scale(1.2); border-color: white; box-shadow: 0 0 0 3px var(--primary); }

/* ===== SAVE BUTTON ===== */
.btn-save {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none;
  border-radius: var(--radius);
  color: white;
  font-size: 18px;
  font-weight: 800;
  font-family: var(--font);
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(108,99,255,0.35);
  transition: transform 0.2s;
  margin-top: 8px;
}
.btn-save:active { transform: scale(0.98); }
.btn-save svg { width: 22px; height: 22px; }

/* ===== CALL SCREEN ===== */
.call-overlay {
  position: fixed !important;
  inset: 0;
  z-index: 100;
  background: linear-gradient(160deg, #1A1A2E 0%, #16213E 50%, #0F3460 100%);
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.call-bg { position: absolute; inset: 0; overflow: hidden; }
.call-ripple {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(108,99,255,0.3);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation: ripple 3s infinite;
}
.r1 { width: 200px; height: 200px; animation-delay: 0s; }
.r2 { width: 320px; height: 320px; animation-delay: 0.8s; }
.r3 { width: 440px; height: 440px; animation-delay: 1.6s; }
@keyframes ripple {
  0% { transform: translate(-50%, -50%) scale(0.8); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.4); opacity: 0; }
}

.call-content {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; padding: 40px 30px; text-align: center;
}
.call-avatar {
  width: 110px; height: 110px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 12px rgba(108,99,255,0.2), 0 0 0 24px rgba(108,99,255,0.1);
  animation: call-pulse 1.5s infinite;
  margin-bottom: 8px;
}
.call-avatar svg { width: 52px; height: 52px; color: white; }
@keyframes call-pulse {
  0%, 100% { box-shadow: 0 0 0 12px rgba(108,99,255,0.2), 0 0 0 24px rgba(108,99,255,0.1); }
  50% { box-shadow: 0 0 0 18px rgba(108,99,255,0.15), 0 0 0 36px rgba(108,99,255,0.07); }
}

.call-label { font-size: 14px; color: rgba(255,255,255,0.6); font-weight: 600; letter-spacing: 2px; text-transform: uppercase; }
.call-title { font-size: 28px; font-weight: 800; color: white; font-family: 'Poppins', sans-serif; }
.call-time { font-size: 18px; color: rgba(255,255,255,0.7); font-weight: 600; }

.btn-play-voice {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 30px;
  color: white;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
}
.btn-play-voice svg { width: 16px; height: 16px; }

.call-actions {
  display: flex; gap: 32px; align-items: center;
  margin-top: 30px;
}
.call-action-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.call-btn {
  width: 68px; height: 68px;
  border-radius: 50%;
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform 0.2s;
}
.call-btn:active { transform: scale(0.9); }
.call-btn svg { width: 28px; height: 28px; }
.call-btn.decline { background: #FF4757; color: white; box-shadow: 0 6px 20px rgba(255,71,87,0.4); }
.call-btn.snooze { background: var(--orange); color: white; box-shadow: 0 6px 20px rgba(255,159,67,0.4); }
.call-btn.accept { background: var(--green); color: white; box-shadow: 0 6px 20px rgba(67,217,173,0.4); }
.call-btn-label { font-size: 13px; color: rgba(255,255,255,0.7); font-weight: 600; }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 100px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1A1A2E;
  color: white;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  transition: all 0.3s;
  z-index: 200;
  white-space: nowrap;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }