/* =========================================
   Çocuk Görev & Ödül Takip - Styles
   Purple/Violet Theme (iPad App Clone)
   ========================================= */

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

/* ── CSS Variables ── */
:root {
  --primary: #6C5CE7;
  --primary-dark: #5A4BD1;
  --primary-light: #A29BFE;
  --primary-lighter: #C8C3FF;
  --primary-bg: #B8B0FF;
  --primary-surface: #EBE8FF;
  --cta-bg: #C4BFFF;
  --cta-hover: #B0A8FF;

  --background: #F5F3FF;
  --surface: #FFFFFF;
  --card-bg: #FFFFFF;
  --card-border: #E5E1F5;
  --card-shadow: 0 1px 4px rgba(108, 92, 231, 0.06);

  --text-primary: #1A1730;
  --text-secondary: #4A4660;
  --text-muted: #8B87A0;
  --text-label: #7B74A8;

  --success: #00C853;
  --warning: #FFB300;
  --danger: #FF5252;

  --diamond: #FFD700;
  --points-color: #F5A623;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(108, 92, 231, 0.08);
  --shadow-md: 0 4px 12px rgba(108, 92, 231, 0.12);
  --shadow-lg: 0 8px 32px rgba(108, 92, 231, 0.16);
  --shadow-xl: 0 12px 48px rgba(108, 92, 231, 0.2);

  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  --nav-height: 64px;
  --header-height: 60px;
  --max-width: 100%;
}


/* ── Reset & Base ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--background);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

input, button, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  outline: none;
}

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

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ── App Shell ── */
#app {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.app-container {
  width: 100%;
  max-width: var(--max-width);
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  background: var(--surface);
  box-shadow: 0 0 60px rgba(108, 92, 231, 0.08);
}

/* ── Screens ── */
.screen {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.screen.active {
  display: flex;
}

/* ── Login / Setup Screen ── */
.auth-screen {
  background: linear-gradient(160deg, #6C5CE7 0%, #A29BFE 50%, #C8C3FF 100%);
  justify-content: center;
  align-items: center;
  padding: 32px 24px;
  text-align: center;
}

.auth-logo {
  font-size: 64px;
  margin-bottom: 16px;
  animation: bounceIn 0.6s ease;
}

.auth-title {
  font-size: 28px;
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.auth-subtitle {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 40px;
}

.auth-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  padding: 32px 24px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-xl);
}

.auth-card h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-label);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-md);
  font-size: 15px;
  color: var(--text-primary);
  background: var(--surface);
  transition: border-color var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.pin-input-group {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.pin-digit {
  width: 56px;
  height: 64px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  background: var(--surface);
  transition: all var(--transition-fast);
}

.pin-digit:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
  outline: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
  width: 100%;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  width: 100%;
}

.btn-secondary:hover {
  background: var(--primary-surface);
}

.btn-cta {
  background: var(--cta-bg);
  color: var(--primary-dark);
  width: 100%;
  padding: 16px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  border-radius: var(--radius-lg);
}

.btn-cta:hover {
  background: var(--cta-hover);
  transform: translateY(-1px);
}

.btn-cta:active {
  transform: translateY(0);
}

.btn-ghost {
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  padding: 12px;
  font-size: 14px;
}

.btn-ghost:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--card-border);
}

/* ── Child Selection ── */
.child-select-screen {
  background: var(--background);
  padding: 24px;
}

.child-select-header {
  text-align: center;
  margin-bottom: 32px;
  padding-top: 40px;
}

.child-select-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.child-select-header p {
  font-size: 14px;
  color: var(--text-muted);
}

.children-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 360px;
  margin: 0 auto;
}

.child-card {
  background: var(--surface);
  border: 2px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.child-card:hover {
  border-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.child-card:active {
  transform: translateY(0);
}

.child-card .avatar {
  font-size: 48px;
  margin-bottom: 8px;
  display: block;
}

.child-card .name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.child-card .points-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--points-color);
}

.add-child-card {
  border: 2px dashed var(--card-border);
  background: transparent;
}

.add-child-card:hover {
  border-color: var(--primary);
  background: var(--primary-surface);
}

.add-child-card .avatar {
  font-size: 36px;
  color: var(--text-muted);
}

.add-child-card .name {
  color: var(--text-muted);
}

.parent-mode-btn {
  margin-top: 32px;
  text-align: center;
}

.parent-mode-btn button {
  background: var(--primary-surface);
  color: var(--primary);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.parent-mode-btn button:hover {
  background: var(--primary-lighter);
}

/* ── Main App Header ── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.header-avatar {
  font-size: 32px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-surface);
  border-radius: var(--radius-full);
}

.header-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-size: 20px;
  transition: all var(--transition-fast);
}

.header-btn:hover {
  background: var(--primary-surface);
  color: var(--primary);
}

.parent-badge {
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Main Content Area ── */
.main-content {
  flex: 1;
  padding: 0 20px 100px;
  overflow-y: auto;
}

/* ── Dashboard Widget ── */
.dashboard-widget {
  margin-bottom: 24px;
}

.dashboard-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-label);
  margin-bottom: 10px;
}

.dashboard-card {
  background: linear-gradient(135deg, #6C5CE7 0%, #8B7CF7 40%, #A29BFE 100%);
  border-radius: var(--radius-xl);
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(108, 92, 231, 0.35);
}

.dashboard-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
}

.dashboard-card::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -20%;
  width: 150px;
  height: 150px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 50%;
}

.dashboard-stat {
  text-align: center;
  position: relative;
  z-index: 1;
  padding: 8px 0;
}

.dashboard-stat:not(:last-child) {
  border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.dashboard-stat .stat-icon {
  font-size: 18px;
  margin-bottom: 2px;
}

.dashboard-stat .stat-value {
  font-size: 28px;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.2;
}

.dashboard-stat .stat-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 2px;
}

/* ── Section Labels ── */
.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-label);
  margin-bottom: 12px;
  margin-top: 8px;
}

/* ── Task & Reward Cards ── */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-card,
.reward-card {
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.task-card:hover,
.reward-card:hover {
  border-color: var(--primary-lighter);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.task-card:active,
.reward-card:active {
  transform: translateY(0);
}

.task-card.completed {
  opacity: 0.5;
  background: #F9F8FF;
}

.task-card.completed .card-emoji {
  position: relative;
}

.task-card.completed .card-emoji::after {
  content: '✓';
  position: absolute;
  bottom: -2px;
  right: -4px;
  font-size: 14px;
  background: var(--success);
  color: #fff;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.task-card.pending {
  border-color: var(--warning);
  background: #FFFBF0;
}

.card-emoji {
  font-size: 32px;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-content {
  flex: 1;
  min-width: 0;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.card-points {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--points-color);
  font-weight: 600;
}

.card-points .diamond {
  font-size: 12px;
}

.card-dot {
  color: var(--text-muted);
  font-size: 10px;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.card-action-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  font-size: 16px;
  transition: all var(--transition-fast);
}

.card-action-btn.approve {
  color: var(--success);
}

.card-action-btn.approve:hover {
  background: rgba(0, 200, 83, 0.1);
}

.card-action-btn.reject {
  color: var(--danger);
}

.card-action-btn.reject:hover {
  background: rgba(255, 82, 82, 0.1);
}

.card-action-btn.delete {
  color: var(--text-muted);
}

.card-action-btn.delete:hover {
  color: var(--danger);
  background: rgba(255, 82, 82, 0.1);
}

/* Reward card right side points */
.reward-card .card-points {
  font-size: 15px;
}

.reward-card .card-points .diamond {
  font-size: 14px;
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
}

.empty-state .empty-icon {
  font-size: 80px;
  margin-bottom: 16px;
  opacity: 0.8;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 260px;
  margin: 0 auto;
}

/* ── Bottom Navigation ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-width);
  background: var(--surface);
  border-top: 1px solid var(--card-border);
  display: flex;
  height: var(--nav-height);
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--transition-fast);
  position: relative;
  background: none;
  border: none;
}

.nav-item:hover {
  color: var(--primary-light);
}

.nav-item.active {
  color: var(--primary);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 4px 4px;
}

.nav-icon {
  font-size: 22px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-label {
  font-size: 11px;
  font-weight: 600;
}

.nav-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 20px);
  min-width: 18px;
  height: 18px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* ── FAB (Floating Action Button) ── */
.fab {
  position: fixed;
  bottom: calc(var(--nav-height) + 16px + env(safe-area-inset-bottom, 0px));
  right: calc(50% - var(--max-width) / 2 + 20px);
  width: 56px;
  height: 56px;
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-full);
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 150;
}

.fab:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
  box-shadow: var(--shadow-xl);
}

.fab:active {
  transform: scale(0.95);
}

.fab.hidden {
  display: none;
}

@media (max-width: 480px) {
  .fab {
    right: 20px;
  }
}


/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 23, 48, 0.5);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: none;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--surface);
  width: 100%;
  max-width: var(--max-width);
  max-height: 95vh;
  max-height: 95dvh;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  overflow-y: auto;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 20px 0;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}

.modal-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 20px;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--primary-surface);
  color: var(--primary);
}

.modal-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-body {
  padding: 24px 20px;
  flex: 1;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 20px 24px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  position: sticky;
  bottom: 0;
  background: var(--surface);
}

/* ── Preset Chips ── */
.preset-section {
  margin-bottom: 28px;
}

.preset-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--primary-surface);
  border: 1.5px solid transparent;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.preset-chip:hover {
  background: var(--primary-lighter);
  border-color: var(--primary-light);
}

.preset-chip.selected {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
}

.preset-chip .chip-emoji {
  font-size: 16px;
}

/* ── Points Counter ── */
.points-counter-section {
  margin-bottom: 28px;
}

.points-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.counter-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-surface);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-full);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.counter-btn:hover {
  background: var(--primary-lighter);
  border-color: var(--primary-light);
}

.counter-btn:active {
  transform: scale(0.92);
}

.counter-value {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  min-width: 80px;
  justify-content: center;
}

.counter-value .diamond {
  font-size: 20px;
}

/* ── Option Buttons (Repeat, Time of Day) ── */
.option-section {
  margin-bottom: 28px;
}

.option-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.option-btn {
  padding: 12px;
  background: var(--surface);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.option-btn:hover {
  border-color: var(--primary-light);
  background: var(--primary-surface);
}

.option-btn.selected {
  border-color: var(--primary);
  background: var(--primary-surface);
  color: var(--primary);
  font-weight: 600;
}

/* Custom days grid */
.custom-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.day-btn {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.day-btn:hover {
  border-color: var(--primary-light);
}

.day-btn.selected {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
}

/* ── Activity / Requests ── */
.request-card {
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  animation: fadeInUp 0.3s ease;
}

.request-card .card-emoji {
  font-size: 28px;
}

.request-info {
  flex: 1;
}

.request-info .child-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 2px;
}

.request-info .request-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.request-info .request-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.request-actions {
  display: flex;
  gap: 8px;
}

.request-actions .action-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all var(--transition-fast);
}

.action-btn.approve-btn {
  background: rgba(0, 200, 83, 0.1);
  color: var(--success);
}

.action-btn.approve-btn:hover {
  background: rgba(0, 200, 83, 0.2);
}

.action-btn.reject-btn {
  background: rgba(255, 82, 82, 0.1);
  color: var(--danger);
}

.action-btn.reject-btn:hover {
  background: rgba(255, 82, 82, 0.2);
}

/* ── Toast Notification ── */
.toast-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: var(--max-width);
  width: calc(100% - 40px);
  pointer-events: none;
}

.toast {
  background: var(--text-primary);
  color: #FFFFFF;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideDown 0.3s ease, fadeOut 0.3s ease 2.7s;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.success {
  background: var(--success);
}

.toast.error {
  background: var(--danger);
}

.toast.warning {
  background: var(--warning);
  color: var(--text-primary);
}

.toast .toast-icon {
  font-size: 18px;
}

/* ── Confirm Dialog ── */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 23, 48, 0.5);
  backdrop-filter: blur(4px);
  z-index: 600;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.confirm-overlay.active {
  display: flex;
}

.confirm-dialog {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  animation: scaleIn 0.2s ease;
  box-shadow: var(--shadow-xl);
}

.confirm-dialog .confirm-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.confirm-dialog h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.confirm-dialog p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.confirm-actions {
  display: flex;
  gap: 10px;
}

.confirm-actions .btn {
  flex: 1;
  padding: 12px;
}

/* ── Avatar Picker ── */
.avatar-picker {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-top: 8px;
}

.avatar-option {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.avatar-option:hover {
  border-color: var(--primary-light);
  background: var(--primary-surface);
}

.avatar-option.selected {
  border-color: var(--primary);
  background: var(--primary-surface);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}

/* ── Task Icon Picker ── */
.task-icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  max-height: 160px;
  overflow-y: auto;
  padding: 8px;
  background: var(--primary-surface);
  border-radius: var(--radius-md);
  border: 1.5px solid var(--card-border);
  margin-top: 8px;
}

.task-icon-picker-grid .icon-chip {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--surface);
}

.task-icon-picker-grid .icon-chip:hover {
  background: var(--primary-lighter);
  border-color: var(--primary-light);
}

.task-icon-picker-grid .icon-chip.selected {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}


/* ── Settings Panel ── */
.settings-section {
  margin-bottom: 24px;
}

.settings-section h3 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-label);
  margin-bottom: 12px;
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.settings-item:hover {
  background: var(--primary-surface);
}

.settings-item .settings-label {
  font-size: 15px;
  font-weight: 500;
}

.settings-item .settings-value {
  font-size: 14px;
  color: var(--text-muted);
}

.danger-btn {
  background: rgba(255, 82, 82, 0.1);
  color: var(--danger);
  border: none;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  width: 100%;
  transition: all var(--transition-fast);
}

.danger-btn:hover {
  background: rgba(255, 82, 82, 0.2);
}

/* ── Animations ── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

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

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

@keyframes pointsEarned {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-40px) scale(1.5);
  }
}

.points-animation {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 32px;
  font-weight: 800;
  color: var(--points-color);
  z-index: 9999;
  pointer-events: none;
  animation: pointsEarned 0.8s ease forwards;
}

/* ── Tab Content Animation ── */
.tab-content {
  display: none;
  animation: fadeInUp 0.25s ease;
}

.tab-content.active {
  display: block;
}

/* ── Swipe indicator for completed tasks ── */
.swipe-hint {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to left, var(--success), transparent);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  color: #fff;
  font-size: 20px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.task-card:hover .swipe-hint {
  opacity: 0.6;
}

/* ── Loading Spinner ── */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--primary-surface);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 24px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Responsive ── */

/* Base responsiveness for all screens (always full width) */
:root {
  --max-width: 100%;
}

.app-container {
  box-shadow: none;
  border-left: none;
  border-right: none;
}

.fab {
  right: 24px;
}

.toast-container {
  width: calc(100% - 48px);
  max-width: 480px;
}

/* Very small screen devices (mobile phones under 380px, e.g. iPhone SE) */
@media (max-width: 380px) {
  .dashboard-card {
    padding: 12px;
  }

  .dashboard-stat .stat-value {
    font-size: 20px;
  }

  .dashboard-stat .stat-icon {
    font-size: 16px;
  }

  .dashboard-stat .stat-label {
    font-size: 8px;
    letter-spacing: 0.8px;
  }

  .children-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 4px;
  }

  .child-card {
    padding: 16px 10px;
  }

  .child-card .avatar {
    font-size: 36px;
  }

  .preset-chip {
    padding: 6px 10px;
    font-size: 12px;
  }

  .modal-body {
    padding: 20px 16px;
  }

  .pin-digit {
    width: 44px;
    height: 52px;
    font-size: 20px;
  }
}

/* Medium viewports (tablets, landscape phones >= 600px) */
@media (min-width: 600px) {
  /* Distribute lists in 2 columns for a balanced tablet/landscape aesthetic */
  .card-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .children-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 600px;
    gap: 20px;
  }

  .dashboard-card {
    padding: 24px;
  }

  .dashboard-stat .stat-value {
    font-size: 32px;
  }

  .dashboard-stat .stat-label {
    font-size: 11px;
    letter-spacing: 2px;
  }

  .modal-overlay {
    align-items: center;
  }

  .modal {
    max-width: 500px;
    max-height: 80vh;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
  }

  .modal-footer {
    padding-bottom: 24px;
  }
}

/* Large viewports (desktops, landscape tablets >= 960px) */
@media (min-width: 960px) {
  /* Use 3 columns for lists on large screens */
  .card-list {
    grid-template-columns: repeat(3, 1fr);
  }

  .children-grid {
    grid-template-columns: repeat(4, 1fr);
    max-width: 800px;
  }

  .modal {
    max-width: 540px;
  }

  /* Keep container contents centered and clean on very wide screens */
  .main-content,
  .app-header {
    max-width: 1200px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Extra large screens (wide desktops >= 1280px) */
@media (min-width: 1280px) {
  /* Use 4 columns for lists on extra wide screens */
  .card-list {
    grid-template-columns: repeat(4, 1fr);
  }

  .children-grid {
    grid-template-columns: repeat(5, 1fr);
    max-width: 1000px;
  }
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-lighter);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-light);
}

/* ── Task completion tick button ── */
.task-tick {
  width: 32px;
  height: 32px;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 16px;
  color: transparent;
}

.task-tick:hover {
  border-color: var(--success);
  background: rgba(0, 200, 83, 0.1);
  color: var(--success);
}

.task-tick.checked {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.task-tick.pending-approval {
  background: var(--warning);
  border-color: var(--warning);
  color: #fff;
}

/* ── Streak fire animation ── */
.streak-fire {
  animation: pulse 1.5s ease infinite;
}

/* ── Child task view specific styles ── */
.child-complete-btn {
  padding: 8px 16px;
  background: var(--primary-surface);
  border: 1.5px solid var(--primary-lighter);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.child-complete-btn:hover {
  background: var(--primary);
  color: #fff;
}

.reward-claim-btn {
  padding: 8px 16px;
  background: var(--points-color);
  border: none;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.reward-claim-btn:hover {
  filter: brightness(1.1);
  transform: scale(1.02);
}

.reward-claim-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}
