/* ====================================================
   TemplateZone — Master Stylesheet
   Sky-blue gradient theme · Dark mode · Mobile-app UI
   ==================================================== */

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

:root {
  --sky-50:  #f0f9ff;
  --sky-100: #e0f2fe;
  --sky-200: #bae6fd;
  --sky-300: #7dd3fc;
  --sky-400: #38bdf8;
  --sky-500: #0ea5e9;
  --sky-600: #0284c7;
  --sky-700: #0369a1;

  --bg:        #f8fbff;
  --bg-soft:   #eaf4ff;
  --surface:   #ffffff;
  --text:      #0a1628;
  --text-soft: #475569;
  --border:    #dbeafe;

  --grad: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 50%, #7dd3fc 100%);
  --grad-dark: linear-gradient(135deg, #0c4a6e 0%, #0369a1 50%, #0284c7 100%);
  --shadow: 0 10px 40px -10px rgba(14,165,233,.25);
  --shadow-lg: 0 25px 70px -15px rgba(14,165,233,.35);

  --radius: 16px;
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Space Grotesk', sans-serif;
}

[data-theme="dark"] {
  --bg:        #060b18;
  --bg-soft:   #0a1628;
  --surface:   #0f1e3d;
  --text:      #e0f2fe;
  --text-soft: #94a3b8;
  --border:    #1e3a5f;
  --shadow: 0 10px 40px -10px rgba(56,189,248,.15);
  --shadow-lg: 0 25px 70px -15px rgba(56,189,248,.25);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background .4s, color .4s;
}

h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.02em; }

a { color: var(--sky-600); text-decoration: none; }
[data-theme="dark"] a { color: var(--sky-400); }

img { max-width: 100%; display: block; }

/* ---------- Particles canvas ---------- */
#particles {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
}

/* ---------- Container ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ---------- Navbar ---------- */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.75);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
[data-theme="dark"] .navbar { background: rgba(10,22,40,.75); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.logo {
  font-family: var(--font-display); font-size: 1.6rem; font-weight: 800;
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex; align-items: center; gap: 8px;
}
.logo i { -webkit-text-fill-color: var(--sky-500); animation: spin 8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a {
  color: var(--text); font-weight: 500; font-size: .95rem;
  position: relative; transition: color .2s;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -6px; left: 0; width: 0; height: 2px;
  background: var(--grad); transition: width .3s;
}
.nav-links a:hover { color: var(--sky-500); }
.nav-links a:hover::after { width: 100%; }

.nav-actions { display: flex; gap: 10px; align-items: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: 12px; border: none;
  font-family: var(--font-body); font-weight: 600; font-size: .95rem;
  cursor: pointer; text-decoration: none;
  transition: all .25s cubic-bezier(.4,0,.2,1);
  position: relative; overflow: hidden;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-primary::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.3), transparent);
  transform: translateX(-100%);
}
.btn-primary:hover::before { transform: translateX(100%); transition: transform .8s; }
.btn-ghost {
  background: transparent; color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { border-color: var(--sky-400); color: var(--sky-500); }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Theme toggle ---------- */
.theme-toggle {
  width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--border);
  background: var(--surface); cursor: pointer; color: var(--text);
  display: flex; align-items: center; justify-content: center;
  transition: all .3s;
}
.theme-toggle:hover { transform: rotate(180deg); border-color: var(--sky-400); color: var(--sky-500); }

/* ---------- Hero ---------- */
.hero {
  padding: 80px 0 100px; text-align: center; position: relative;
}
.hero::before {
  content: ''; position: absolute; top: -100px; left: 50%;
  transform: translateX(-50%); width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(56,189,248,.18), transparent 60%);
  z-index: -1; pointer-events: none;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 18px; border-radius: 100px;
  background: var(--bg-soft); border: 1px solid var(--border);
  color: var(--sky-600); font-weight: 500; font-size: .85rem;
  margin-bottom: 24px; animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 4.5rem); line-height: 1.1;
  margin-bottom: 22px;
}
.hero h1 .grad {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  font-size: clamp(1rem, 1.5vw, 1.2rem); color: var(--text-soft);
  max-width: 640px; margin: 0 auto 36px;
}
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Stats ---------- */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
  margin-top: 70px; padding: 30px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.stat { text-align: center; }
.stat-num {
  font-family: var(--font-display); font-size: 2.2rem; font-weight: 800;
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-label { color: var(--text-soft); font-size: .9rem; }

/* ---------- Sections ---------- */
.section { padding: 80px 0; }
.section-head { text-align: center; margin-bottom: 50px; }
.section-head h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); margin-bottom: 12px; }
.section-head p { color: var(--text-soft); }

/* ---------- Category pills ---------- */
.cat-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px;
}
.cat-card {
  background: var(--surface); border: 1px solid var(--border);
  padding: 28px 18px; border-radius: var(--radius); text-align: center;
  transition: all .3s; cursor: pointer; position: relative; overflow: hidden;
}
.cat-card::before {
  content: ''; position: absolute; inset: 0; background: var(--grad);
  opacity: 0; transition: opacity .3s;
}
.cat-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--sky-400); }
.cat-card i {
  font-size: 2.2rem; color: var(--sky-500); margin-bottom: 12px;
  display: block; transition: transform .3s;
}
.cat-card:hover i { transform: scale(1.15); }
.cat-card h4 { font-size: 1rem; }

/* ---------- Product grid ---------- */
.product-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.product-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: all .35s cubic-bezier(.4,0,.2,1);
}
.product-card:hover {
  transform: translateY(-8px); box-shadow: var(--shadow-lg);
  border-color: var(--sky-300);
}
.product-thumb {
  height: 180px; background: var(--grad); position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 2.4rem;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-tag {
  position: absolute; top: 12px; right: 12px;
  background: rgba(255,255,255,.95); color: var(--sky-600);
  padding: 4px 12px; border-radius: 100px; font-size: .75rem; font-weight: 600;
}
.product-body { padding: 20px; }
.product-cat { color: var(--sky-500); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.product-title { font-size: 1.1rem; margin: 6px 0 10px; color: var(--text); }
.product-desc { font-size: .88rem; color: var(--text-soft); margin-bottom: 16px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-foot { display: flex; justify-content: space-between; align-items: center; }
.product-price {
  font-family: var(--font-display); font-size: 1.4rem; font-weight: 800;
  color: var(--sky-600);
}
[data-theme="dark"] .product-price { color: var(--sky-400); }

/* ---------- Forms ---------- */
.form-wrap {
  max-width: 440px; margin: 60px auto; padding: 40px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; box-shadow: var(--shadow-lg);
}
.form-wrap h2 { text-align: center; margin-bottom: 8px; }
.form-wrap .sub { text-align: center; color: var(--text-soft); margin-bottom: 28px; font-size: .92rem; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 13px 16px; border-radius: 12px;
  border: 1.5px solid var(--border); background: var(--bg);
  color: var(--text); font-family: var(--font-body); font-size: .95rem;
  transition: all .25s;
}
.form-control:focus {
  outline: none; border-color: var(--sky-400);
  box-shadow: 0 0 0 4px rgba(56,189,248,.12);
}
textarea.form-control { resize: vertical; min-height: 100px; }

.alert { padding: 14px 18px; border-radius: 12px; margin-bottom: 20px; font-size: .9rem; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-info { background: var(--bg-soft); color: var(--sky-700); border: 1px solid var(--border); }

/* ---------- Footer ---------- */
footer {
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 50px 0 30px; margin-top: 80px;
}
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 30px; }
.foot-grid h5 { font-family: var(--font-display); margin-bottom: 14px; color: var(--text); }
.foot-grid a { display: block; color: var(--text-soft); margin-bottom: 8px; font-size: .9rem; }
.foot-grid a:hover { color: var(--sky-500); }
.foot-bot { text-align: center; padding-top: 24px; border-top: 1px solid var(--border); color: var(--text-soft); font-size: .85rem; }

/* ---------- Mobile bottom nav (mobile-app feel) ---------- */
.mobile-nav { display: none; }

/* ---------- Mobile responsive ---------- */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .hero { padding: 50px 0 80px; }
  .form-wrap { margin: 30px 16px; padding: 30px 24px; }

  body { padding-bottom: 80px; }

  .mobile-nav {
    display: flex; position: fixed; bottom: 14px; left: 14px; right: 14px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 22px; padding: 10px;
    box-shadow: 0 20px 50px rgba(14,165,233,.25);
    backdrop-filter: blur(20px); z-index: 99;
    justify-content: space-around;
  }
  .mobile-nav a {
    flex: 1; text-align: center; padding: 8px 4px;
    color: var(--text-soft); font-size: .7rem; font-weight: 600;
    border-radius: 14px; transition: all .25s;
  }
  .mobile-nav a i { display: block; font-size: 1.3rem; margin-bottom: 3px; }
  .mobile-nav a.active {
    background: var(--grad); color: #fff;
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(14,165,233,.4);
  }
}

/* ---------- Animations ---------- */
.fade-up { opacity: 0; transform: translateY(30px); animation: fadeUp .8s forwards; }
.fade-up.d1 { animation-delay: .15s; }
.fade-up.d2 { animation-delay: .3s; }
.fade-up.d3 { animation-delay: .45s; }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

/* ---------- Dashboard layout ---------- */
.dash {
  display: grid; grid-template-columns: 260px 1fr; min-height: 100vh;
}
.sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 30px 20px;
}
.sidebar .logo { margin-bottom: 30px; }
.sidebar a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 12px; color: var(--text-soft);
  margin-bottom: 6px; font-weight: 500; transition: all .2s;
}
.sidebar a:hover, .sidebar a.active {
  background: var(--bg-soft); color: var(--sky-600);
}
[data-theme="dark"] .sidebar a:hover, [data-theme="dark"] .sidebar a.active { color: var(--sky-300); }
.dash-main { padding: 30px 40px; }
.dash-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.dash-head h1 { font-size: 1.8rem; }

.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 30px; }
.card-stat {
  background: var(--surface); border: 1px solid var(--border);
  padding: 24px; border-radius: 16px; transition: all .3s;
}
.card-stat:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-stat .icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; margin-bottom: 14px;
}
.card-stat h3 { font-size: 1.8rem; margin-bottom: 4px; }
.card-stat p { color: var(--text-soft); font-size: .85rem; }

.table-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; overflow: hidden;
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--border); font-size: .9rem; }
th { background: var(--bg-soft); font-weight: 600; color: var(--text); }
tr:last-child td { border-bottom: none; }
.badge { padding: 4px 10px; border-radius: 100px; font-size: .75rem; font-weight: 600; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warn    { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-info    { background: var(--bg-soft); color: var(--sky-700); }

@media (max-width: 768px) {
  .dash { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .dash-main { padding: 20px 16px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
}
