/* =============================================
   MindFlow - Global Styles (Responsive Fixed)
   نسخة محسّنة بـ Fluid Typography
   ============================================= */

/* === CSS Variables === */
:root {
  /* الألوان - تبقى كما هي */
  --bg-primary: #0A0118;
  --bg-secondary: #1A0A2E;
  --bg-card: rgba(26, 16, 60, 0.6);
  
  --text-primary: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.4);
  
  --border-color: rgba(255, 255, 255, 0.1);
  --hover-overlay: rgba(255, 255, 255, 0.05);
  
  --xp-color: #3672F8;
  --gold-color: #FFD700;
  --diamond-color: #00E5FF;
  --mc-color: #E040FB;
  --energy-color: #10B981;
  --green-color: #22c55e;
  --red-color: #ef4444;
  --purple-color: #6B46C1;
  --orange-color: #f97316;
  --pink-color: #ec4899;
  --cyan-color: #06b6d4;
  
  --gold-light: rgba(255, 215, 0, 0.1);
  --gold-border: var(--gold-color);
  --gold-hover: rgba(255, 215, 0, 0.15);
  
  --glass-bg: rgba(26, 16, 60, 0.4);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  
  /* ===== الحواف (تبقى كما هي) ===== */
  --radius-sm: 0.4rem;
  --radius-md: 0.8rem;
  --radius-lg: 1.2rem;
  --radius-xl: 1.6rem;
  
  /* ===== المسافات (تبقى كما هي) ===== */
  --spacing-xs: 0.4rem;
  --spacing-sm: 0.8rem;
  --spacing-md: 1.2rem;
  --spacing-lg: 1.6rem;
  --spacing-xl: 2.4rem;
  
  /* التدرجات */
  --gradient-primary: linear-gradient(135deg, var(--xp-color), var(--mc-color));
  --gradient-gold: linear-gradient(135deg, var(--gold-color), #FFA500);
  --gradient-energy: linear-gradient(135deg, var(--energy-color), #34D399);
  --gradient-success: linear-gradient(135deg, var(--green-color), #16a34a);
  --gradient-vip: linear-gradient(135deg, #667eea, #764ba2);
  --gradient-special: linear-gradient(135deg, #fa709a, #fee140);
}

/* === Reset === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== 🔥 الحل السحري: Fluid Font Size ===== */
html {
  /* يتكيف تلقائياً بين 13px و 18px حسب حجم الشاشة */
  font-size: clamp(13px, 0.6rem + 0.25vw, 15.5px);
  scroll-behavior: smooth;
}

/* التفسير:
   - على 320px (أصغر موبايل) → 13px
   - على 768px (تابلت) → 15px
   - على 1366px (لابتوب) → 16.5px
   - على 1920px (شاشة كبيرة) → 18px
   - على 2560px (4K) → 18px (max)
*/

body {
  font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  direction: rtl;
  text-align: right;
}

/* ===== Typography مع Fluid Sizing ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--spacing-sm);
}

/* 🔥 Fluid Typography للعناوين */
h1 { font-size: clamp(1.6rem, 1.2rem + 1vw, 2.5rem); }
h2 { font-size: clamp(1.4rem, 1.1rem + 0.8vw, 2rem); }
h3 { font-size: clamp(1.2rem, 1rem + 0.6vw, 1.75rem); }
h4 { font-size: clamp(1rem, 0.9rem + 0.4vw, 1.5rem); }
h5 { font-size: clamp(0.9rem, 0.85rem + 0.2vw, 1.125rem); }
h6 { font-size: clamp(0.8rem, 0.75rem + 0.15vw, 1rem); }

p {
  margin-bottom: var(--spacing-sm);
  font-size: clamp(0.875rem, 0.8rem + 0.2vw, 1.125rem);
}

/* === Links === */
a {
  color: var(--xp-color);
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  color: var(--diamond-color);
}

/* === Container مع Fluid Padding === */
.container {
  max-width: 1400px;
  margin: 0 auto;
  /* يتكيف بين 1rem و 2rem */
  padding: 0 clamp(1rem, 0.5rem + 1.5vw, 2rem);
}

/* === Utility Classes === */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }

.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }

.mx-auto { margin-left: auto; margin-right: auto; }

/* === Glassmorphism === */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  transition: all 0.3s ease;
}

.glass-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

/* === Grid System مع Auto-fit === */
.grid {
  display: grid;
  gap: var(--spacing-md);
}

/* 🔥 Grid مرن يتكيف تلقائياً */
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid-5 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* === Flexbox === */
.flex {
  display: flex;
  gap: var(--spacing-sm);
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-column {
  display: flex;
  flex-direction: column;
}

.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }

.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }

.gap-xs { gap: var(--spacing-xs); }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }

/* === Scrollbar === */
::-webkit-scrollbar {
  width: clamp(4px, 0.3vw, 8px);
  height: clamp(4px, 0.3vw, 8px);
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--xp-color);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--mc-color);
}

/* === Animations === */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.fade-in { animation: fadeIn 0.4s ease; }
.slide-up { animation: slideUp 0.5s ease; }
.slide-in-right { animation: slideInRight 0.5s ease; }
.pulse { animation: pulse 1.5s infinite; }
.spin { animation: spin 0.8s linear infinite; }
.bounce { animation: bounce 1.5s infinite; }

/* ===== 🔥 Media Queries المحسّنة ===== */

/* Small Mobile (أصغر من 480px) */
@media (max-width: 480px) {
  :root {
    --spacing-md: 1rem;
    --spacing-lg: 1.2rem;
  }
  
  .container {
    padding: 0 0.75rem;
  }
  
  /* Grid يصير عمود واحد */
  .grid-2,
  .grid-3,
  .grid-4,
  .grid-5 {
    grid-template-columns: 1fr;
  }
}

/* Tablet (بين 481px و 768px) */
@media (min-width: 481px) and (max-width: 768px) {
  .grid-4,
  .grid-5 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Small Desktop (بين 769px و 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .grid-5 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Large Desktop (أكبر من 1440px) */
@media (min-width: 1440px) {
  .container {
    max-width: 1600px;
  }
}

/* 4K Screens (أكبر من 2560px) */
@media (min-width: 2560px) {
  .container {
    max-width: 2000px;
  }
}

/* Mobile Landscape */
@media (max-width: 768px) and (orientation: landscape) {
  .flex {
    flex-direction: row;
  }
}

/* === Special Effects === */
.shimmer {
  position: relative;
  overflow: hidden;
}

.shimmer::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  animation: shimmer 1.5s infinite;
}

.glow {
  box-shadow: 0 0 15px rgba(54, 114, 248, 0.4);
}

.glow-gold {
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.glow-energy {
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

/* === Loading States === */
.loading-state {
  text-align: center;
  padding: clamp(1.5rem, 1rem + 1.5vw, 3rem);
  color: var(--text-muted);
}

.loading-spinner {
  width: clamp(30px, 2rem + 0.5vw, 50px);
  height: clamp(30px, 2rem + 0.5vw, 50px);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--xp-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 0.8rem;
}

/* === Empty States === */
.empty-state {
  text-align: center;
  padding: clamp(1.5rem, 1rem + 1.5vw, 3rem);
  color: var(--text-muted);
}

.empty-icon {
  font-size: clamp(2.5rem, 2rem + 1vw, 4rem);
  opacity: 0.3;
  margin-bottom: 0.8rem;
}

/* === Form Elements === */
input, select, textarea, button {
  font-family: 'Cairo', 'Segoe UI', sans-serif;
  font-size: clamp(0.875rem, 0.8rem + 0.2vw, 1rem);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--xp-color);
  box-shadow: 0 0 0 1px rgba(54, 114, 248, 0.1);
}

/* === Color Utilities === */
.text-gold { color: var(--gold-color); }
.text-diamond { color: var(--diamond-color); }
.text-energy { color: var(--energy-color); }
.text-xp { color: var(--xp-color); }
.text-success { color: var(--green-color); }
.text-error { color: var(--red-color); }
.text-purple { color: var(--purple-color); }
.text-orange { color: var(--orange-color); }
.text-pink { color: var(--pink-color); }
.text-cyan { color: var(--cyan-color); }

.bg-gold { background: var(--gradient-gold); }
.bg-diamond { background: var(--gradient-vip); }
.bg-energy { background: var(--gradient-energy); }
.bg-success { background: var(--gradient-success); }

/* === Display Utilities === */
.hidden { display: none !important; }
.block { display: block !important; }
.inline-block { display: inline-block !important; }

/* === Position Utilities === */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

.top-0 { top: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }

.z-1 { z-index: 1; }
.z-10 { z-index: 10; }
.z-100 { z-index: 100; }
.z-1000 { z-index: 1000; }

/* === Width & Height === */
.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

/* === Font Weight === */
.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }

/* === Opacity === */
.opacity-0 { opacity: 0; }
.opacity-25 { opacity: 0.25; }
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }
.opacity-100 { opacity: 1; }

/* === Rating (Modal) === */
.rating-selector {
  display: flex;
  justify-content: center;
  gap: clamp(0.3rem, 0.2rem + 0.3vw, 0.75rem);
  margin: 1.5rem 0;
}

.rating-star {
  font-size: clamp(2rem, 1.5rem + 1vw, 3.5rem);
  cursor: pointer;
  opacity: 0.3;
  transition: all 0.2s ease;
  filter: grayscale(100%);
}

.rating-star:hover,
.rating-star.active {
  opacity: 1;
  filter: grayscale(0%);
  transform: scale(1.2);
}

/* === Modal === */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex !important;
}

.modal-content {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 1rem + 1vw, 2.5rem);
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  color: #fff;
}

.modal-close {
  background: none;
  border: none;
  font-size: clamp(1.5rem, 1.2rem + 0.5vw, 2.5rem);
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: clamp(25px, 1.5rem + 0.5vw, 35px);
  height: clamp(25px, 1.5rem + 0.5vw, 35px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: #ef4444;
}


/* ========================================
   👑 VIP BADGE STYLES
   ======================================== */

.vip-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-left: 0.5rem;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
    animation: vipGlow 2s ease-in-out infinite;
}

@keyframes vipGlow {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
    }
    50% {
        box-shadow: 0 2px 12px rgba(255, 215, 0, 0.6);
    }
}

/* ✅ VIP Badge في Navbar */
.header-center .vip-badge {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
}

/* ✅ VIP Badge في Cards */
.product-card .vip-badge,
.service-card .vip-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
}

/* ✅ Mobile Responsive */
@media (max-width: 768px) {
    .vip-badge {
        font-size: 0.7rem;
        padding: 0.15rem 0.4rem;
    }
}

/* ========================================
   🔥 New Badge Style
======================================== */
.new-badge {
    display: inline-block;
    padding: 3px 8px;
    background: linear-gradient(135deg, #FF6B6B, #FF4757);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 8px;
    margin-right: 5px;
    animation: pulse-glow 2s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(255, 71, 87, 0.5);
}

@keyframes pulse-glow {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 15px rgba(255, 71, 87, 0.5);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 25px rgba(255, 71, 87, 0.8);
    }
}

/* في حالة السايد بار مطوي */
.sidebar.collapsed .new-badge {
    display: none;
}
