/* ==========================================================================
   Chhimwal.com — Shared Site Header & Footer
   Self-contained, scoped styles (cw- prefix) so this renders identically
   whether or not a page also loads Tailwind or its own custom CSS.
   ========================================================================== */

.cw-header {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0b1220 0%, #111827 55%, #1f2937 100%);
  color: #f3f4f6;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

/* Particle layer */
.cw-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.cw-particle {
  position: absolute;
  bottom: -12px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.95) 0%, rgba(251, 191, 36, 0.15) 55%, rgba(251, 191, 36, 0) 75%);
  box-shadow: 0 0 6px 1px rgba(251, 191, 36, 0.6);
  animation-name: cw-rise;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform, opacity;
}

@keyframes cw-rise {
  0%   { transform: translateY(0) scale(0.6); opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 0.75; }
  100% { transform: translateY(-150px) scale(1.1); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .cw-particle { animation: none; opacity: 0; }
}

/* Header inner layout */
.cw-header-inner {
  position: relative;
  z-index: 2;
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cw-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fbbf24;
  text-decoration: none;
  white-space: nowrap;
}
.cw-logo:hover { color: #fcd34d; }
.cw-logo-icon { font-size: 1.5rem; }
.cw-logo-dot { color: #f3f4f6; font-weight: 700; }

.cw-nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #f3f4f6;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0.4rem 0.65rem;
  border-radius: 0.4rem;
  cursor: pointer;
}

.cw-nav-list {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.cw-nav-list a {
  color: #e5e7eb;
  text-decoration: none;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.cw-nav-list a:hover,
.cw-nav-list a.cw-active {
  color: #fbbf24;
  border-bottom-color: #fbbf24;
}

/* Mobile nav */
@media (max-width: 820px) {
  .cw-nav-toggle { display: inline-block; }

  .cw-nav-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: #111827;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }

  .cw-nav-list.cw-open {
    max-height: 400px;
  }

  .cw-nav-list li { width: 100%; }

  .cw-nav-list a {
    display: block;
    width: 100%;
    padding: 0.9rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    border-left: 3px solid transparent;
  }

  .cw-nav-list a:hover,
  .cw-nav-list a.cw-active {
    border-bottom-color: rgba(255, 255, 255, 0.06);
    border-left-color: #fbbf24;
    background: rgba(251, 191, 36, 0.08);
  }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.cw-footer {
  background: #0b1220;
  color: #d1d5db;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  margin-top: 2rem;
}

.cw-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2rem;
}

@media (max-width: 900px) {
  .cw-footer-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 520px) {
  .cw-footer-inner {
    grid-template-columns: 1fr;
    padding: 2.5rem 1.25rem 1.5rem;
  }
}

.cw-footer-col h4 {
  color: #fbbf24;
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cw-footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.cw-footer-col a {
  color: #d1d5db;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}
.cw-footer-col a:hover { color: #fbbf24; }

.cw-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  padding: 1.25rem 1.5rem;
  font-size: 0.85rem;
  color: #9ca3af;
}

.cw-footer-bottom a { color: #fbbf24; text-decoration: none; }
.cw-footer-bottom a:hover { text-decoration: underline; }

/* ==========================================================================
   PWA Install button + iOS "Add to Home Screen" modal
   ========================================================================== */
#cw-install-btn {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.15rem;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0b1220;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  border: none;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45), 0 2px 6px rgba(0,0,0,0.25);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
#cw-install-btn.cw-show { display: inline-flex; animation: cw-install-pop 0.35s ease; }
#cw-install-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(245, 158, 11, 0.55), 0 3px 8px rgba(0,0,0,0.3); }
#cw-install-btn:active { transform: translateY(0); }
.cw-install-ico { font-size: 1.05rem; line-height: 1; }

@keyframes cw-install-pop {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@media (max-width: 520px) {
  #cw-install-btn { right: 12px; bottom: 12px; padding: 0.65rem 1rem; font-size: 0.9rem; }
}
@media (prefers-reduced-motion: reduce) {
  #cw-install-btn.cw-show { animation: none; }
  #cw-install-btn:hover { transform: none; }
}

#cw-ios-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(11, 18, 32, 0.6);
  backdrop-filter: blur(3px);
}
#cw-ios-modal.cw-open { display: flex; }
.cw-ios-card {
  position: relative;
  max-width: 400px;
  width: 100%;
  background: #ffffff;
  color: #111827;
  border-radius: 1rem;
  padding: 1.75rem 1.5rem 1.5rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}
.cw-ios-card h3 { margin: 0 0 0.6rem; font-size: 1.25rem; color: #0b1220; }
.cw-ios-card p { margin: 0 0 0.9rem; font-size: 0.95rem; line-height: 1.5; color: #374151; }
.cw-ios-card ol { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 0.55rem; font-size: 0.92rem; line-height: 1.45; color: #374151; }
.cw-ios-card strong { color: #0b1220; }
.cw-ios-close {
  position: absolute;
  top: 0.6rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: #9ca3af;
  cursor: pointer;
}
.cw-ios-close:hover { color: #111827; }
