/* ================================================================
   frontend/css/global.css — Z-PACT Brand Identity
================================================================ */

:root {
  /* Z-PACT Premium Palette */
  --primary:        #38bdf8; /* Neon Sky */
  --primary-dark:   #0ea5e9;
  --primary-glow:   rgba(56, 189, 248, 0.4);
  --primary-light:  rgba(56, 189, 248, 0.12);
  --secondary:      #818cf8; /* Electric Indigo */
  --accent:         #f472b6; /* Cyber Pink */
  
  --danger:         #f43f5e;
  --danger-light:   rgba(244, 63, 94, 0.12);
  --success:        #10b981;
  --success-light:  rgba(16, 185, 129, 0.12);
  --warning:        #f59e0b;
  --warning-light:  rgba(245, 158, 11, 0.12);

  /* Neutrals & Surfaces */
  --bg-page:        #0f172a; /* Deep Space */
  --bg-card:        rgba(30, 41, 59, 0.7); /* Glass Slate */
  --bg-input:       rgba(15, 23, 42, 0.6);
  --bg-sidebar:     #1e293b;
  
  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;
  --text-inverse:   #0f172a;

  --border:         rgba(255, 255, 255, 0.1);
  --border-focus:   #38bdf8;

  /* Glows & Shadows */
  --shadow-sm:      0 2px 4px rgba(0,0,0,0.2);
  --shadow-md:      0 8px 16px rgba(0,0,0,0.3);
  --shadow-lg:      0 12px 32px rgba(0,0,0,0.4);
  --glass-blur:     blur(12px);

  /* Dimensions */
  --radius-sm:      8px;
  --radius-md:      12px;
  --radius-lg:      20px;
  --radius-xl:      28px;
  
  /* Fonts */
  --font-ar:        'Cairo', sans-serif;
  --font-en:        'Outfit', sans-serif;
  --font:           var(--font-ar);
}

/* Z-PACT Premium Light Theme Override */
body.light-theme {
  --bg-page:        #f8fafc;
  --bg-card:        rgba(255, 255, 255, 0.95);
  --bg-input:       #ffffff;
  --bg-sidebar:     #f1f5f9;
  
  --text-primary:   #0f172a;
  --text-secondary: #334155;
  --text-muted:     #64748b;
  --text-inverse:   #ffffff;

  --border:         rgba(0, 0, 0, 0.08);
  --border-focus:   #0ea5e9;
  
  background:       #f8fafc !important;
  color:            #0f172a !important;
}

body.light-theme .card,
body.light-theme .recharge-box,
body.light-theme .coupon-box,
body.light-theme .purchase-box {
  background: #ffffff !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.04) !important;
  border-color: rgba(0, 0, 0, 0.06) !important;
}

body.light-theme input,
body.light-theme select,
body.light-theme textarea,
body.light-theme .form-input,
body.light-theme .input {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
}

body.light-theme aside {
  background: #ffffff !important;
  border-left-color: rgba(0, 0, 0, 0.08) !important;
}

body.light-theme .nav-item {
  color: #334155 !important;
}

body.light-theme .nav-item.active,
body.light-theme .nav-item:hover {
  background: rgba(14, 165, 233, 0.08) !important;
  color: #0ea5e9 !important;
}

body.light-theme .section-title {
  color: #0f172a !important;
}

/* body is defined once below after the reset */

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

html { font-size: 16px; scroll-behavior: smooth; overflow-x: hidden; }

body {
  font-family:      var(--font);
  background:       radial-gradient(circle at 50% 0%, #1e1b4b 0%, #0f172a 60%, #020617 100%);
  background-attachment: fixed;
  color:            var(--text-primary);
  direction:        rtl;
  line-height:      1.6;
  min-height:       100vh;
  overflow-x:       hidden;
}

/* ---------------------------------------------------------------
   Custom Scrollbar (Premium Mac-Style)
--------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--bg-page);
}

::-webkit-scrollbar-thumb {
  /* خفي وشفاف في الوضع العادي، لون أزرق خافت */
  background: rgba(56, 189, 248, 0.2); 
  border-radius: 10px;
  border: 3px solid var(--bg-page);
}

::-webkit-scrollbar-thumb:hover {
  /* يظهر ويضيء عندما يقترب الماوس منه */
  background: rgba(56, 189, 248, 0.8); 
}

::-webkit-scrollbar-thumb:active {
  background: var(--primary);
}

a  { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font); }
input, select, textarea {
  font-family: var(--font);
  font-size:   14px;
  outline:     none;
  direction:   rtl;
}

/* ---------------------------------------------------------------
   مكونات مشتركة
--------------------------------------------------------------- */

/* البطاقة */
.card {
  background:    var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border:        1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding:       1.75rem;
  box-shadow:    0 10px 30px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition:    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.3s, box-shadow 0.3s;
}
.card:hover {
  border-color: rgba(56, 189, 248, 0.25);
  box-shadow: 0 15px 40px rgba(56, 189, 248, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* الأزرار */
.btn {
  display:         inline-flex;
  align-items:     center;
  gap:             8px;
  padding:         10px 20px;
  border-radius:   var(--radius-md);
  font-size:       14px;
  font-weight:     600;
  border:          none;
  transition:      background 0.2s, transform 0.1s, box-shadow 0.2s;
  white-space:     nowrap;
}
.btn:active { transform: scale(0.98); }

.btn-primary { 
  background: linear-gradient(135deg, var(--primary), var(--secondary)); 
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-primary:hover { 
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
  opacity: 0.9;
}

.btn-secondary {
  background: var(--bg-input);
  color:      var(--text-primary);
  border:     1px solid var(--border);
  backdrop-filter: var(--glass-blur);
}
.btn-secondary:hover { background: var(--border); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; }

.btn-ghost {
  background: transparent;
  color:      var(--text-secondary);
  border:     1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-input); color: var(--text-primary); }

.btn-sm  { padding: 6px 14px; font-size: 13px; }
.btn-lg  { padding: 13px 28px; font-size: 15px; }
.btn-full { width: 100%; justify-content: center; }

.btn-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn-loading::after {
  content:       '';
  position:      absolute;
  width:         16px; height: 16px;
  border:        2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation:     spin 0.7s linear infinite;
}

/* حقول الإدخال */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 1rem; }
.form-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.form-input {
  width:         100%;
  background:    rgba(15, 23, 42, 0.45);
  border:        1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding:       11px 15px;
  color:         var(--text-primary);
  font-size:     14px;
  transition:    all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:    inset 0 2px 4px rgba(0, 0, 0, 0.1);
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow:   0 0 16px rgba(56, 189, 248, 0.25), inset 0 2px 4px rgba(0, 0, 0, 0.1);
  background:   rgba(15, 23, 42, 0.7);
}
.form-input.error { border-color: var(--danger); }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }
.form-hint  { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* الشارات */
.badge {
  display:       inline-block;
  padding:       3px 10px;
  border-radius: 20px;
  font-size:     12px;
  font-weight:   600;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger  { background: var(--danger-light);  color: var(--danger);  }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-muted   { background: var(--bg-input);      color: var(--text-muted); }

/* رسائل التنبيه */
.alert {
  padding:       12px 16px;
  border-radius: var(--radius-md);
  font-size:     14px;
  display:       flex;
  align-items:   center;
  gap:           10px;
  margin-bottom: 1rem;
}
.alert-error   { background: var(--danger-light);  color: #fca5a5; border: 1px solid rgba(244,63,94,0.3); }
.alert-success { background: var(--success-light); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.3); }
.alert-info    { background: var(--primary-light); color: var(--primary);      border: 1px solid rgba(56,189,248,0.3); }

/* اللودر */
.spinner {
  width:  24px; height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
.spinner-lg { width: 48px; height: 48px; border-width: 4px; }

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, var(--bg-input) 25%, var(--border) 50%, var(--bg-input) 75%);
  background-size: 200% 100%;
  animation: skeleton-slide 1.2s infinite;
  border-radius: var(--radius-md);
}

/* Modal */
.modal-overlay {
  position:    fixed; inset: 0;
  background:  rgba(0,0,0,0.5);
  z-index:     1000;
  display:     flex;
  align-items: center;
  justify-content: center;
  padding:     1rem;
  opacity:     0;
  transition:  opacity 0.2s;
  pointer-events: none;
}
.modal-overlay.show { opacity: 1; pointer-events: all; }
.modal {
  background:    var(--bg-card);
  border-radius: var(--radius-xl);
  padding:       2rem;
  max-width:     520px;
  width:         100%;
  transform:     translateY(20px);
  transition:    transform 0.2s;
  max-height:    90vh;
  overflow-y:    auto;
}
.modal-overlay.show .modal { transform: translateY(0); }
.modal-header {
  display:         flex;
  justify-content: space-between;
  align-items:     center;
  margin-bottom:   1.5rem;
}
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close {
  background: var(--bg-input); border: none;
  width: 32px; height: 32px; border-radius: 50%;
  font-size: 18px; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
}

/* Divider */
.divider { height: 1px; background: var(--border); margin: 1rem 0; }

/* Grid مشترك */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr;     gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; }

/* Animations */
@keyframes spin          { to { transform: rotate(360deg); } }
@keyframes skeleton-slide { to { background-position: -200% 0; } }
@keyframes fadeIn        { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.fade-in { animation: fadeIn 0.3s ease forwards; }

/* Utilities */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-muted  { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success{ color: var(--success); }
.font-bold   { font-weight: 700; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.hidden { display: none !important; }

/* Z-PACT Coin Icon */
.coin-icon {
  width:          22px;
  height:         22px;
  object-fit:     contain;
  vertical-align: middle;
  margin-bottom:  2px;
  display:        inline-block;
  flex-shrink:    0;
  clip-path:      circle(50%);  /* يقطع الزوايا البيضاء حتى لو الصورة مش transparent */
}

/* ===== Shared Notifications styles ===== */
.notif-bell {
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.2s;
}
.notif-bell:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}
.notif-badge {
  position: absolute;
  top: 0px;
  right: 0px;
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: bold;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}
.notif-dropdown {
  position: absolute;
  top: 60px;
  left: 20px;
  width: 320px;
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg), 0 10px 25px rgba(0,0,0,0.4);
  display: none;
  flex-direction: column;
  z-index: 2000;
}
.notif-dropdown.show {
  display: flex;
}
.notif-header {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
}
.notif-list {
  max-height: 300px;
  overflow-y: auto;
}
.notif-item {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: background 0.2s;
}
.notif-item:hover {
  background: rgba(255, 255, 255, 0.03);
}
.notif-item.unread {
  border-right: 3px solid var(--primary);
  background: rgba(56, 189, 248, 0.02);
}

/* ===== Premium Z-PACT Navbar ===== */
.navbar {
  background: rgba(10, 15, 30, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem; height: 72px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 1000;
}
.navbar::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary-glow), transparent);
}
/* Logo Container (wrapper) */
.nav-logo-container {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-logo-container img {
  height: 36px;
  width: 36px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
  transition: all 0.3s;
}
.nav-logo {
  font-family: 'Outfit', sans-serif;
  font-size: 26px; font-weight: 900; letter-spacing: -1px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 8px rgba(56,189,248,0.3));
  display: inline-block;
  transition: all 0.3s;
}
.nav-links { display: flex; gap: 0.5rem; }
.nav-links a {
  font-size: 14px; font-weight: 600; color: var(--text-secondary);
  padding: 8px 16px; border-radius: var(--radius-md);
  transition: all 0.25s;
}
.nav-links a:hover, .nav-links a.active {
  background: rgba(56,189,248,0.08);
  color: var(--primary);
}
.nav-actions { display: flex; align-items: center; gap: 1rem; }

.coins-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(217, 119, 6, 0.08));
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 800;
  color: #fbbf24;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.15);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* Shine Sweep Animation */
.coins-badge::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 30%;
  height: 200%;
  background: rgba(255, 255, 255, 0.35);
  transform: rotate(30deg);
  transition: none;
  animation: shineSweep 4s infinite ease-in-out;
}

@keyframes shineSweep {
  0% { left: -60%; }
  15%, 100% { left: 130%; }
}

.coins-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);
  border-color: rgba(245, 158, 11, 0.6);
}
.user-pill {
  background: rgba(255,255,255,0.04);
  padding: 6px 16px; border-radius: 30px;
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); font-size: 13px;
}
/* ===== Floating Chat ===== */
.chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}
.chat-btn {
  width: 58px; height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00f2ff, #7b00ff);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,242,255,0.5);
  transition: transform 0.2s, box-shadow 0.2s;
  border: none;
  flex-shrink: 0;
}
.chat-btn:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(0,242,255,0.7); }
.chat-window {
  width: 340px; height: 460px;
  background: #07080c;
  border: 1px solid rgba(0,242,255,0.25);
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.9), 0 0 20px rgba(0,242,255,0.1);
  display: none; flex-direction: column; overflow: hidden;
}
.chat-window.show { display: flex; }
.chat-header {
  background: linear-gradient(135deg, #0d0f18, #130026);
  padding: 14px 18px;
  display: flex; justify-content: space-between; align-items: center;
  font-weight: bold;
  border-bottom: 1px solid rgba(0,242,255,0.15);
  color: #00f2ff; font-size: 14px; flex-shrink: 0;
}
.chat-messages {
  flex: 1; padding: 14px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
  background: #07080c;
}
.chat-msg { max-width: 80%; padding: 8px 12px; border-radius: 12px; font-size: 13px; }
.chat-msg.me { background: #00f2ff; color: #07080c; align-self: flex-end; border-bottom-right-radius: 0; }
.chat-msg.other { background: rgba(125,0,255,0.2); align-self: flex-start; border-bottom-left-radius: 0; }
.chat-input-area {
  padding: 12px; border-top: 1px solid rgba(0,242,255,0.15);
  display: flex; gap: 8px; background: #0a0b10; flex-shrink: 0;
}
.chat-input {
  flex: 1; background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 8px;
  color: white; outline: none; font-size: 14px; padding: 8px 12px;
  font-family: var(--font-ar);
}
.chat-input:focus { border-color: rgba(0,242,255,0.4); }

/* Mobile: button stays at corner, window becomes a full-screen, native-feeling modal */
@media (max-width: 768px) {
  body.chat-open-scroll-lock {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
  }

  .chat-widget {
    position: fixed !important;
    bottom: 88px !important;
    right: 16px !important;
    z-index: 2500 !important; /* Above mobile bottom-nav (2000) */
    transform: none !important;
  }

  .chat-btn {
    width: 56px !important;
    height: 56px !important;
    font-size: 26px !important;
    box-shadow: 0 8px 24px rgba(0, 242, 255, 0.4) !important;
  }

  /* When chat is open on mobile */
  .chat-widget.chat-open {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    z-index: 10000000 !important; /* Above EVERYTHING (navbar, bottom-nav, headers) */
    transform: none !important;
    align-items: stretch !important;
    gap: 0 !important;
    padding: 0 !important;
  }

  .chat-widget.chat-open .chat-btn {
    display: none !important; /* Hide floating button so it doesn't block the input/send button */
  }

  .chat-widget.chat-open .chat-window,
  .chat-window.show {
    display: flex !important;
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    z-index: 10000001 !important;
    background: #090d16 !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .chat-header {
    padding: 12px 16px !important;
    background: #0d1424 !important;
    border-bottom: 1px solid rgba(56, 189, 248, 0.2) !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    min-height: 56px !important;
  }

  .chat-close-btn {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    color: #fff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 20px !important;
    font-weight: bold !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    cursor: pointer !important;
    touch-action: manipulation !important;
  }

  .chat-messages {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 14px 16px !important;
    gap: 12px !important;
    background: #090d16 !important;
  }

  .chat-input-area {
    flex-shrink: 0 !important;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    background: #0d1424 !important;
    border-top: 1px solid rgba(56, 189, 248, 0.2) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    z-index: 10 !important;
  }

  .chat-input-area > div {
    display: flex !important;
    gap: 8px !important;
    width: 100% !important;
    align-items: center !important;
  }

  .chat-input {
    font-size: 16px !important; /* Prevents auto-zoom in iOS Safari */
    min-height: 46px !important;
    border-radius: 12px !important;
    padding: 10px 14px !important;
    background: rgba(255, 255, 255, 0.07) !important;
    border: 1px solid rgba(56, 189, 248, 0.3) !important;
    color: #fff !important;
    flex: 1 !important;
    box-sizing: border-box !important;
  }

  .chat-send-btn {
    min-height: 46px !important;
    padding: 0 18px !important;
    border-radius: 12px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    flex-shrink: 0 !important;
    background: linear-gradient(135deg, #00f2ff, #7b00ff) !important;
    border: none !important;
    color: #fff !important;
  }

  #chat-messages-container > div {
    margin-bottom: 12px !important;
    max-width: 90% !important;
  }

  #chat-messages-container > div > img {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
  }

  .chat-bubble-content {
    font-size: 14px !important;
    padding: 10px 14px !important;
    border-radius: 14px !important;
    max-width: 100% !important;
  }
}


/* ================================================================
   الاستجابة للشاشات (Responsive Design - Comprehensive Overhaul)
================================================================ */

/* تحسينات عامة للموبايل */
@media (max-width: 768px) {
  #admin-dash-link-desktop {
    display: none !important;
  }
  html { font-size: 14px; }
  
  body {
    padding-bottom: 100px; /* مساحة كافية للـ Bottom Nav العائم والـ Widgets */
  }

  .container {
    padding: 0 1rem;
  }

  /* منع خروج الكروت والكونتينرات عن حدود الشاشة */
  .card, .modal-content, .container, .panel {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* تحسين وتكبير حقول الإدخال لتفادي الزوم التلقائي في iOS */
  input, select, textarea {
    font-size: 16px !important;
    padding: 12px 14px !important;
    min-height: 48px !important;
    box-sizing: border-box !important;
  }

  /* جعل الأزرار أكبر وأسهل في الضغط */
  .btn {
    padding: 12px 18px;
    font-size: 15px;
    min-height: 48px;
  }
  .btn-sm {
    padding: 8px 14px;
    min-height: 38px;
  }

  /* الجريد في الموبايل */
  .grid-2, .grid-3, .grid-4 { 
    grid-template-columns: 1fr; 
    gap: 1rem;
  }

  /* البطاقات */
  .card { 
    padding: 1.25rem;
    border-radius: var(--radius-md);
  }

  /* النوافذ المنبثقة (Modals) - شبه كامل الشاشة في الموبايل */
  .modal {
    padding: 1.25rem;
    max-height: 92vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    position: fixed;
    bottom: 0;
    margin: 0;
    max-width: 100% !important;
  }
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  /* إخفاء لينكات الهيدر العادية في الموبايل */
  .nav-links {
    display: none !important;
  }

  /* تحسين شكل الهيدر في الموبايل */
  .navbar {
    padding: 0 1.25rem;
    height: 64px;
    background: rgba(10, 15, 30, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .nav-logo-container {
    gap: 6px !important;
  }
  .nav-logo-container img {
    height: 28px !important;
    width: 28px !important;
    border-radius: 6px !important;
  }
  .nav-logo {
    font-size: 20px !important;
  }
  .nav-actions {
    gap: 0.75rem;
  }
  .user-pill {
    background: transparent;
    border: none;
    padding: 0;
  }
  .user-pill > span:not(.coins-badge) {
    display: none !important; /* إخفاء الاسم والترحيب وإظهار شارة الرصيد فقط */
  }

  /* ===== Premium Floating Bottom Navigation Bar (Mobile Only) ===== */
  .bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 12px;
    left: 12px;
    right: 12px;
    height: 64px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    justify-content: space-around;
    align-items: center;
    z-index: 2000;
    padding: 0 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 255, 255, 0.1) inset;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 48px;
    padding: 4px 8px;
    position: relative;
    border-radius: 14px;
    flex: 1;
  }
  
  .bottom-nav-item i, .bottom-nav-item span.icon {
    font-size: 18px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  
  .bottom-nav-item:active {
    transform: scale(0.95);
  }
  
  .bottom-nav-item.active {
    color: var(--primary);
    background: rgba(56, 189, 248, 0.08);
    box-shadow: inset 0 0 12px rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.15);
  }
  
  .bottom-nav-item.active i, .bottom-nav-item.active span.icon {
    transform: translateY(-2px) scale(1.1);
  }
  
  /* Glowing Active Dot */
  .bottom-nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--primary);
    animation: pulseGlow 1.5s infinite alternate;
  }

  /* ترقية أيقونة الشات العائم على الموبايل */
  .chat-widget:not(.chat-open) {
    bottom: 88px !important; /* فوق الشريط السفلي العائم */
    right: 16px !important;
  }
  .chat-widget:not(.chat-open) .chat-btn {
    width: 54px !important;
    height: 54px !important;
    font-size: 24px !important;
    box-shadow: 0 8px 24px rgba(0, 242, 255, 0.3) !important;
    animation: chatPulse 2.5s infinite alternate ease-in-out !important;
  }

  /* تحسين قوائم المشتريات والمواد */
  .materials-grid {
    grid-template-columns: 1fr !important;
  }
  .material-card {
    display: flex;
    flex-direction: column;
  }
  
  /* الجداول في الموبايل */
  .table-container {
    margin: 0 -1rem;
    width: calc(100% + 2rem);
    border-radius: 0;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  table {
    font-size: 13px;
  }
}

/* Default state for Bottom Nav */
.bottom-nav {
  display: none;
}

@keyframes pulseGlow {
  from { opacity: 0.6; box-shadow: 0 0 4px var(--primary); }
  to { opacity: 1; box-shadow: 0 0 10px var(--primary); }
}

@keyframes chatPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 8px 24px rgba(0, 242, 255, 0.3);
  }
  100% {
    transform: scale(1.05);
    box-shadow: 0 8px 32px rgba(0, 242, 255, 0.5), 0 0 15px rgba(123, 0, 255, 0.3);
  }
}

/* تحسينات خاصة للوحة الإدارة (Admin Dashboard) */
@media (max-width: 900px) {
    aside {
        transform: translateX(100%);
        transition: transform 0.3s ease;
        width: 260px !important;
        position: fixed !important;
        z-index: 3000;
        top: 0;
        bottom: 0;
        right: 0;
        background: var(--bg-sidebar);
        box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    }
    aside.show {
        transform: translateX(0);
    }
    main {
        margin-right: 0 !important;
        padding: 1rem;
    }
    
    .mobile-menu-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: var(--bg-input);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        font-size: 20px;
    }
}

/* حماية الصور والجداول من الخروج عن الحدود */
.table-container table {
    width: 100%;
    border-collapse: collapse;
}

.table-container::-webkit-scrollbar {
    height: 6px;
}
.table-container::-webkit-scrollbar-thumb {
    background: var(--primary-glow);
    border-radius: 3px;
}

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Premium Range Slider Styling */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  background: rgba(255, 255, 255, 0.08) !important;
  height: 6px !important;
  border-radius: 3px !important;
  outline: none !important;
  border: none !important;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary) !important;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.6) !important;
  cursor: pointer;
  transition: transform 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary) !important;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.6) !important;
  cursor: pointer;
  border: none !important;
  transition: transform 0.15s ease;
}

input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.25);
}

@media (max-width: 768px) {
  .navbar, .mobile-header, #mobile-sticky-header {
    z-index: 999999 !important;
  }
}

/* ================================================================
   Z-PACT ELITE: PROFESSIONAL REVIEWS & RATINGS DESIGN SYSTEM
================================================================ */

/* Review Summary Dashboard */
.review-dashboard {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.review-dashboard::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.review-dashboard-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.5rem;
  align-items: center;
}

@media (max-width: 768px) {
  .review-dashboard-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

.overall-score-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.1);
}

.overall-score-num {
  font-size: 44px;
  font-weight: 900;
  line-height: 1;
  color: #fbbf24;
  text-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
  font-family: var(--font-en), var(--font-ar);
  margin-bottom: 6px;
}

.overall-stars-row {
  color: #fbbf24;
  font-size: 18px;
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.overall-count-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Metric Bars */
.review-metric-item {
  margin-bottom: 12px;
}
.review-metric-item:last-child {
  margin-bottom: 0;
}

.review-metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.review-metric-header span.metric-name {
  display: flex;
  align-items: center;
  gap: 6px;
}

.review-metric-header span.metric-val {
  color: #fbbf24;
  font-weight: 800;
}

.metric-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}

.metric-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px currentColor;
}

.metric-bar-fill.content {
  background: linear-gradient(90deg, #38bdf8, #0ea5e9);
  color: rgba(56, 189, 248, 0.5);
}

.metric-bar-fill.print {
  background: linear-gradient(90deg, #a855f7, #818cf8);
  color: rgba(168, 85, 247, 0.5);
}

.metric-bar-fill.stamp {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  color: rgba(245, 158, 11, 0.5);
}

/* Individual Review Card */
.review-card-pro {
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
  transition: all 0.25s ease;
  backdrop-filter: blur(8px);
}

.review-card-pro:hover {
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.reviewer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.reviewer-info-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.reviewer-avatar-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9 0%, #818cf8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.3);
  flex-shrink: 0;
}

.reviewer-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.reviewer-name {
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.reviewer-title-badge {
  font-size: 11px;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.12);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.verified-buyer-tag {
  font-size: 11px;
  font-weight: 700;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.review-date-text {
  font-size: 11px;
  color: var(--text-muted);
}

.review-card-stars {
  color: #fbbf24;
  font-size: 15px;
  letter-spacing: 1px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 4px;
}

.review-card-comment {
  font-size: 14px;
  color: #e2e8f0;
  line-height: 1.6;
  margin: 10px 0 12px;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.35);
  border-radius: var(--radius-sm);
  border-right: 3px solid var(--primary);
}

.review-pills-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.review-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.review-pill strong {
  color: #fbbf24;
}

/* Interactive Star Picker */
.interactive-stars-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  direction: ltr; /* To fill stars left-to-right on hover */
  justify-content: flex-end;
}

.star-interactive-btn {
  background: none;
  border: none;
  font-size: 26px;
  color: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  padding: 2px;
  transition: all 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  outline: none;
}

.star-interactive-btn:hover,
.star-interactive-btn.active {
  color: #fbbf24;
  transform: scale(1.2);
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.6);
}

.star-rating-hint {
  font-size: 12px;
  font-weight: 700;
  color: #fbbf24;
  min-width: 65px;
  text-align: right;
  margin-right: 8px;
}

.title-chips-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.title-chip-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-family: var(--font-ar);
  transition: all 0.2s ease;
}

.title-chip-btn:hover,
.title-chip-btn.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

/* ================================================================
   SKELETON SHIMMER LOADING
================================================================ */
.skeleton {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 25%, rgba(255, 255, 255, 0.09) 50%, rgba(255, 255, 255, 0.03) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite ease-in-out;
  border-radius: var(--radius-sm);
}

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

.skeleton-card {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.skeleton-card-cover {
  width: 100%;
  height: 160px;
}

.skeleton-card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ================================================================
   FLOATING TOAST NOTIFICATION SYSTEM
================================================================ */
.z-toast-container {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 90%;
  max-width: 420px;
  pointer-events: none;
}

.z-toast {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  animation: toastSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.z-toast.toast-success {
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.2);
}

.z-toast.toast-error {
  border-color: rgba(244, 63, 94, 0.5);
  box-shadow: 0 8px 24px rgba(244, 63, 94, 0.2);
}

.z-toast.toast-info {
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.2);
}

.z-toast.toast-warning {
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.2);
}

.z-toast-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.z-toast-content {
  flex: 1;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 600;
}

.z-toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  opacity: 0.8;
  animation: toastProgress 3.5s linear forwards;
}

.z-toast.toast-success .z-toast-progress { background: #10b981; }
.z-toast.toast-error .z-toast-progress { background: #f43f5e; }
.z-toast.toast-warning .z-toast-progress { background: #f59e0b; }

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(-30px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0%; }
}

/* ================================================================
   DESKTOP VS MOBILE APP NATIVE DESIGN SYSTEM
================================================================ */

/* Desktop Isolation: Hide Mobile-Only UI Elements on screens > 768px */
@media (min-width: 769px) {
  .mobile-header,
  #mobile-sticky-header,
  .bottom-nav,
  #mobile-bottom-nav,
  .mobile-sticky-action-bar,
  #preview-mobile-sticky-bar,
  .pull-refresh-box,
  #pull-refresh-box,
  .bottom-sheet-handle,
  .mobile-only {
    display: none !important;
  }
}

/* ================================================================
   MOBILE APP NATIVE OVERHAUL (max-width: 768px)
================================================================ */

@media (max-width: 768px) {
  /* Hide Desktop Elements */
  .navbar,
  .store-sidebar,
  .desktop-only {
    display: none !important;
  }

  /* Page Bottom Safe Spacing for Floating Nav Dock */
  body {
    padding-bottom: 96px !important;
    background: #090d16 !important;
  }
  
  .container {
    padding: 0.75rem !important;
  }

  /* Mobile App Bar (Top Sticky Native Header) */
  .mobile-header {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    height: 60px;
    background: rgba(13, 20, 36, 0.92) !important;
    backdrop-filter: blur(28px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(180%) !important;
    padding: 0 12px;
    z-index: 1000 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  }

  .mobile-brand-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    cursor: pointer;
  }

  .mobile-brand-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.5));
  }

  .mobile-brand-title {
    font-family: var(--font-en), sans-serif;
    font-size: 20px;
    font-weight: 900;
    background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
  }

  .mobile-user-greeting {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 3px 8px;
    border-radius: 20px;
    max-width: 130px;
    overflow: hidden;
  }

  .mobile-user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    flex-shrink: 0;
  }

  .mobile-user-greeting-text {
    font-size: 12px;
    font-weight: 700;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-coin-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 4px 10px;
    border-radius: 20px;
    color: #fbbf24;
    font-weight: 900;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.15);
    transition: transform 0.15s ease;
    user-select: none;
  }

  .mobile-coin-chip:active {
    transform: scale(0.93);
  }

  .mobile-coin-chip img {
    width: 16px;
    height: 16px;
    object-fit: contain;
  }

  .mobile-notif-btn {
    position: relative;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    font-size: 17px;
    transition: transform 0.15s ease;
    user-select: none;
  }

  .mobile-notif-btn:active {
    transform: scale(0.92);
  }

  .notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 10px;
    border: 2px solid #0f172a;
    min-width: 16px;
    text-align: center;
    line-height: 1.2;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
  }

  /* Smart Bottom Navigation Dock */
  .bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 12px;
    left: 12px;
    right: 12px;
    height: 64px;
    background: rgba(15, 23, 42, 0.88) !important;
    backdrop-filter: blur(28px) saturate(190%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(190%) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 24px !important;
    justify-content: space-around;
    align-items: center;
    z-index: 4000;
    padding: 0 6px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7), 0 0 20px rgba(56, 189, 248, 0.1) !important;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease !important;
    will-change: transform, opacity;
  }

  .bottom-nav.nav-hidden {
    transform: translateY(140%) !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    height: 52px;
    padding: 2px 6px;
    border-radius: 16px;
    flex: 1;
    position: relative;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .bottom-nav-item:active {
    transform: scale(0.92);
  }

  .bottom-nav-item.active {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.14);
    box-shadow: inset 0 0 14px rgba(56, 189, 248, 0.18);
    border: 1px solid rgba(56, 189, 248, 0.3);
  }

  .bottom-nav-item .icon {
    font-size: 20px;
    line-height: 1;
    transition: transform 0.2s ease;
  }

  .bottom-nav-item.active .icon {
    transform: translateY(-1px);
  }

  .bottom-nav-badge {
    position: absolute;
    top: 4px;
    right: 20px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 10px;
    border: 2px solid #0f172a;
    min-width: 16px;
    text-align: center;
    line-height: 1.2;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
  }

  /* Mobile Grid & Native Cards */
  .materials-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .material-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.85) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 22px !important;
    overflow: hidden !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s ease !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .material-card:active {
    transform: scale(0.985) !important;
    border-color: rgba(56, 189, 248, 0.5) !important;
  }

  .material-card .card-cover {
    height: 190px !important;
    border-radius: 22px 22px 0 0 !important;
    position: relative !important;
    background-size: cover !important;
    background-position: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 58px !important;
    background-color: rgba(15, 23, 42, 0.7) !important;
    cursor: pointer;
  }

  .material-card .card-body {
    padding: 14px 16px 16px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }

  .material-card .card-title {
    font-size: 17px !important;
    font-weight: 800 !important;
    color: #fff !important;
    line-height: 1.35 !important;
    margin: 0 !important;
  }

  .material-card .card-desc {
    font-size: 13px !important;
    color: var(--text-muted) !important;
    line-height: 1.5 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    margin: 0 !important;
  }

  .mobile-card-meta-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding-top: 8px !important;
    margin-top: 4px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
  }

  .mobile-card-price-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    background: rgba(245, 158, 11, 0.12) !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
    padding: 4px 10px !important;
    border-radius: 12px !important;
    font-weight: 900 !important;
    font-size: 16px !important;
    color: #fbbf24 !important;
  }

  .mobile-card-price-badge img {
    width: 18px !important;
    height: 18px !important;
  }

  .mobile-card-rating-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #fbbf24 !important;
    background: rgba(251, 191, 36, 0.08) !important;
    border: 1px solid rgba(251, 191, 36, 0.2) !important;
    padding: 3px 9px !important;
    border-radius: 8px !important;
  }

  /* Mobile Card Action Buttons - Contained & Luxury */
  .mobile-card-actions {
    display: flex !important;
    gap: 8px !important;
    margin-top: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    align-items: stretch !important;
  }

  .mobile-card-actions .btn,
  .btn-card-preview,
  .btn-card-buy {
    min-width: 0 !important;
    border-radius: 12px !important;
    font-size: 13px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    cursor: pointer !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-sizing: border-box !important;
  }

  /* Frosted Glass Preview Button */
  .btn-card-preview {
    flex: 1 1 38% !important;
    padding: 10px 8px !important;
    background: rgba(56, 189, 248, 0.08) !important;
    border: 1px solid rgba(56, 189, 248, 0.35) !important;
    color: #38bdf8 !important;
    font-weight: 700 !important;
  }
  .btn-card-preview:hover {
    background: rgba(56, 189, 248, 0.22) !important;
    border-color: #38bdf8 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 16px rgba(56, 189, 248, 0.35) !important;
    transform: translateY(-2px) !important;
  }
  .btn-card-preview:active {
    transform: scale(0.97) !important;
  }

  /* Radiant High-Tech Buy Button */
  .btn-card-buy {
    flex: 1 1 62% !important;
    padding: 10px 10px !important;
    background: linear-gradient(135deg, #0284c7 0%, #2563eb 50%, #7c3aed 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    box-shadow: 0 4px 18px rgba(37, 99, 235, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
  }
  .btn-card-buy:hover {
    background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 50%, #8b5cf6 100%) !important;
    box-shadow: 0 6px 24px rgba(56, 189, 248, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
    transform: translateY(-2px) !important;
  }
  .btn-card-buy:active {
    transform: scale(0.97) !important;
  }

  /* Bottom Sheet Transformation for All Modals on Mobile */
  .modal {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  .modal .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 28px 28px 0 0 !important;
    border-bottom: none !important;
    max-height: 88vh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1) !important;
    padding: 1.25rem 1.25rem 2.25rem !important;
    box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    background: rgba(15, 23, 42, 0.97) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
  }

  .modal.show .modal-content {
    transform: translateY(0) !important;
  }

  /* Bottom Sheet Drag Handle */
  .bottom-sheet-handle {
    display: block !important;
    width: 44px;
    height: 5px;
    background: rgba(255, 255, 255, 0.28);
    border-radius: 99px;
    margin: -4px auto 14px;
    cursor: grab;
    touch-action: none;
  }

  /* Mobile Sticky Purchase Action Bar */
  .mobile-sticky-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid rgba(56, 189, 248, 0.25);
    padding: 12px 16px;
    padding-bottom: max(14px, env(safe-area-inset-bottom)) !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 3500;
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.6);
    animation: slideUpAction 0.3s ease;
  }

  @keyframes slideUpAction {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  /* Pull to Refresh Indicator */
  .pull-refresh-box {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 0px;
    overflow: hidden;
    transition: height 0.2s ease;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    gap: 8px;
  }

  .pull-refresh-box.pulling {
    height: 52px;
  }
}


