/* ===================================
   SHARED.CSS — Global Design System
   Mohammed Junaid Digital Marketing
=================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --neon-purple: #a78bfa;
  --neon-blue: #60a5fa;
  --neon-pink: #f472b6;
  --neon-cyan: #22d3ee;
  /* Professional navy-slate backgrounds */
  --bg-dark: #0b0f1e;          /* deep navy — main page bg */
  --bg-surface: #111827;       /* slightly lighter — sections */
  --bg-card: rgba(255,255,255,0.07);  /* card fill */
  --border-glass: rgba(255,255,255,0.12); /* more visible borders */
  /* Text — warmer & higher contrast */
  --text-primary: #f0f4ff;
  --text-muted: #9baac8;
  --gradient-primary: linear-gradient(135deg, #a78bfa 0%, #60a5fa 50%, #f472b6 100%);
  --gradient-glow: linear-gradient(135deg, rgba(167,139,250,0.18), rgba(96,165,250,0.18));
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Poppins', 'Inter', sans-serif;
  /* Subtle gradient so it doesn't look flat-black */
  background: linear-gradient(160deg, #0b0f1e 0%, #0d1428 50%, #0b1020 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  overflow-x: hidden;
  min-height: 100vh;
}

/* ── Scrollbar ─────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: #0d1428; }
::-webkit-scrollbar-thumb { background: var(--neon-purple); border-radius: 99px; }

/* ── Selection ─────────────────────────── */
::selection { background: rgba(168,85,247,0.35); color: #fff; }

/* ── Page Loader ───────────────────────── */
#page-loader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg-dark);
  display: flex; align-items: center; justify-content: center;
}
.loader-ring {
  width: 56px; height: 56px;
  border: 3px solid rgba(168,85,247,0.2);
  border-top-color: var(--neon-purple);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Transition Overlay ─────────────────── */
#transition-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: var(--gradient-primary);
  transform-origin: left;
  transform: scaleX(0);
  pointer-events: none;
}
#transition-overlay.hidden { display: none; }

/* ── Cursor Glow & Custom Cursor ───────── */
#cursor-glow {
  position: fixed; top: 0; left: 0; z-index: 1;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168,85,247,0.12) 0%, transparent 70%);
  pointer-events: none;
  transition: opacity 0.3s;
}

.hide-default-cursor, .hide-default-cursor * { cursor: none !important; }

#custom-cursor-dot {
  position: fixed; top: 0; left: 0; z-index: 9999;
  width: 8px; height: 8px;
  background: var(--neon-purple);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, background-color 0.2s;
  box-shadow: 0 0 10px rgba(168,85,247,0.6);
}

#custom-cursor-ring {
  position: fixed; top: 0; left: 0; z-index: 9998;
  width: 40px; height: 40px;
  border: 1.5px solid rgba(168,85,247,0.5);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, border-color 0.2s, background-color 0.2s;
  box-shadow: 0 0 15px rgba(168,85,247,0.15);
}

#custom-cursor-dot.hovered {
  width: 12px; height: 12px;
  background: var(--neon-cyan);
}

#custom-cursor-ring.hovered {
  width: 60px; height: 60px;
  border-color: rgba(34,211,238,0.6);
  background: rgba(34,211,238,0.05);
}

/* ── Navbar ──────────────────────────────── */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 800;
  background: rgba(11,15,30,0.75);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  transition: padding 0.3s, background 0.3s;
}
#navbar.scrolled { background: rgba(11,15,30,0.96); }

.nav-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem;
}
.nav-logo {
  font-size: 1.4rem; font-weight: 800; letter-spacing: -0.5px;
  background: var(--gradient-primary);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  position: relative;
  cursor: pointer;
  white-space: nowrap;
}

.nav-logo .logo-short {
  display: inline-block;
  opacity: 1;
  max-width: 50px;
  overflow: hidden;
  transition: max-width 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
  white-space: nowrap;
}

.nav-logo .logo-full {
  display: inline-block;
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  transition: max-width 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease 0.05s;
  white-space: nowrap;
}

.nav-logo:hover .logo-short {
  opacity: 0;
  max-width: 0;
}

.nav-logo:hover .logo-full {
  opacity: 1;
  max-width: 240px;
}
.nav-links { display: flex; align-items: center; gap: 0.25rem; }
.nav-link {
  padding: 0.4rem 0.75rem; border-radius: 8px;
  font-size: 0.8rem; font-weight: 500; color: var(--text-muted);
  text-decoration: none;
  transition: color 0.25s, background 0.25s;
  position: relative;
}
.nav-link::after {
  content: ''; position: absolute; bottom: -2px; left: 50%; right: 50%;
  height: 2px; background: var(--gradient-primary); border-radius: 99px;
  transition: left 0.3s, right 0.3s;
}
.nav-link:hover::after, .active-nav::after { left: 10%; right: 10%; }
.nav-link:hover, .active-nav {
  color: #fff;
  background: rgba(168,85,247,0.1);
}
.active-nav { color: var(--neon-purple) !important; }


/* hamburger — hidden on desktop, shown on mobile */
#hamburger {
  display: none; flex-direction: column; gap: 5px;
  cursor: pointer; padding: 4px; background: none; border: none;
}
#hamburger span {
  display: block; width: 24px; height: 2px;
  background: var(--text-primary); border-radius: 99px;
  transition: transform 0.3s, opacity 0.3s;
}
#hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#hamburger.open span:nth-child(2) { opacity: 0; }
#hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* mobile menu — HIDDEN by default on ALL screen sizes */
#mobile-menu {
  display: none;          /* hidden by default */
  flex-direction: column;
  gap: 0.25rem;
  border-top: 1px solid var(--border-glass);
  padding: 0.75rem 1.5rem 1rem;
  background: rgba(2,2,8,0.97);
}
/* Show only when JS adds .menu-open */
#mobile-menu.menu-open {
  display: flex;
}
#mobile-menu .nav-link { display: block; padding: 0.6rem 0.75rem; font-size: 0.875rem; }

@media(max-width:768px) {
  .nav-links { display: none; }
  #hamburger { display: flex; }
}

/* ── Footer ──────────────────────────────── */
#site-footer {
  background: #080d1c;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 3.5rem 1.5rem 2rem;
}
.footer-inner {
  max-width: 1280px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 3rem;
}
.footer-brand p { font-size: 0.875rem; color: var(--text-muted); line-height: 1.7; margin-top: 0.75rem; }
.footer-heading { font-size: 0.75rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--neon-purple); margin-bottom: 1rem; }
.footer-links { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-links a { font-size: 0.875rem; color: var(--text-muted); text-decoration: none; transition: color 0.25s; }
.footer-links a:hover { color: #fff; }
.footer-social { display: flex; gap: 0.75rem; margin-top: 1rem; }
.social-btn {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--bg-card); border: 1px solid var(--border-glass);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); text-decoration: none; font-size: 1rem;
  transition: background 0.3s, color 0.3s, border-color 0.3s, transform 0.2s;
}
.social-btn:hover {
  background: rgba(168,85,247,0.15); color: var(--neon-purple);
  border-color: rgba(168,85,247,0.4); transform: translateY(-2px);
}
.footer-bottom {
  max-width: 1280px; margin: 2.5rem auto 0;
  padding-top: 1.5rem; border-top: 1px solid var(--border-glass);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.8rem; color: var(--text-muted);
}
.footer-bottom span { background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
@media(max-width:768px) {
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .footer-brand { grid-column: 1/-1; }
  .footer-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }
}
@media(max-width:480px) {
  .footer-inner { grid-template-columns: 1fr; }
}

/* ── Sticky CTA ──────────────────────────── */
#sticky-cta {
  position: fixed; bottom: -80px; right: 2rem; z-index: 700;
  background: var(--gradient-primary);
  color: #fff; font-weight: 700; font-size: 0.8rem;
  padding: 0.75rem 1.25rem; border-radius: 50px;
  box-shadow: 0 8px 32px rgba(168,85,247,0.4);
  text-decoration: none;
  transition: bottom 0.4s cubic-bezier(0.34,1.56,0.64,1), transform 0.2s, opacity 0.4s;
  display: flex; align-items: center; gap: 0.5rem;
  opacity: 0;
}
#sticky-cta.visible { bottom: 2rem; opacity: 1; }
#sticky-cta.hide { bottom: -80px; opacity: 0; }
#sticky-cta:hover { transform: scale(1.05); }

/* ── Glassmorphism Card ───────────────────── */
.glass-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.13);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.25);
}

/* ── Gradient text ───────────────────────── */
.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Section wrapper ─────────────────────── */
.section-wrap { max-width: 1280px; margin: 0 auto; padding: 0 1.25rem; }
@media (min-width: 640px) { .section-wrap { padding: 0 2rem; } }

/* ── Reveal animation class ──────────────── */
.reveal { opacity: 0; }

/* ── Neon glow on hover ──────────────────── */
.glow-hover {
  transition: box-shadow 0.3s;
}
.glow-hover:hover {
  box-shadow: 0 0 24px rgba(168,85,247,0.5), 0 0 60px rgba(168,85,247,0.15);
}

/* ── Animated gradient border ────────────── */
.grad-border {
  position: relative;
}
.grad-border::before {
  content: '';
  position: absolute; inset: -1px;
  border-radius: inherit;
  background: var(--gradient-primary);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s;
}
.grad-border:hover::before { opacity: 1; }

/* ── Tag pill ─────────────────────────────── */
.tag {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.25rem 0.75rem; border-radius: 99px;
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.5px;
  border: 1px solid var(--border-glass);
  color: var(--neon-purple);
  background: rgba(168,85,247,0.08);
}

/* ── CTA Buttons ──────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.8rem 2rem; border-radius: 50px;
  background: var(--gradient-primary);
  color: #fff; font-weight: 700; font-size: 0.9rem;
  text-decoration: none; border: none; cursor: pointer;
  box-shadow: 0 4px 24px rgba(168,85,247,0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(168,85,247,0.55);
}

.btn-outline {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.8rem 2rem; border-radius: 50px;
  background: transparent;
  color: #fff; font-weight: 600; font-size: 0.9rem;
  text-decoration: none; cursor: pointer;
  border: 1px solid rgba(255,255,255,0.2);
  transition: background 0.25s, border-color 0.25s, transform 0.2s;
}
.btn-outline:hover {
  background: rgba(255,255,255,0.07);
  border-color: var(--neon-purple);
  transform: translateY(-2px);
}

/* ── Page hero padding ────────────────────── */
.page-hero { padding-top: 6rem; }

/* ── Section title ───────────────────────── */
.section-tag { font-size: 0.7rem; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; color: var(--neon-purple); margin-bottom: 0.5rem; display: block; }
.section-title { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; line-height: 1.15; color: #f0f4ff; }
.section-sub { color: var(--text-muted); font-size: 1rem; line-height: 1.7; max-width: 560px; }

/* ── Alternating section bg for visual depth ── */
/* Use on <section> elements to break up flat dark */
.section-alt {
  background: rgba(255,255,255,0.025);
  border-top: 1px solid rgba(255,255,255,0.07);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

/* ── Better paragraph readability ────────── */
p, li { line-height: 1.75; }

/* ── Animated BG particles canvas ────────── */
#bg-canvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* ── Improved chart card readability ─────── */
.chart-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  padding: 1.5rem;
}

/* ── Inline dark-bg override for sections ── */
/* ensures inline style="background:..." are still readable */
[style*="padding:5rem 0"] { position: relative; }
[style*="padding:4rem 0"] { position: relative; }
[style*="padding:3rem 0"] { position: relative; }

/* ═══════════════════════════════════════════
   RESPONSIVE — Mobile First Fixes
═══════════════════════════════════════════ */

/* ── Hero two-column → single column on mobile ── */
.responsive-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 4rem;
  align-items: center;
}
@media (max-width: 900px) {
  .responsive-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  /* Move the profile image BELOW text on mobile */
  .hero-image-wrap {
    order: -1;  /* show image above title on small phones */
    max-width: 260px;
    margin: 0 auto;
  }
}
@media (max-width: 640px) {
  .hero-image-wrap {
    max-width: 200px;
  }
}

/* ── Hero section: proper padding & height on mobile ── */
@media (max-width: 768px) {
  .hero-section {
    min-height: auto !important;
    padding-top: 4.5rem !important;
    padding-bottom: 2rem !important;
    padding-left: 0;
    padding-right: 0;
    margin: 0 !important;
  }
  .hero-section .section-wrap {
    padding: 0.5rem 1.25rem 1.5rem !important;
  }
  .page-hero {
    padding-top: 4.5rem !important;
    padding-bottom: 2rem !important;
  }
  .hero-stats-row {
    margin-top: 1.5rem !important;
    gap: 1.5rem !important;
  }
}

/* ── Hero title & spacing on smallest phones ── */
@media (max-width: 480px) {
  #hero-title {
    font-size: clamp(1.8rem, 8vw, 2.8rem) !important;
    line-height: 1.12 !important;
    margin-bottom: 0.85rem !important;
  }
  .hero-section {
    padding-top: 4.25rem !important;
    padding-bottom: 1.25rem !important;
  }
  .floating-badge {
    margin-bottom: 0.85rem !important;
  }
  #typing-wrap {
    margin-bottom: 1.25rem !important;
    min-height: auto !important;
  }
}

/* ── Floating badge: wraps cleanly ── */
.floating-badge {
  flex-wrap: wrap;
  max-width: 100%;
}

/* ── Buttons row: wrap on small screens ── */
@media (max-width: 480px) {
  .btn-primary, .btn-outline {
    width: 100%;
    justify-content: center;
    padding: 0.9rem 1.5rem;
  }
}

/* ── Stats strip below hero ── */
@media (max-width: 480px) {
  /* Divider lines disappear when stacked */
  [style*="width:1px;background:var(--border-glass)"] {
    display: none;
  }
}

/* ── Dashboard charts: stack on mobile ── */
@media (max-width: 768px) {
  /* Line + pie charts side by side → vertical */
  [style*="grid-template-columns:2fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  /* Reduce chart height to prevent overflow */
  #trafficChart { max-height: 200px; }
  #sourcePie    { max-height: 200px; }
  #campaignBar  { max-height: 200px; }
}

/* ── Services grid: min-width fallback ── */
@media (max-width: 480px) {
  [style*="minmax(260px,1fr)"] {
    grid-template-columns: 1fr !important;
  }
}

/* ── CTA Banner: padding on mobile ── */
@media (max-width: 480px) {
  [style*="padding:4rem 2.5rem"] {
    padding: 2rem 1.25rem !important;
  }
}

/* ── Sticky CTA: move further from edge on narrow phones ── */
@media (max-width: 480px) {
  #sticky-cta {
    right: 1rem;
    bottom: -80px;
    font-size: 0.75rem;
    padding: 0.65rem 1rem;
  }
  #sticky-cta.visible { bottom: 1rem; }
}

/* ── Profile card: constrain on tablet ── */
@media (max-width: 900px) {
  .profile-card {
    max-width: 280px !important;
    margin: 0 auto;
  }
}

/* ── Global overflow guard ── */
section, main, footer, header {
  max-width: 100%;
  overflow-x: hidden;
}

/* ── Mobile section padding compaction ── */
@media (max-width: 768px) {
  [style*="padding:5rem 0"] {
    padding: 2.5rem 0 !important;
  }
  [style*="padding:4rem 0"] {
    padding: 2rem 0 !important;
  }
  [style*="padding:3rem 0"] {
    padding: 1.5rem 0 !important;
  }
}

/* ── Collapse ALL remaining 2-col inline grids on mobile ── */
@media (max-width: 768px) {
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns:1.1fr 1fr"],
  [style*="grid-template-columns:1fr 1.1fr"] {
    grid-template-columns: 1fr !important;
  }
  [style*="gap:4rem"] {
    gap: 2rem !important;
  }
  [style*="gap:3rem"] {
    gap: 1.5rem !important;
  }
}
}
