/* ============================================
   BintangKu – Page-Specific Styles
   ============================================ */

/* ─── Splash Page ─── */
.splash-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-gradient);
  position: relative;
  overflow: hidden;
  padding: var(--space-8);
}

.splash-page::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 40%, rgba(124, 92, 252, 0.15) 0%, transparent 50%),
              radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.1) 0%, transparent 40%);
  pointer-events: none;
}

.splash-logo {
  font-size: 5rem;
  margin-bottom: var(--space-4);
  animation: bounceIn 0.8s ease;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.1));
  z-index: 1;
}

.splash-title {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-extrabold);
  color: var(--color-text-on-primary);
  margin-bottom: var(--space-2);
  text-align: center;
  z-index: 1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.splash-tagline {
  font-size: var(--font-size-lg);
  color: rgba(30, 27, 75, 0.7);
  text-align: center;
  margin-bottom: var(--space-10);
  z-index: 1;
  max-width: 400px;
}

.splash-btn {
  z-index: 1;
  padding: var(--space-4) var(--space-12);
  background: var(--color-text-on-primary);
  color: var(--color-primary-dark);
  border-radius: var(--radius-full);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-bounce);
  min-height: 56px;
}

.splash-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: var(--shadow-xl);
}

.splash-btn:active {
  transform: translateY(0) scale(0.98);
}

.splash-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.splash-star {
  position: absolute;
  font-size: 1.5rem;
  opacity: 0;
  animation: sparkle 3s ease-in-out infinite;
}

/* ─── Auth Pages (Login/Register) ─── */
.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  padding: var(--space-4);
  position: relative;
}

.auth-page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: var(--color-primary-gradient);
  border-radius: 0 0 50% 50% / 0 0 30px 30px;
}

.auth-card {
  background: var(--color-surface);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 420px;
  z-index: 1;
  animation: fadeInUp 0.5s ease;
}

.auth-logo {
  text-align: center;
  margin-bottom: var(--space-6);
}

.auth-logo-icon {
  font-size: 3rem;
  margin-bottom: var(--space-2);
}

.auth-logo-text {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-extrabold);
  color: var(--color-text-primary);
}

.auth-logo-sub {
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.auth-footer {
  text-align: center;
  margin-top: var(--space-6);
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
}

.auth-footer a, .auth-footer span.link {
  color: var(--color-secondary);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
}

.auth-footer a:hover, .auth-footer span.link:hover {
  color: var(--color-secondary-dark);
}

/* ─── Child Select Page ─── */
.child-select-page {
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--space-8);
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.child-select-header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.child-select-title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-extrabold);
  margin-bottom: var(--space-2);
}

.child-select-subtitle {
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
}

.child-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-4);
  width: 100%;
  max-width: 700px;
}

.child-select-footer {
  margin-top: var(--space-8);
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  justify-content: center;
}

.add-child-card {
  background: var(--color-bg-warm);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  cursor: pointer;
  transition: all var(--transition-base);
  color: var(--color-text-tertiary);
  min-height: 200px;
}

.add-child-card:hover {
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
  background: rgba(255, 204, 51, 0.05);
}

.add-child-card .add-icon {
  font-size: 2.5rem;
}

/* ─── Child Home Page ─── */
.child-home-page {
  padding-bottom: calc(var(--bottom-nav-height) + var(--space-4));
}

.child-home-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--color-primary-gradient);
  border-radius: var(--radius-2xl);
  margin-bottom: var(--space-6);
  position: relative;
  overflow: hidden;
}

.child-home-header::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.child-home-avatar {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-md);
  z-index: 1;
}

.child-home-info {
  flex: 1;
  z-index: 1;
}

.child-home-name {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-extrabold);
  color: var(--color-text-on-primary);
  margin-bottom: var(--space-1);
}

.child-home-stats {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.child-home-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-6);
}

.child-home-activities {
  margin-bottom: var(--space-6);
}

.child-home-activities .activity-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.child-home-reward-preview {
  background: linear-gradient(135deg, rgba(124, 92, 252, 0.08) 0%, rgba(255, 204, 51, 0.08) 100%);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  border: 1px solid var(--color-border-light);
}

.child-home-reward-preview .reward-preview-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.child-home-reward-preview .reward-progress {
  height: 8px;
  background: var(--color-border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.child-home-reward-preview .reward-progress-fill {
  height: 100%;
  background: var(--color-secondary-gradient);
  border-radius: var(--radius-full);
  transition: width 1s ease;
}

/* ─── Parent Dashboard ─── */
.parent-page {
  background: var(--color-parent-bg);
  min-height: 100vh;
  min-height: 100dvh;
}

.parent-content {
  padding: var(--space-6);
  max-width: var(--max-content-width);
  margin: 0 auto;
}

.parent-header {
  margin-bottom: var(--space-6);
}

.parent-header-greeting {
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
  margin-bottom: var(--space-1);
}

.parent-header-title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-extrabold);
}

.parent-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.parent-children-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.parent-child-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border-light);
  cursor: pointer;
  transition: all var(--transition-base);
}

.parent-child-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.parent-child-card .pcc-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.parent-child-card .pcc-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.parent-child-card .pcc-name {
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-md);
}

.parent-child-card .pcc-progress {
  height: 8px;
  background: var(--color-border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-2);
}

.parent-child-card .pcc-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 1s ease;
}

.parent-child-card .pcc-stats {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
}

/* ─── Reports Page ─── */
.chart-container {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border-light);
  margin-bottom: var(--space-4);
}

.chart-title {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-4);
}

/* ─── Manage Page (Activities/Rewards/Children) ─── */
.manage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
  gap: var(--space-3);
}

.manage-table {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border-light);
}

.manage-table-row {
  display: flex;
  align-items: center;
  padding: var(--space-4);
  gap: var(--space-3);
  border-bottom: 1px solid var(--color-border-light);
  transition: background var(--transition-fast);
}

.manage-table-row:last-child {
  border-bottom: none;
}

.manage-table-row:hover {
  background: var(--color-surface-hover);
}

.manage-table-row .row-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.manage-table-row .row-info {
  flex: 1;
  min-width: 0;
}

.manage-table-row .row-title {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-base);
}

.manage-table-row .row-sub {
  font-size: var(--font-size-xs);
  color: var(--color-text-tertiary);
}

.manage-table-row .row-actions {
  display: flex;
  gap: var(--space-2);
}

/* ─── Form Modal (Add/Edit) ─── */
.form-modal-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

/* ─── Settings Page ─── */
.settings-group {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border-light);
  margin-bottom: var(--space-4);
}

.settings-group-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: var(--space-4) var(--space-5) var(--space-2);
}

.settings-item {
  display: flex;
  align-items: center;
  padding: var(--space-4) var(--space-5);
  gap: var(--space-4);
  border-bottom: 1px solid var(--color-border-light);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.settings-item:last-child {
  border-bottom: none;
}

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

.settings-item .settings-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: var(--color-bg-warm);
}

.settings-item .settings-info {
  flex: 1;
}

.settings-item .settings-label {
  font-weight: var(--font-weight-semibold);
}

.settings-item .settings-desc {
  font-size: var(--font-size-xs);
  color: var(--color-text-tertiary);
}

.settings-item .settings-arrow {
  color: var(--color-text-tertiary);
  font-size: var(--font-size-lg);
}

/* ─── Responsive Adjustments ─── */
@media (min-width: 600px) {
  .child-home-header {
    padding: var(--space-6);
  }

  .child-select-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .form-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1024px) {
  .parent-content {
    margin-left: var(--sidebar-width);
    padding: var(--space-8);
  }

  .parent-summary-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 599px) {
  .splash-title {
    font-size: var(--font-size-3xl);
  }

  .splash-logo {
    font-size: 4rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .parent-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .manage-header {
    flex-direction: column;
    align-items: stretch;
  }
}
