/* ─── Umoyo design tokens ──────────────────────────────────────── */
:root {
  --umoyo-primary: #8B5E3C;
  --umoyo-dark: #2C1810;
  --umoyo-gold: #D4A843;
  --umoyo-lightgold: #F5E6C8;
  --umoyo-cream: #FFFDF9;
  --umoyo-soft: #FAF6F0;
  --umoyo-border: #E8DEC8;
  --umoyo-muted: #7A6A5D;
}

body { 
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif; 
}
.font-display { 
  font-family: 'Playfair Display', Georgia, serif; 
}

/* ─── Modern Card Components ───────────────────────────────────── */
.card {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 10px 30px -10px rgba(44, 24, 16, 0.05), 0 0 1px 1px rgba(232, 222, 200, 0.5);
  border: 1px solid var(--umoyo-border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px -12px rgba(44, 24, 16, 0.09);
}

.input {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 1.5px solid var(--umoyo-border);
  border-radius: 14px;
  background: #ffffff;
  color: var(--umoyo-dark);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.input:focus {
  border-color: var(--umoyo-primary);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(139, 94, 60, 0.12);
}
.input::placeholder { color: #A08C7D; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #8B5E3C 0%, #724A2E 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(139, 94, 60, 0.25);
  transition: all 0.2s ease;
}
.btn-primary:hover { 
  background: linear-gradient(135deg, #7A5032 0%, #613E24 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(139, 94, 60, 0.35);
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border: 1.5px solid var(--umoyo-border);
  border-radius: 14px;
  background: #ffffff;
  color: var(--umoyo-primary);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-outline:hover { 
  background: var(--umoyo-soft); 
  border-color: #D6C8B4;
  transform: translateY(-1px);
}
.btn-outline:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 12px 20px;
  border: 1.5px solid var(--umoyo-border);
  border-radius: 14px;
  background: #ffffff;
  color: var(--umoyo-dark);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
}
.btn-google:hover { 
  background: #FAF7F2; 
  box-shadow: 0 4px 12px rgba(44, 24, 16, 0.06); 
  transform: translateY(-1px);
}

/* ─── Flash Messages ───────────────────────────────────────────── */
.flash {
  padding: 14px 18px;
  border-radius: 16px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  word-break: break-word;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}
.flash-success { background: #ECFDF5; color: #065F46; border-color: #A7F3D0; }
.flash-error   { background: #FEF2F2; color: #991B1B; border-color: #FECACA; }
.flash-info    { background: #EFF6FF; color: #1E40AF; border-color: #BFDBFE; }

/* ─── Bottom Navigation Micro-Interactions ─────────────────────── */
.bottom-nav-item {
  flex: 1;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #7A6A5D;
  transition: color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.bottom-nav-item.active {
  color: #8B5E3C;
}

.bottom-nav-item.active i {
  transform: translateY(-2px) scale(1.1);
  color: #8B5E3C;
}

/* ─── Center Home FAB Accent Style ─────────────────────────────── */
.bottom-center-home-button {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -20px;
  text-decoration: none;
}

.bottom-center-home-button div {
  box-shadow: 0 8px 20px rgba(139, 94, 60, 0.35);
}

.bottom-center-home-button:hover div {
  box-shadow: 0 12px 24px rgba(139, 94, 60, 0.45);
}

/* ─── Header Menu Items ────────────────────────────────────────── */
.menu-item {
  min-height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--umoyo-dark);
  background: var(--umoyo-soft);
  border: 1px solid var(--umoyo-border);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
}

.menu-item i {
  width: 20px;
  font-size: 15px;
  color: var(--umoyo-primary);
  text-align: center;
}

.menu-item:hover {
  background: #ffffff;
  border-color: #D6C8B4;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(44, 24, 16, 0.05);
}

.menu-item:active {
  transform: scale(0.98);
}

/* ─── Animations ───────────────────────────────────────────────── */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translate(-50%, -10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.animate-slide-down {
  animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.animate-fade-in {
  animation: fadeIn 0.3s ease-in-out forwards;
}


/* ─── Professional Dashboard ─────────────────────────────── */

.dashboard-welcome {
    position: relative;
    overflow: hidden;
    padding: 26px;
    border-radius: 24px;
    color: #fff;
    background:
        radial-gradient(
            circle at 100% 0%,
            rgba(212, 168, 67, .25),
            transparent 38%
        ),
        linear-gradient(135deg, #2C1810, #8B5E3C);
    box-shadow: 0 14px 32px rgba(44, 24, 16, .12);
}

.dashboard-stat {
    min-width: 0;
    padding: 20px;
    background: #fff;
    border: 1px solid var(--umoyo-border);
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(44, 24, 16, .035);
    transition: transform .2s ease, box-shadow .2s ease;
}

.dashboard-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(44, 24, 16, .07);
}

.dashboard-stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 15px;
    background: #F5E6C8;
    color: var(--umoyo-primary);
    font-size: 19px;
}

.dashboard-action {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 82px;
    padding: 16px;
    color: var(--umoyo-dark);
    background: #fff;
    border: 1px solid var(--umoyo-border);
    border-radius: 18px;
    text-decoration: none;
    transition: .2s ease;
}

.dashboard-action:hover {
    border-color: var(--umoyo-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(44, 24, 16, .06);
}

.dashboard-action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 14px;
    color: var(--umoyo-primary);
    background: var(--umoyo-soft);
    font-size: 18px;
}

.dashboard-section-title {
    color: var(--umoyo-dark);
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.dashboard-muted {
    color: var(--umoyo-muted);
    font-size: 12px;
    line-height: 1.6;
}

/* ─── Enable Notifications Modal ─────────────────────────── */

.notification-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(32, 24, 20, .55);
    backdrop-filter: blur(5px);
}

.notification-modal {
    width: 100%;
    max-width: 390px;
    padding: 28px;
    background: #fff;
    border: 1px solid var(--umoyo-border);
    border-radius: 24px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .2);
    animation: notificationModalIn .22s ease-out;
}

.notification-modal-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin-bottom: 18px;
    color: var(--umoyo-primary);
    background: var(--umoyo-lightgold);
    border-radius: 19px;
    font-size: 25px;
}

@keyframes notificationModalIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 480px) {
    .dashboard-welcome {
        padding: 22px;
        border-radius: 20px;
    }

    .dashboard-stat {
        padding: 15px;
    }

    .notification-modal {
        padding: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dashboard-stat,
    .dashboard-action,
    .notification-modal {
        animation: none;
        transition: none;
    }
}


/* Ensure the notification popup respects the hidden attribute */
.notification-modal-backdrop[hidden] {
    display: none !important;
}

/* Keep the popup usable on smaller screens */
.notification-modal {
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
}

.notification-modal button:focus-visible,
.dashboard-action:focus-visible {
    outline: 3px solid var(--umoyo-gold);
    outline-offset: 3px;
}

/* ─── Compact mobile shell ─────────────────────────────────────────
 * Tailwind sizes (text, padding, gaps, icons) are in rem. Lowering the
 * root size on phones shrinks the whole app shell proportionally.
 * Applies only on screens 640px and narrower.
 * ----------------------------------------------------------------- */

@media (max-width: 640px) {

  html {
    font-size: 14px;
  }

  /* Arbitrary sizes (text-[10px] etc.) are fixed in px, so they need explicit overrides. */
  .umoyo-app .text-\[9px\]  { font-size: 8px;  line-height: 11px; }
  .umoyo-app .text-\[10px\] { font-size: 9px;  line-height: 12px; }
  .umoyo-app .text-\[11px\] { font-size: 10px; line-height: 13px; }
  .umoyo-app .text-\[12px\] { font-size: 11px; line-height: 14px; }

  /* Headings wrap instead of pushing content off screen. */
  .umoyo-app .font-display {
    line-height: 1.25;
    letter-spacing: -0.01em;
  }

  .umoyo-app h1,
  .umoyo-app h2,
  .umoyo-app h3,
  .umoyo-app p,
  .umoyo-app dd,
  .umoyo-app td,
  .umoyo-app li {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /* Header church name: capped width, truncated with an ellipsis. */
  .umoyo-app header .font-display {
    max-width: 9rem;
  }

  /* Buttons: a 40px tap target with smaller text. */
  .umoyo-app .btn-primary,
  .umoyo-app .btn-outline,
  .umoyo-app .btn-google {
    min-height: 40px;
    padding: 8px 14px;
    font-size: 12px;
    border-radius: 12px;
  }

  /* Inputs stay at 16px so iOS Safari does not zoom in when a field is tapped. */
  .umoyo-app .input {
    min-height: 42px;
    padding: 9px 12px;
    font-size: 16px;
    border-radius: 12px;
  }

  .umoyo-app .card {
    border-radius: 14px;
  }

  .umoyo-app table {
    font-size: 10px;
  }
}