/* ============================================================
   JORRII SPARK — Shared Design System
   "Think it. Make it. Spark it."
   ============================================================ */

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

:root {
  /* Brand */
  --spark-teal: #44D5DC;
  --spark-teal-light: #A7F0F4;
  --spark-teal-glow: rgba(68,213,220,0.15);
  --spark-sky: #7DD3FC;
  --spark-blue: #60A5FA;
  --spark-purple: #A78BFA;
  --spark-purple-deep: #7C3AED;
  --spark-pink: #F9A8D4;
  --spark-pink-deep: #EC4899;
  --spark-coral: #FDA4AF;
  --spark-yellow: #FCD34D;
  --spark-orange: #FDBA74;
  --spark-green: #86EFAC;

  /* UI */
  --bg: #F0FBFF;
  --card-bg: #FFFFFF;
  --card-shadow: 0 2px 16px rgba(0,0,0,0.06);
  --card-shadow-hover: 0 8px 32px rgba(0,0,0,0.1);
  --text-dark: #1E293B;
  --text-body: #475569;
  --text-muted: #94A3B8;

  /* Layout */
  --nav-height: 72px;
  --sidebar-width: 180px;

  /* Easing */
  --ease-bounce: cubic-bezier(0.34,1.56,0.64,1);
  --ease-smooth: cubic-bezier(0.4,0,0.2,1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Quicksand', sans-serif;
  background: linear-gradient(160deg, #0F2027 0%, #1A1640 40%, #2C1654 70%, #0F2027 100%);
  color: var(--text-body);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,h2,h3,h4,h5,h6 {
  font-family: 'Fredoka', sans-serif;
  color: var(--text-dark);
  line-height: 1.2;
}

img { max-width: 100%; height: auto; }
a { text-decoration: none; color: inherit; }
button { font-family: 'Fredoka', sans-serif; cursor: pointer; border: none; }

/* ============================================================
   TOP NAVIGATION BAR
   ============================================================ */
.spark-topnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--nav-height);
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 2px solid var(--spark-teal);
  box-shadow: 0 2px 16px rgba(68,213,220,0.25), 0 1px 0 rgba(68,213,220,0.6);
  padding: 0 20px;
}

.topnav-inner {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topnav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topnav-logo img {
  height: 56px;
  border-radius: 12px;
}

.topnav-logo span {
  font-family: 'Fredoka', sans-serif;
  font-size: 20px;
  font-weight: 600;
  background: linear-gradient(135deg, #44D5DC, #7DD3FC);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.topnav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.topnav-links a {
  padding: 6px 14px;
  border-radius: 100px;
  font-family: 'Fredoka', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-body);
  transition: all 0.2s var(--ease-smooth);
}

.topnav-links a:hover {
  background: var(--spark-teal-glow);
  color: var(--text-dark);
}

.topnav-links a.active {
  background: linear-gradient(135deg, #44D5DC, #7DD3FC);
  color: white;
}

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

.btn-pricing {
  padding: 6px 16px;
  border-radius: 100px;
  font-family: 'Fredoka', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--spark-purple-deep);
  background: rgba(167,139,250,0.1);
  border: 1.5px solid rgba(167,139,250,0.3);
  transition: all 0.25s var(--ease-bounce);
}

.btn-pricing:hover {
  background: rgba(167,139,250,0.18);
  transform: translateY(-1px);
}

.btn-signin {
  padding: 7px 18px;
  border-radius: 100px;
  font-family: 'Fredoka', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #44D5DC, #38BDF8);
  box-shadow: 0 2px 10px rgba(68,213,220,0.3);
  transition: all 0.25s var(--ease-bounce);
  display: inline-flex;
  align-items: center;
  border: none;
  cursor: pointer;
}

.btn-signin:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(68,213,220,0.4);
}

/* Signed-in state */
.btn-signout {
  padding: 7px 18px;
  border-radius: 100px;
  font-family: 'Fredoka', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: white;
  border: 1.5px solid #E2E8F0;
  display: none;
  cursor: pointer;
}

.btn-kid-pin {
  padding: 7px 16px;
  border-radius: 100px;
  font-family: 'Fredoka', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #A78BFA, #7C3AED);
  box-shadow: 0 2px 10px rgba(167,139,250,0.3);
  transition: all 0.25s var(--ease-bounce);
  display: inline-flex;
  align-items: center;
  border: none;
  cursor: pointer;
}

.btn-kid-pin:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(167,139,250,0.4);
}

.spark-user-name {
  font-family: 'Fredoka', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--spark-teal);
}

/* Hamburger */
.topnav-hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 26px;
  color: var(--text-dark);
  cursor: pointer;
  padding: 4px;
}

/* ============================================================
   LEFT SIDEBAR
   ============================================================ */
.spark-sidebar {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #4A8FE7, #C27DEB);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 2px solid var(--spark-teal);
  box-shadow: 2px 0 24px rgba(68,213,220,0.25), inset -1px 0 0 rgba(68,213,220,0.4);
  padding: 16px 10px;
  z-index: 150;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-label {
  font-family: 'Fredoka', sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: rgba(10,47,58,0.6);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 8px 10px 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  font-family: 'Fredoka', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #0D3B4A;
  transition: all 0.2s var(--ease-smooth);
  border: 2px solid transparent;
}

.sidebar-link:hover {
  background: rgba(68,213,220,0.1);
  color: #0A2F3A;
  transform: translateX(3px);
}

.sidebar-link.active {
  background: linear-gradient(135deg, rgba(68,213,220,0.15), rgba(167,139,250,0.12));
  color: #083040;
  border-color: rgba(68,213,220,0.3);
  box-shadow: 0 0 12px rgba(68,213,220,0.1);
}

.sidebar-link .sidebar-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
  overflow: hidden;
}

.sidebar-link .sidebar-icon img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 8px;
}

/* Subtle color glow per link on hover */
.sidebar-link[data-tool="picture"]:hover { box-shadow: 0 0 16px rgba(68,213,220,0.15); }
.sidebar-link[data-tool="video"]:hover { box-shadow: 0 0 16px rgba(167,139,250,0.15); }
.sidebar-link[data-tool="music"]:hover { box-shadow: 0 0 16px rgba(249,168,212,0.15); }
.sidebar-link[data-tool="sounds"]:hover { box-shadow: 0 0 16px rgba(253,186,116,0.15); }
.sidebar-link[data-tool="studio"]:hover { box-shadow: 0 0 16px rgba(96,165,250,0.15); }
.sidebar-link[data-tool="gallery"]:hover { box-shadow: 0 0 16px rgba(134,239,172,0.15); }

/* ============================================================
   MAIN CONTENT AREA — offset for nav + sidebar
   ============================================================ */
.spark-main {
  margin-top: var(--nav-height);
  margin-left: var(--sidebar-width);
  min-height: calc(100vh - var(--nav-height));
}

/* ============================================================
   MOBILE MENU OVERLAY
   ============================================================ */
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  z-index: 190;
  padding: 20px;
  overflow-y: auto;
  flex-direction: column;
  gap: 4px;
}

.mobile-menu.open { display: flex; }

.mobile-menu .mobile-section {
  font-family: 'Fredoka', sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 12px 8px 4px;
}

.mobile-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  font-family: 'Fredoka', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-dark);
  transition: background 0.2s;
}

.mobile-menu a:hover { background: rgba(68,213,220,0.06); }
.mobile-menu a .sidebar-icon { font-size: 20px; }

.mobile-menu .mobile-auth {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid #F1F5F9;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ============================================================
   SHARED BUTTONS
   ============================================================ */
.btn-spark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 100px;
  font-family: 'Fredoka', sans-serif;
  font-size: 16px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.3s var(--ease-bounce);
}

.btn-spark:hover { transform: translateY(-2px); }
.btn-spark:active { transform: translateY(0) scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, #44D5DC, #7DD3FC);
  color: white;
  box-shadow: 0 3px 16px rgba(68,213,220,0.3);
}

.btn-primary:hover { box-shadow: 0 6px 24px rgba(68,213,220,0.45); }

/* ============================================================
   SECTION HELPERS
   ============================================================ */
.section-label {
  text-align: center;
  margin-bottom: 20px;
}

.section-label h2 {
  font-family: 'Fredoka', sans-serif;
  font-size: 24px;
  margin-bottom: 4px;
}

.section-label p {
  font-size: 14px;
  color: var(--text-muted);
}

/* ============================================================
   FOOTER
   ============================================================ */
.spark-footer {
  background: #7C3AED;
  border-top: none;
  box-shadow: none;
  color: rgba(255,255,255,0.8);
  padding: 28px 20px 14px;
  margin-left: var(--sidebar-width);
}

.spark-footer-inner {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 20px;
}

.spark-footer-brand img {
  height: 36px;
  border-radius: 8px;
  margin-bottom: 8px;
}

.spark-footer-brand p {
  font-size: 12px;
  line-height: 1.5;
  max-width: 220px;
  color: rgba(255,255,255,0.7);
}

.spark-footer h4 {
  font-family: 'Fredoka', sans-serif;
  color: white;
  font-size: 13px;
  margin-bottom: 6px;
}

.spark-footer a {
  display: block;
  padding: 2px 0;
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  transition: color 0.2s;
}

.spark-footer a:hover { color: white; }

.spark-footer-bottom {
  max-width: 900px;
  margin: 14px auto 0;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.15);
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes float {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes march {
  0% { background-position: 0 0; }
  100% { background-position: 28px 0; }
}

@keyframes sparkle-reveal {
  0% { opacity: 0; transform: scale(0.85); filter: blur(6px) brightness(1.4); }
  60% { opacity: 1; transform: scale(1.02); filter: blur(0) brightness(1.1); }
  100% { transform: scale(1); filter: brightness(1); }
}

@keyframes bounce-dot {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .spark-sidebar { display: none; }
  .spark-main { margin-left: 0; }
  .spark-footer { margin-left: 0; }
  .topnav-links { display: none; }
  .topnav-right .btn-pricing,
  .topnav-right .btn-signin,
  .topnav-right .btn-kid-pin,
  .topnav-right .btn-signout,
  .topnav-right .spark-user-name { display: none; }
  .topnav-hamburger { display: block; }
  .spark-footer-inner { grid-template-columns: 1fr 1fr; }
  .spark-footer-bottom { flex-direction: column; gap: 4px; text-align: center; }
}

@media (max-width: 480px) {
  .spark-footer-inner { grid-template-columns: 1fr; }
}
