/* ═══════════════════════════════════════════════════════════════════
   HomeTechnify — Premium 3D Design System
   Glassmorphism + Premium Gradients + Animated Backgrounds
   Built for: Pakistan's #1 home services platform
   ═══════════════════════════════════════════════════════════════════ */

:root {
  /* Premium gradient palette */
  --grad-primary: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  --grad-blue: linear-gradient(135deg, #0095FF 0%, #6366f1 60%, #8b5cf6 100%);
  --grad-warm: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  --grad-cool: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --grad-success: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  --grad-gold: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
  --grad-purple: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-bg-strong: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(255, 255, 255, 0.4);
  --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.12);
  --glass-shadow-hover: 0 20px 60px rgba(31, 38, 135, 0.22);

  /* Premium backgrounds */
  --bg-canvas: linear-gradient(135deg, #f5f7ff 0%, #eef2fe 30%, #e8f1ff 60%, #f0f4ff 100%);
  --bg-dark: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);

  /* Premium colors */
  --premium-blue: #0095FF;
  --premium-purple: #8b5cf6;
  --premium-pink: #ec4899;
  --premium-gold: #f59e0b;
}

/* ─── ANIMATED PREMIUM BACKGROUND ─── */
body.premium-3d {
  background: var(--bg-canvas) !important;
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

body.premium-3d::before,
body.premium-3d::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  z-index: 0;
  pointer-events: none;
  animation: blob 20s ease-in-out infinite;
}
body.premium-3d::before {
  width: 500px; height: 500px;
  top: -100px; right: -100px;
  background: linear-gradient(135deg, #f093fb, #667eea);
}
body.premium-3d::after {
  width: 600px; height: 600px;
  bottom: -150px; left: -150px;
  background: linear-gradient(135deg, #4facfe, #00f2fe);
  animation-delay: -7s;
}

@keyframes blob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -50px) scale(1.1); }
  66% { transform: translate(-20px, 30px) scale(0.9); }
}

body.premium-3d > *:not(.call-overlay):not(.modal-overlay):not(.modal-ov):not([id*="Overlay"]):not([id*="Modal"]):not(.mob-bottom-nav):not(#notifPanel) {
  position: relative;
  z-index: 1;
}

/* ─── GLASSMORPHISM CARDS ─── */
.glass {
  background: var(--glass-bg) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border: 1px solid var(--glass-border) !important;
  box-shadow: var(--glass-shadow) !important;
  border-radius: 24px !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.glass:hover {
  box-shadow: var(--glass-shadow-hover) !important;
  transform: translateY(-2px);
}
.glass-strong {
  background: var(--glass-bg-strong) !important;
  backdrop-filter: blur(28px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(200%) !important;
  border: 1.5px solid var(--glass-border) !important;
  box-shadow: var(--glass-shadow) !important;
  border-radius: 24px !important;
}

/* ─── PREMIUM 3D ICON CONTAINER ─── */
.icon-3d {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.1), inset 0 -2px 4px rgba(0,0,0,0.03);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.icon-3d::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.5), transparent);
  border-radius: 18px 18px 0 0;
  pointer-events: none;
}
.icon-3d:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.25), inset 0 -2px 4px rgba(0,0,0,0.03);
}
.icon-3d img,
.icon-3d > * {
  width: 60%;
  height: 60%;
  object-fit: contain;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.12));
}

.icon-3d.sm { width: 40px; height: 40px; border-radius: 14px; }
.icon-3d.lg { width: 72px; height: 72px; border-radius: 22px; }
.icon-3d.xl { width: 96px; height: 96px; border-radius: 28px; }

/* Tinted icon containers */
.icon-3d.tint-blue { background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(255,255,255,0.6)); }
.icon-3d.tint-green { background: linear-gradient(135deg, rgba(67,233,123,0.15), rgba(255,255,255,0.6)); }
.icon-3d.tint-purple { background: linear-gradient(135deg, rgba(139,92,246,0.15), rgba(255,255,255,0.6)); }
.icon-3d.tint-orange { background: linear-gradient(135deg, rgba(254,140,0,0.15), rgba(255,255,255,0.6)); }
.icon-3d.tint-pink { background: linear-gradient(135deg, rgba(236,72,153,0.15), rgba(255,255,255,0.6)); }
.icon-3d.tint-gold { background: linear-gradient(135deg, rgba(251,191,36,0.18), rgba(255,255,255,0.6)); }

/* ─── PREMIUM HERO CARDS ─── */
.hero-premium {
  background: var(--grad-blue);
  border-radius: 28px;
  padding: 36px 40px;
  position: relative;
  overflow: hidden;
  color: white;
  box-shadow: 0 20px 60px rgba(99, 102, 241, 0.3);
}
.hero-premium::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.18), transparent);
}
.hero-premium::after {
  content: '';
  position: absolute;
  bottom: -80px; left: 30%;
  width: 250px; height: 250px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.12), transparent);
}
.hero-premium .hero-3d-decor {
  position: absolute;
  right: 30px;
  top: 50%;
  transform: translateY(-50%);
  width: 140px;
  height: 140px;
  filter: drop-shadow(0 20px 40px rgba(0,0,0,0.25));
  animation: float 4s ease-in-out infinite;
  z-index: 1;
}
@keyframes float {
  0%, 100% { transform: translateY(-50%) rotate(-5deg); }
  50% { transform: translateY(-60%) rotate(5deg); }
}
.hero-premium h1, .hero-premium h2 {
  position: relative; z-index: 2;
  font-size: 30px; font-weight: 800;
  letter-spacing: -0.8px;
  margin: 0 0 10px;
}
.hero-premium p {
  position: relative; z-index: 2;
  font-size: 15.5px;
  opacity: 0.92;
  margin: 0 0 20px;
  max-width: 480px;
}

/* ─── PREMIUM STAT CARD ─── */
.stat-premium {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.stat-premium::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 100px; height: 100px;
  background: radial-gradient(circle, rgba(99,102,241,0.08), transparent 70%);
  pointer-events: none;
}
.stat-premium:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 50px rgba(31, 38, 135, 0.15);
}
.stat-premium .stat-info {
  flex: 1;
  min-width: 0;
}
.stat-premium .stat-num {
  font-size: 28px;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: -0.5px;
  line-height: 1;
  background: var(--grad-blue);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-premium .stat-num.simple {
  background: none;
  -webkit-text-fill-color: #1e293b;
  color: #1e293b;
}
.stat-premium .stat-label {
  font-size: 12.5px;
  font-weight: 600;
  color: #64748b;
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ─── PREMIUM BUTTONS ─── */
.btn-premium {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 26px;
  border-radius: 16px;
  font-size: 14.5px;
  font-weight: 700;
  font-family: inherit;
  border: none;
  cursor: pointer;
  background: var(--grad-blue);
  color: white;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35), inset 0 1px 0 rgba(255,255,255,0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.btn-premium::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transition: left 0.6s;
}
.btn-premium:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(99, 102, 241, 0.45), inset 0 1px 0 rgba(255,255,255,0.3);
}
.btn-premium:hover::before { left: 100%; }
.btn-premium:active { transform: translateY(0); }

.btn-glass {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  color: #1e293b;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(31, 38, 135, 0.08);
  transition: all 0.3s;
}
.btn-glass:hover {
  background: rgba(255,255,255,0.9);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(31, 38, 135, 0.15);
}

/* ─── PREMIUM SIDEBAR ─── */
.sidebar-premium {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(28px) saturate(180%);
  border-right: 1px solid var(--glass-border);
  box-shadow: 0 0 40px rgba(31, 38, 135, 0.08);
}

.nav-item-premium {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  color: #64748b;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: inherit;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 4px;
}
.nav-item-premium:hover {
  background: rgba(255,255,255,0.6);
  color: #1e293b;
  transform: translateX(2px);
}
.nav-item-premium.active {
  background: var(--grad-blue);
  color: white !important;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}
.nav-item-premium .nav-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-item-premium .nav-icon img {
  width: 100%; height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

/* ─── PREMIUM CATEGORY TILES ─── */
.cat-tile-premium {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  display: block;
  position: relative;
  overflow: hidden;
}
.cat-tile-premium::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 60%;
  background: linear-gradient(180deg, rgba(255,255,255,0.3), transparent);
  border-radius: 22px 22px 0 0;
  pointer-events: none;
}
.cat-tile-premium:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(31, 38, 135, 0.18);
  border-color: rgba(99, 102, 241, 0.3);
}
.cat-tile-premium .cat-3d {
  width: 64px;
  height: 64px;
  margin: 0 auto 10px;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.15));
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.cat-tile-premium:hover .cat-3d {
  transform: scale(1.15) rotate(-5deg);
}
.cat-tile-premium .cat-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: -0.2px;
}
.cat-tile-premium .cat-sub {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 3px;
}

/* ─── PREMIUM TABLE ─── */
.tbl-premium {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.tbl-premium th {
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
  padding: 14px 18px;
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1.5px solid rgba(99, 102, 241, 0.15);
}
.tbl-premium td {
  padding: 16px 18px;
  font-size: 14px;
  color: #334155;
  border-bottom: 1px solid rgba(174, 184, 207, 0.18);
  background: rgba(255, 255, 255, 0.3);
}
.tbl-premium tr:hover td { background: rgba(255, 255, 255, 0.6); }
.tbl-premium tr:last-child td { border-bottom: none; }

/* ─── INPUTS PREMIUM ─── */
.input-premium {
  width: 100%;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1.5px solid rgba(99, 102, 241, 0.2);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  font-size: 14.5px;
  font-family: inherit;
  color: #1e293b;
  outline: none;
  transition: all 0.25s;
}
.input-premium:focus {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--premium-blue);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

/* ─── BADGES PREMIUM ─── */
.pill-premium {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 50px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  backdrop-filter: blur(10px);
}
.pill-premium.success { background: rgba(67, 233, 123, 0.15); color: #16a34a; }
.pill-premium.warning { background: rgba(251, 191, 36, 0.18); color: #d97706; }
.pill-premium.danger { background: rgba(239, 68, 68, 0.15); color: #dc2626; }
.pill-premium.info { background: rgba(99, 102, 241, 0.15); color: #4f46e5; }
.pill-premium.gold {
  background: var(--grad-gold);
  color: white;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* ─── ANIMATED COUNTER ─── */
@keyframes countUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.count-anim { animation: countUp 0.6s cubic-bezier(0.4, 0, 0.2, 1); }

/* ─── PREMIUM SCROLLBAR ─── */
.premium-3d *::-webkit-scrollbar { width: 8px; height: 8px; }
.premium-3d *::-webkit-scrollbar-track { background: transparent; }
.premium-3d *::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(99,102,241,0.3), rgba(99,102,241,0.5));
  border-radius: 4px;
}
.premium-3d *::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(99,102,241,0.5), rgba(99,102,241,0.7));
}

/* ─── PREMIUM TOAST ─── */
.toast-premium {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 14px 28px;
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(20px);
  color: white;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.toast-premium.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast-premium.success { background: linear-gradient(135deg, #16a34a, #15803d); }
.toast-premium.error { background: linear-gradient(135deg, #dc2626, #b91c1c); }

/* ─── MOBILE ADAPTATIONS ─── */
@media (max-width: 768px) {
  .hero-premium { padding: 24px 22px; }
  .hero-premium h1, .hero-premium h2 { font-size: 22px; }
  .hero-premium .hero-3d-decor { width: 90px; height: 90px; right: 10px; }
  .icon-3d.lg { width: 56px; height: 56px; }
  .stat-premium { padding: 16px; gap: 12px; }
  .stat-premium .stat-num { font-size: 22px; }
}

/* ─── UTILITY ─── */
.glass-section {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(20px) saturate(180%);
  border-radius: 24px;
  padding: 28px;
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.08);
}

.section-title-premium {
  font-size: 19px;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: -0.4px;
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-title-premium img,
.section-title-premium .icon-3d {
  width: 32px; height: 32px;
}

/* ─── HIDE 2D OUTPUTS WHEN PREMIUM ON ─── */
.premium-3d [data-icon] svg {
  /* Keep functional but hide visually in tabs/icons where we use 3D */
}

/* ─── SHIMMER LOADING ─── */
@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}
.shimmer {
  background: linear-gradient(90deg, #f0f4ff 0%, #ffffff 50%, #f0f4ff 100%);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite linear;
  border-radius: 12px;
}
