@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Color Palette - Forget-me-not Blue theme */
  --color-bg: #f8fafc;     /* Clean very light grayish blue */
  --color-surface: #ffffff;
  --color-primary: #3ba3f8;  /* Forget-me-not / Material Blue */
  --color-primary-hover: #218de4;
  --color-secondary: #ffb74d; /* Warm contrast */
  --color-text: #2d3748;
  --color-text-muted: #718096;
  --color-border: #f2e3d5;
  --color-danger: #e65555;
  --color-success: #67c29e;

  /* Typography */
  --font-family: 'Inter', -apple-system, sans-serif;
  
  /* Borders & Shadows */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.12); /* Floating effect */
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.15); /* High floating effect */
  
  --max-width: 600px;
  --nav-height: 65px;
}

/* Theme Overrides */
.theme-dates {
  --color-primary: #fb8b5b; /* Warm Peach */
  --color-primary-hover: #e57348;
  --color-bg: #fffaf4;
  --color-border: #f7e6db;
}


.theme-settings {
  --color-primary: #64748b;
  --color-primary-hover: #475569;
  --color-bg: #f8fafc;
  --color-border: #e2e8f0;
}

.theme-account {
  --color-primary: #64748b; /* Trendy Slate Gray */
  --color-primary-hover: #475569;
  --color-bg: #f8fafc;
  --color-border: #e2e8f0;
}

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

body {
  font-family: var(--font-family);
  background-color: #f5f5f5; /* outer background */
  color: var(--color-text);
  line-height: 1.5;
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

.app-container {
  width: 100%;
  max-width: var(--max-width);
  background-color: var(--color-bg);
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  padding-bottom: calc(var(--nav-height) + 16px);
}

.content-padding { padding: 0 16px; }

header.top-header {
  display: flex; 
  justify-content: space-between; 
  align-items: center;
  padding: 16px 0;
  position: sticky;
  top: 0;
  background-color: var(--color-bg);
  z-index: 10;
}

.text-h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.5px; }
.text-h2 { font-size: 20px; font-weight: 600; }
.text-h3 { font-size: 16px; font-weight: 600; }
.text-body { font-size: 15px; font-weight: 400; }
.text-small { font-size: 13px; font-weight: 400; color: var(--color-text-muted); }

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

.btn-primary {
  background: var(--color-primary); 
  color: white;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(59, 163, 248, 0.4); /* Floating button shadow */
}

.btn-primary.large {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  margin-top: 16px;
}

.clickable {
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.1s ease;
  user-select: none;
}
.clickable:active { transform: scale(0.96); opacity: 0.8; }

/* Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-width);
  height: var(--nav-height);
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  width: 33%;
  height: 100%;
  text-decoration: none;
  opacity: 0.7;
}
.nav-item.active {
  color: var(--color-primary);
  opacity: 1;
  background-color: rgba(59, 163, 248, 0.12); /* Pill background color */
  border-radius: var(--radius-md);
  height: 85%;
  margin: auto 0;
}
.nav-item span {
  font-size: 11px;
  margin-top: 4px;
  font-weight: 500;
}
.nav-item svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Cards */
.card-list { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.grid-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }

.card {
  padding: 16px;
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); /* Floating card */
  border: none;
  display: flex;
  align-items: center;
  gap: 16px;
  transform: translateY(0);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:active {
  transform: translateY(2px);
  box-shadow: var(--shadow-sm);
}
.card.highlight { border-color: var(--color-primary); }

.card-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-full);
  background-color: #faf0e1;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-primary);
}
.card-icon svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 2; fill: none; }

.card-badge {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background-color: #faf0e1;
  color: var(--color-text);
  font-size: 12px; font-weight: 600;
}
.card-badge.urgent { background-color: var(--color-primary); color: white; }

.loved-one-card {
  padding: 16px;
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); /* Floating card */
  border: 1px solid var(--color-border);
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px;
  transform: translateY(0);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.loved-one-card:active {
  transform: translateY(2px);
  box-shadow: var(--shadow-sm);
}

.loved-one-avatar {
  width: 64px; height: 64px;
  border-radius: var(--radius-full);
  background-color: var(--color-secondary);
  color: white;
  display: flex; align-items: center; justify-content: center;
}
.loved-one-avatar svg { width: 32px; height: 32px; stroke: currentColor; stroke-width: 2; fill: none; }

.detail-card {
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 20px; margin-top: 8px;
}
.info-row { display: flex; gap: 12px; align-items: flex-start; width: 100%; border-bottom: 1px solid var(--color-border); padding-bottom: 12px;}
.info-row:last-child { border-bottom: none; padding-bottom: 0; }
.info-row svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; }

.top-bar-icon svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 2; fill: none; }

/* Form Inputs */
.input-classic {
  width: 100%;
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: inherit;
  font-size: 16px;
  color: var(--color-text);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
  transition: all 0.2s;
  box-sizing: border-box;
  resize: none;
}

.input-classic::placeholder {
  color: var(--color-text-muted);
  opacity: 0.35;
}

/* Filled state — мягкая рамка (между пустой и фокусом) */
.input-classic:not(:placeholder-shown):not(:focus):not(select) {
  border-color: color-mix(in srgb, var(--color-primary) 40%, var(--color-border));
}

select.input-classic:not(:focus) {
  border-color: color-mix(in srgb, var(--color-primary) 40%, var(--color-border));
}

/* Focus state — яркая рамка */
.input-classic:focus {
  outline: none;
  border-color: var(--color-primary);
  background-color: var(--color-surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 15%, transparent);
}

/* Save Status (header) */
.save-status-saved {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-success);
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.7;
}
.save-status-btn {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: var(--color-primary);
  border: none;
  border-radius: 20px;
  padding: 8px 20px;
  cursor: pointer;
  animation: fadeScaleIn 0.2s ease-out;
  box-shadow: 0 2px 8px rgba(251, 139, 91, 0.35);
  transition: opacity 0.15s;
}
.save-status-btn:active {
  opacity: 0.7;
}
@keyframes fadeScaleIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

/* Spinner */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Bottom Sheet Modal */
.bottom-sheet-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.bottom-sheet-backdrop {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.bottom-sheet-content {
  position: relative;
  width: 100%;
  max-width: var(--max-width);
  background: var(--color-bg);
  border-radius: 24px 24px 0 0;
  padding: 12px 20px 32px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.15);
  animation: slideUp 0.3s ease-out;
}
.bottom-sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  margin: 0 auto 8px;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* Reminder Cards */
.reminder-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--color-surface);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.reminder-card:active {
  transform: scale(0.98);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

