/* ============================================================
   style.css — التصميم الموحّد لـ GlowRate
   الثيم: أنيق، نظيف، مع لمسات ذهبية/وردية فاخرة
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=DM+Sans:wght@300;400;500;600&display=swap');

/* --- المتغيرات --- */
:root {
  --gold: #c9a84c;
  --gold-light: #f4e3a5;
  --rose: #e8927c;
  --bg: #fdf4ea;        /* أوف وايت دافئ للخلفية */
  --bg-card: #ffffff;
  --text: #222222;
  --text-muted: #757575;
  --border-soft: #eadfce;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
  direction: rtl;
}

/* --- شريط التنقل --- */
nav {
  background: rgba(253, 244, 234, 0.95);
  border-bottom: 1px solid var(--border-soft);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: var(--gold);
  letter-spacing: 1px;
  text-decoration: none;
}

.logo-img {
  width: 36px;
  height: 36px;
  display: block;
}

.logo span { color: var(--rose); }

nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}
nav a:hover { color: var(--gold); }

/* --- الحاوية الرئيسية --- */
.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 32px 20px 80px; /* مساحة أسفل للشريط السفلي */
}

/* --- البطاقات --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

/* --- الأزرار --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: #3b3b3b;
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(201,168,76,0.35); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border-soft);
  color: var(--text-muted);
}
.btn-outline:hover { background: #f3f4f6; color: var(--text); }

.btn-full { width: 100%; justify-content: center; }

/* --- النجوم --- */
.star { color: var(--text-muted); font-size: 1.2rem; }
.star.filled { color: var(--gold); }

/* --- الشارات / التاغ --- */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
  background: #fef9c3;
  color: var(--gold);
  border: 1px solid #facc15;
}

/* --- الإنبوت / الفورم --- */
.input-group {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

input[type="text"], textarea, select {
  background: #ffffff;
  border: 1.5px solid var(--border-soft);
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  width: 100%;
  transition: border-color 0.2s;
  direction: rtl;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--gold);
}

textarea { resize: vertical; min-height: 100px; }

label {
  display: block;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 500;
}

.form-group { margin-bottom: 20px; }

/* المنتج + تصنيف المنتج مباشرة تحت بعض */
.product-and-category .form-group-tight { margin-bottom: 10px; }
.product-and-category .form-group-tight:last-child { margin-bottom: 20px; }

/* --- بطاقة المنتج --- */
.product-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  cursor: pointer;
  transition: all 0.2s;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  text-decoration: none;
  color: inherit;
}
.product-card:hover {
  border-color: var(--gold);
  background: #fefce8;
  transform: translateX(-3px);
}

.product-card img {
  width: 70px;
  height: 70px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.product-info h3 { font-size: 1rem; margin-bottom: 4px; }
.product-info .brand { color: var(--gold); font-size: 0.82rem; font-weight: 500; }
.product-info .meta { display: flex; gap: 12px; align-items: center; margin-top: 6px; }
.product-info .review-count { color: var(--text-muted); font-size: 0.8rem; }

/* --- التقييمات --- */
.review-item {
  padding: 16px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.review-item:last-child { border-bottom: none; }
.review-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.reviewer-name { font-weight: 600; font-size: 0.9rem; }
.review-date { color: var(--text-muted); font-size: 0.78rem; }
.review-comment { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }

/* --- صفحة المنتج: الهيدر --- */
.product-header {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 24px;
}
.product-header img {
  width: 100px;
  height: 100px;
  border-radius: 14px;
  object-fit: cover;
}
.product-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  margin-bottom: 6px;
}
.avg-score {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
  font-family: 'Playfair Display', serif;
}

/* --- Hero القسم الرئيسي --- */
.hero {
  text-align: center;
  padding: 48px 0 32px;
}
.hero-logo {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  color: var(--gold);
  margin-bottom: 12px;
}
.hero-tagline-en {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.hero-subtext {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 440px;
  margin: 0 auto 32px;
}

/* --- منطقة السكان --- */
/* (تم إلغاء صندوق المسح بالكاميرا في النسخة المبسطة) */

/* --- الرسائل --- */
.msg {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 16px;
}
.msg-error { background: rgba(232,100,100,0.1); border: 1px solid rgba(232,100,100,0.3); color: #E86464; }
.msg-success { background: rgba(100,200,120,0.1); border: 1px solid rgba(100,200,120,0.3); color: #64C878; }

/* --- نجوم التقييم التفاعلية --- */
.star-picker { display: flex; gap: 6px; flex-direction: row-reverse; }
.star-picker input { display: none; }
.star-picker label {
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.15s;
  margin: 0;
}
.star-picker label:hover,
.star-picker label:hover ~ label,
.star-picker input:checked ~ label { color: var(--gold); }

/* --- تحميل --- */
.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 2.5rem; margin-bottom: 12px; }

/* --- Divider --- */
.divider {
  border: none;
  border-top: 1px solid var(--border-soft);
  margin: 24px 0;
}

/* --- قسم "أو ابحث" --- */
.or-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.or-divider::before, .or-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-soft);
}

/* --- شريط البحث مع أيقونة --- */
.search-wrapper {
  position: relative;
  margin-bottom: 20px;
}
.search-wrapper input[type="text"] {
  padding-right: 40px;
}
.search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: var(--text-muted);
  cursor: pointer;
}

/* --- شريط الأقسام (ستوري) --- */
.category-strip {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.category-item {
  min-width: 70px;
  border: none;
  background: transparent;
  text-align: center;
  cursor: pointer;
  font-family: inherit;
}
.category-item .cat-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 6px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}
.category-item .cat-icon {
  font-size: 1.4rem;
}
.category-item .cat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.category-item:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* --- شريط التنقل السفلي --- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(253, 244, 234, 0.98);
  border-top: 1px solid var(--border-soft);
  display: flex;
  justify-content: space-around;
  padding: 6px 4px 10px;
  z-index: 120;
  backdrop-filter: blur(12px);
}
.bottom-nav-item {
  flex: 1;
  text-align: center;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.bottom-nav-item .icon {
  font-size: 1.3rem;
}
.bottom-nav-item.is-active {
  color: var(--gold);
}

/* --- قسم الحساب --- */
.account-section {
  margin-top: 32px;
  padding: 24px;
}
.account-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  color: var(--gold);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
}
.account-block {
  margin-bottom: 24px;
}
.account-block:last-child {
  margin-bottom: 0;
}
.account-subtitle {
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 10px;
  font-weight: 600;
}
.my-reviews-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.my-review-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, background 0.2s;
}
.my-review-item:hover {
  border-color: var(--gold);
  background: #fefce8;
}
.my-review-name {
  font-weight: 600;
  font-size: 0.95rem;
}
.my-review-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.my-review-meta .star {
  font-size: 0.9rem;
}
.my-reviews-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 16px;
  background: var(--bg);
  border-radius: 12px;
  border: 1px dashed var(--border-soft);
}

/* --- Animation --- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.4s ease forwards; }
.delay-1 { animation-delay: 0.1s; opacity: 0; }
.delay-2 { animation-delay: 0.2s; opacity: 0; }
.delay-3 { animation-delay: 0.3s; opacity: 0; }
