/* =========================
   GOOGLE FONTS
========================= */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=Fredoka+One&display=swap');

/* =========================
   ROOT SYSTEM
========================= */
:root {
  --bg-card:     #ffffff;
  --bg-body:     #e0f2fe;
  --bg-navbar:   #f0f9ff;
  --bg-header:   #ffffff;
  --text-main:   #0c1a2e;
  --accent:      #0284c7;
  --accent2:     #0ea5e9;
  --glass-bg:    rgba(255,255,255,.6);
  --glass-border:rgba(0,0,0,.08);

  --sky:    #e0f2fe;
  --sky2:   #bae6fd;
  --blue:   #0ea5e9;
  --blue2:  #0284c7;
  --green:  #22c55e;
  --amber:  #f59e0b;
  --red:    #ef4444;
  --purple: #8b5cf6;
  --muted:  #64748b;
  --border: #e2e8f0;

  --surface:  #ffffff;
  --surface2: #f0f9ff;

  --radius:    20px;
  --radius-sm: 12px;
  --shadow:    0 4px 16px rgba(14,165,233,.12);
  --shadow-lg: 0 10px 32px rgba(14,165,233,.18);
}

.dark {
  --bg-card:    #0f1e2d;
  --bg-body:    #0c1a2e;
  --bg-navbar:  #0f2a40;
  --bg-header:  #0f1e2d;
  --text-main:  #e0f2fe;
  --accent:     #38bdf8;
  --accent2:    #0ea5e9;
  --glass-bg:   rgba(255,255,255,.08);
  --glass-border:rgba(255,255,255,.12);

  --sky:    #0c1e30;
  --sky2:   #0f2a40;
  --blue:   #38bdf8;
  --blue2:  #0ea5e9;
  --surface:  #0f1e2d;
  --surface2: #132233;
  --muted:  #7fb3cc;
  --border: #1e3a52;
}

/* =========================
   GLOBAL
========================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: 'Nunito', sans-serif;
  background: var(--bg-body);
  background-image:
    radial-gradient(circle at 15% 15%, rgba(14,165,233,.12) 0%, transparent 50%),
    radial-gradient(circle at 85% 80%, rgba(139,92,246,.08) 0%, transparent 50%);
  color: var(--text-main);

  touch-action: pan-y;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
  -webkit-tap-highlight-color: transparent;

  scrollbar-width: none;
  -ms-overflow-style: none;

  transition: background .25s, color .25s;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar { display: none; }

/* =========================
   CONTAINER
========================= */
.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 1000px;
  margin: auto;
  padding: 70px 20px 0;
  contain: content;
}

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px;
}

/* =========================
   DEVICE SAFE AREA
========================= */
.navbardevice {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: env(safe-area-inset-top);
  background: var(--bg-header);
  z-index: 1000;
}

/* =========================
   SPLASH
========================= */
#splash {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-body);
  z-index: 9999;
  opacity: 1;
  transition: opacity .35s ease;
}
#splash.hide { opacity: 0; pointer-events: none; }
#splash img  { width: 100px; }

/* =========================
   NAVBAR
========================= */
.navbar {
  position: fixed;
  top: env(safe-area-inset-top);
  left: 0;
  width: 100%;
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  background: var(--bg-navbar);
  z-index: 999;
  will-change: transform;
  backface-visibility: hidden;
}

.navbar ul { list-style: none; margin: 0; padding: 0; display: flex; }

.navbar ul li a {
  display: block;
  color: var(--text-main);
  padding: 14px 20px;
  text-decoration: none;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  border-bottom: 2px solid transparent;
  transition: .2s;
}
.navbar ul li a:hover { color: var(--blue2); }
.navbar ul li a.active {
  color: var(--blue2);
  border-bottom: 2px solid var(--blue2);
}
.dark .navbar ul li a        { color: var(--muted); }
.dark .navbar ul li a:hover  { color: var(--blue); }
.dark .navbar ul li a.active { color: var(--blue); border-bottom-color: var(--blue); }

/* =========================
   LOGO
========================= */
.navbar-logo { display: flex; align-items: center; padding: 0 15px; }
.navbar-logo img { height: 30px; transition: .3s; }
.dark .navbar-logo img { filter: brightness(0) invert(1); }

/* =========================
   INSTALL BUTTON
========================= */
.install-btn {
  margin-left: auto;
  margin-right: 50px;
  background: var(--green);
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-family: 'Fredoka One', cursive;
  font-size: 14px;
  cursor: pointer;
  display: none;
  transition: .2s;
}
.install-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.arrow { display: inline-block; transform: rotate(90deg); }

/* =========================
   DARK TOGGLER
========================= */
#dark-toggler {
  position: fixed;
  top: 15px; right: 20px;
  z-index: 99999;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: .3s;
}
.dark #dark-toggler { background: rgba(30,30,30,0.3); }
#dark-toggler input  { display: none; }
#dark-toggler .icon  { position: absolute; width: 24px; height: 24px; transition: .4s; }
.icon-sun  { opacity: 1; }
.icon-moon { opacity: 0; transform: scale(0); }
.dark .icon-sun  { opacity: 0; transform: scale(0); }
.dark .icon-moon { opacity: 1; transform: scale(1); }
#dark-toggler:hover { transform: scale(1.15); }

/* =========================
   PULL TO REFRESH
========================= */
#pullIndicator {
  position: fixed;
  top: -90px; left: 0;
  width: 100%; height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--bg-body);
  z-index: 9999;
  transition: top .25s ease;
}
#pullImg  { width: 34px; height: 34px; }
#pullText { font-size: 13px; font-family: 'Nunito', sans-serif; font-weight: 700; color: var(--muted); }
#pullIndicator.loading #pullImg { animation: spin .8s linear infinite; }

/* =========================
   SKELETON
========================= */
.skeleton {
  position: relative;
  background: var(--sky2);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.skeleton::after {
  content: "";
  position: absolute;
  top: 0; left: -150px;
  width: 150px; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
  animation: shimmer 1.2s infinite;
}
.dark .skeleton { background: #1e3a52; }

/* =========================
   LIST UI
========================= */
.banner {
  width: 17.5rem; height: 12.5rem;
  margin-bottom: 2rem;
  object-fit: contain;
  transition: .3s;
}
.banner:hover { transform: scale(1.02); }

.list-items {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  width: 100%;
  padding: 16px 10px;
}
.list-items .item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 9.5em;
  padding: 1.1em .8em;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-main);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: .25s;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
}
.list-items .item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}
.icon {
  width: 3.4em; height: 3.4em;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: .8em;
}

/* =========================
   TOAST
========================= */
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 14px; font-weight: 700;
  font-family: 'Nunito', sans-serif;
  animation: pop .4s cubic-bezier(.34,1.56,.64,1);
}
.toast.success { background: #dcfce7; border: 2px solid #86efac; color: #166534; }
.toast.warning { background: #fef9c3; border: 2px solid #fde047; color: #854d0e; }
.toast.error   { background: #fee2e2; border: 2px solid #fca5a5; color: #991b1b; }

/* =========================
   CHIP / BADGE
========================= */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 800;
  font-family: 'Nunito', sans-serif;
  border: 2px solid;
}
.chip.done    { background: #dcfce7; border-color: #86efac; color: #166534; }
.chip.pending { background: #fef9c3; border-color: #fde047; color: #854d0e; }
.chip.reject  { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }
.chip.todo    { background: #f1f5f9; border-color: #cbd5e1; color: #475569; }

/* =========================
   BUTTONS
========================= */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--blue2), var(--blue));
  color: #fff;
  font-family: 'Fredoka One', cursive;
  font-size: 14px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: .2s;
  box-shadow: 0 4px 14px rgba(14,165,233,.3);
  text-decoration: none;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(14,165,233,.4); }
.btn:active { transform: scale(.97); }

.btn-green  { background: linear-gradient(135deg, #16a34a, var(--green)); box-shadow: 0 4px 14px rgba(34,197,94,.3); }
.btn-amber  { background: linear-gradient(135deg, #d97706, var(--amber)); box-shadow: 0 4px 14px rgba(245,158,11,.3); }
.btn-red    { background: linear-gradient(135deg, #dc2626, var(--red));   box-shadow: 0 4px 14px rgba(239,68,68,.3); }
.btn-purple { background: linear-gradient(135deg, #7c3aed, var(--purple)); box-shadow: 0 4px 14px rgba(139,92,246,.3); }

/* =========================
   CARD
========================= */
.card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

/* =========================
   FORM ELEMENTS
========================= */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 12px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  transition: .2s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(14,165,233,.15);
}
textarea { resize: vertical; min-height: 80px; }

/* =========================
   SECTION HEAD
========================= */
.sec-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
  font-family: 'Fredoka One', cursive;
  font-size: 18px;
  color: var(--text-main);
}

/* =========================
   BACK FLOAT BUTTON
========================= */
.back-float {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px;
  background: var(--bg-card);
  border: 2.5px solid var(--blue2);
  border-radius: 999px;
  text-decoration: none;
  color: var(--blue2);
  font-family: 'Fredoka One', cursive;
  font-size: 15px;
  box-shadow: 0 8px 24px rgba(14,165,233,.2);
  transition: .25s;
  z-index: 999;
}
.back-float:hover {
  background: var(--blue2); color: #fff;
  transform: translateX(-50%) translateY(-3px);
  box-shadow: 0 12px 32px rgba(14,165,233,.35);
}

/* =========================
   ANIMATIONS
========================= */
@keyframes fadeUp   { from{opacity:0;transform:translateY(20px);} to{opacity:1;transform:none;} }
@keyframes pop      { from{opacity:0;transform:scale(.9) translateY(-8px);} to{opacity:1;transform:none;} }
@keyframes float    { 0%,100%{transform:translateY(0);} 50%{transform:translateY(-6px);} }
@keyframes spin     { to{transform:rotate(360deg);} }
@keyframes spin-slow{ to{transform:rotate(360deg);} }
@keyframes shimmer  { 100%{left:100%;} }

.animate-fadeUp  { animation: fadeUp .5s ease both; }
.animate-fadeUp2 { animation: fadeUp .5s ease .1s both; }
.animate-fadeUp3 { animation: fadeUp .5s ease .2s both; }

/* =========================
   RESPONSIVE
========================= */
@media(max-width: 768px) {
  .navbar ul     { display: none; }
  .navbar-logo img { height: 25px; }
  .container     { padding: 60px 15px 0; }
  .banner        { width: 14rem; height: 10rem; }
  .list-items    { gap: 12px; }
  .list-items .item { width: 8em; }
}

@media(max-width: 420px) {
  .sec-head    { font-size: 16px; }
  .card        { border-radius: var(--radius-sm); }
}