:root {
  --bg: #0b0f1a;
  --panel: #131a29;
  --panel-2: #1a2437;
  --accent: #ff7a1a;
  --accent-2: #ff3d3d;
  --accent-grad: linear-gradient(135deg, #ff7a1a, #ff3d3d);
  --text: #e6ebf5;
  --muted: #8b96ac;
  --border: #2a3654;
  --danger: #ef4444;
  --success: #22c55e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  direction: rtl;
}

a { color: var(--accent-2); text-decoration: none; }

.navbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.navbar img { height: 34px; }

.navbar .brand {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 1px;
}

.navbar nav {
  margin-right: auto;
  display: flex;
  gap: 18px;
}

.navbar nav a { color: var(--muted); font-weight: 600; }
.navbar nav a:hover { color: var(--text); }

.container {
  max-width: 900px;
  margin: 60px auto;
  padding: 0 20px;
  text-align: center;
}

.hero-logo { width: 120px; margin-bottom: 10px; }

.hero-title {
  font-size: 40px;
  font-weight: 900;
  margin: 10px 0;
}

.hero-sub {
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto 30px;
  line-height: 1.8;
}

.dropzone {
  border: 2px dashed var(--accent);
  border-radius: 16px;
  background: var(--panel);
  padding: 90px 30px;
  cursor: pointer;
  transition: 0.2s;
  box-shadow: 0 0 40px rgba(255,122,26,0.08) inset;
}

.dropzone:hover { border-color: var(--accent-2); box-shadow: 0 0 24px rgba(255,90,20,0.12) inset; }
.dropzone.dragover { background: var(--panel-2); border-color: var(--accent-2); box-shadow: 0 0 24px rgba(255,90,20,0.25) inset; }

.dropzone .icon {
  width: 60px; height: 60px;
  border-radius: 14px;
  background: rgba(255,122,26,0.15);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
  font-size: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-grad);
  color: #fff;
  border: none;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  font-size: 15px;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
  box-shadow: 0 0 0 rgba(255,90,20,0);
}
.btn:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 18px rgba(255,90,20,0.55), 0 0 4px rgba(255,60,20,0.6);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); filter: brightness(0.95); }
.btn.secondary {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
}
.btn.secondary:hover { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 12px rgba(255,90,20,0.25); }

/* أزرار "جبارة" تُستخدم للطلب/الشراء بقسم المنتجات - تدرّج متحرك + توهج نابض */
.btn-epic {
  background: linear-gradient(270deg, #ff5a14, #ff8a3d, #ffb347, #ff5a14);
  background-size: 300% 300%;
  animation: epicGradient 4s ease infinite;
  font-size: 16px;
  padding: 14px 24px;
  box-shadow: 0 0 16px rgba(255,120,20,0.45);
}
.btn-epic:hover {
  animation-duration: 1.4s;
  box-shadow: 0 0 26px rgba(255,140,30,0.8), 0 0 10px rgba(255,90,20,0.6);
  transform: translateY(-2px) scale(1.02);
}
@keyframes epicGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.btn.danger { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.btn.danger:hover { box-shadow: 0 0 18px rgba(239,68,68,0.55); }

select, input[type=text], input[type=number], input[type=password], input[type=email] {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
}

.duration-row { margin: 20px 0; display:flex; justify-content:center; gap:10px; align-items:center; color: var(--muted); }

.progress-wrap { margin-top: 20px; background: var(--panel-2); border-radius: 8px; overflow: hidden; height: 10px; display:none; }
.progress-bar { height: 100%; width:0%; background: var(--accent); transition: width .2s; }

.result-card {
  margin-top: 25px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  display: none;
  text-align: right;
}

.file-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 40px;
  max-width: 560px;
  margin: 60px auto;
  text-align: center;
}

.file-card .icon-file { font-size: 60px; margin-bottom: 10px; }
.file-card h2 { margin: 10px 0 4px; }
.file-card .meta { color: var(--muted); margin-bottom: 20px; }

.rating-gate {
  text-align: center;
  padding: 10px 4px;
}
.rating-gate .stars {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 8px 0;
}
.rating-gate .star {
  color: var(--accent-2, #ff5a14);
  transition: transform .15s ease;
  user-select: none;
}
.rating-gate .star:hover { transform: scale(1.2); }
.file-card .expiry { margin-top: 18px; font-size: 13px; color: var(--muted); }

table { width: 100%; border-collapse: collapse; margin-top: 20px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: right; font-size: 14px; }
th { color: var(--muted); font-weight: 700; }

.badge { padding: 3px 10px; border-radius: 20px; font-size: 12px; background: rgba(255,122,26,0.15); color: var(--accent); }
.badge.tier-verified { background: rgba(34,197,94,0.15); color: var(--success); }
.badge.tier-premium { background: rgba(255,214,10,0.18); color: #ffd60a; }

.file-preview { max-width: 100%; max-height: 360px; border-radius: 14px; margin-bottom: 14px; border: 1px solid var(--border); }

.tier-badge {
  text-align: center; font-size: 12px; font-weight: 700; padding: 6px 10px;
  border-radius: 8px; margin-bottom: 10px; background: rgba(255,122,26,0.12); color: var(--accent);
}
.tier-badge.tier-verified { background: rgba(34,197,94,0.15); color: var(--success); }
.tier-badge.tier-admin { background: rgba(255,61,61,0.18); color: var(--accent-2); }
.tier-badge.tier-premium {
  background: linear-gradient(135deg, rgba(255,214,10,0.22), rgba(255,170,0,0.12));
  color: #ffd60a; border: 1px solid rgba(255,214,10,0.4);
}
.acc-avatar-img { object-fit: cover; }

.account-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px;
  padding: 34px; text-align: center;
}
.tier-info { color: var(--muted); margin: 16px 0; line-height: 1.8; font-size: 14px; }
.redeem-form { display: flex; gap: 10px; margin-top: 14px; }
.redeem-form input { flex: 1; }

/* ============ إشعارات Toast ============ */
.toast-box {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 10px; z-index: 9999;
  align-items: center; pointer-events: none;
}
.toast {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  padding: 12px 20px; border-radius: 12px; font-size: 14px; font-weight: 600;
  box-shadow: 0 6px 24px rgba(0,0,0,0.4);
  opacity: 0; transform: translateY(12px); transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { border-color: rgba(34,197,94,0.5); }
.toast-error { border-color: rgba(239,68,68,0.5); }

.stats-row { display:flex; gap:16px; margin: 20px 0; flex-wrap: wrap; }
.stat-box { background: var(--panel-2); border:1px solid var(--border); border-radius:12px; padding:16px 22px; flex:1; min-width: 160px; }
.stat-box .num { font-size: 26px; font-weight: 800; }
.stat-box .label { color: var(--muted); font-size: 13px; }

.login-box { max-width: 380px; margin: 100px auto; background: var(--panel); border:1px solid var(--border); border-radius: 16px; padding: 34px; text-align:center; }
.login-box input { width: 100%; margin-bottom: 14px; }
.flash { color: var(--danger); margin-bottom: 10px; font-size: 14px; }

.footer { text-align:center; color: var(--muted); padding: 30px; font-size: 13px; }

/* ============ تخطيط الشريط الجانبي (Sidebar) بأسلوب Gofile ============ */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--panel);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
}

.live-stats-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; margin-bottom: 10px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--border); font-size: 12px;
}
.live-stats-eye { display: flex; align-items: center; gap: 4px; color: var(--text); white-space: nowrap; }
.live-stats-eye b { color: var(--accent-2); }
.live-stats-total { color: var(--muted); font-size: 11px; }
.live-stats-admin { color: var(--muted); font-size: 12px; opacity: .75; text-decoration: none; white-space: nowrap; }
.live-stats-admin:hover { color: var(--accent-2); opacity: 1; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; }
.side-brand img { height: 32px; }
.side-brand span { font-weight: 800; font-size: 18px; }

.side-account {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.acc-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent-grad);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff; flex-shrink: 0;
}
.acc-name { font-weight: 700; font-size: 14px; }
.acc-type { font-size: 12px; color: var(--muted); }

.side-add-account {
  display: block;
  text-align: center;
  background: var(--panel-2);
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 9px;
  margin-bottom: 18px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}
.side-add-account:hover { border-color: var(--accent); color: var(--accent-2); }

.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.side-nav a {
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14.5px;
}
.side-nav a:hover { background: var(--panel-2); color: var(--text); }
.side-nav a.active { background: rgba(255,122,26,0.15); color: var(--accent-2); }

.side-footer { color: var(--muted); font-size: 12px; text-align: center; padding-top: 14px; }

.main-area { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.topbar-title { font-weight: 800; font-size: 18px; }

.content { padding: 0 20px; }

.banner-wrap { max-width: 560px; margin: 20px auto 0; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); }
.banner-wrap img { width: 100%; display: block; }

@media (max-width: 860px) {
  .sidebar { display: none; }
}
/* ============ قسم آراء العملاء ============ */
.reviews-section { margin-top: 40px; text-align: right; }
.reviews-head {
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border); padding-bottom: 14px; margin-bottom: 16px;
}
.reviews-head select {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px;
}
.reviews-box { display: flex; flex-direction: column; gap: 14px; }
.review-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 16px;
}
.review-head { display: flex; align-items: flex-start; gap: 12px; }
.review-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700;
}
.review-avatar-img { object-fit: cover; }
.review-name { font-weight: 700; }
.review-stars { color: var(--accent); font-size: 14px; margin-top: 2px; }
.review-date { margin-inline-start: auto; color: var(--muted); font-size: 13px; white-space: nowrap; }
.review-text { margin-top: 10px; color: var(--text); line-height: 1.7; font-size: 14px; }

/* ============ أداة إزالة الخلفية ============ */
.bg-remove-preview { display:flex; gap:16px; flex-wrap:wrap; margin-top:16px; }
.bg-remove-preview .box { flex:1; min-width:220px; text-align:center; }
.bg-remove-preview img {
  max-width:100%; max-height:360px; border-radius:12px; border:1px solid var(--border);
  background: repeating-conic-gradient(#2a3654 0% 25%, #1a2437 0% 50%) 50% / 16px 16px;
}

/* ============ ودجت التقييم بعد الرفع (تنسيق داكن متناسق مع الموقع) ============ */
.rating-gate {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 14px; padding: 18px;
}
.rating-gate textarea,
#ratingComment {
  background: var(--bg) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
  padding: 12px !important;
  font-family: inherit;
  font-size: 14px;
}
.rating-gate textarea:focus,
#ratingComment:focus { outline: none; border-color: var(--accent) !important; }
.rating-gate .stars { display: flex; gap: 4px; justify-content: center; }

/* ============ لوحة روابط المشاركة (صفحة الملف العامة) ============ */
.share-panel {
  max-width: 640px; margin: 20px auto 0; background: var(--panel);
  border: 1px solid var(--border); border-radius: 16px; padding: 20px;
}
.share-title { font-weight: 800; font-size: 16px; margin-bottom: 14px; }
.share-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.share-row input {
  flex: 1; background: var(--bg); border: 1px solid var(--border); color: var(--muted);
  border-radius: 8px; padding: 8px 10px; font-size: 12px; direction: ltr; text-align: left;
}
.share-copy {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px;
  width: 34px; height: 34px; cursor: pointer; flex-shrink: 0; font-size: 14px;
}
.share-copy:hover { border-color: var(--accent); }
.share-label { width: 130px; text-align: left; color: var(--muted); font-size: 13px; flex-shrink: 0; }
@media (max-width: 640px) {
  .share-row { flex-wrap: wrap; }
  .share-label { width: 100%; order: -1; }
}

/* ============ رابط يوتيوب في القائمة الجانبية ============ */
.side-nav a.youtube-link {
  background: linear-gradient(135deg, rgba(255, 122, 26, 0.1), rgba(255, 61, 61, 0.05));
  border-right: 3px solid #ff7a1a;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}
.side-nav a.youtube-link:hover {
  background: linear-gradient(135deg, rgba(255, 122, 26, 0.2), rgba(255, 61, 61, 0.1));
  border-right-color: #ff3d3d;
}
.side-nav a.youtube-link .link-badge {
  background: linear-gradient(135deg, #ff7a1a, #ff3d3d);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 12px;
  font-weight: 700;
  animation: yt-pulse 2s ease-in-out infinite;
}
@keyframes yt-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
/* ============ صفحة تفاصيل المنتج (product_detail.html) ============ */
.pd-wrap {
  display: grid;
  grid-template-columns: minmax(280px, 460px) 1fr;
  gap: 28px;
  align-items: flex-start;
}
@media (max-width: 860px) {
  .pd-wrap { grid-template-columns: 1fr; }
}
.pd-back {
  display: inline-block; margin-bottom: 18px; color: var(--muted); font-weight: 600;
}
.pd-back:hover { color: var(--accent-2); }

.pd-gallery { position: sticky; top: 16px; }
.pd-main-frame {
  width: 100%; aspect-ratio: 4/3; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--border); background: var(--panel-2);
  cursor: zoom-in; position: relative;
}
.pd-main-frame img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .25s ease;
}
.pd-main-frame:hover img { transform: scale(1.04); }
.pd-zoom-hint {
  position: absolute; bottom: 10px; left: 10px; background: rgba(0,0,0,.55);
  color: #fff; font-size: 12px; padding: 5px 10px; border-radius: 8px; pointer-events: none;
}
.pd-thumbs {
  display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px;
}
.pd-thumbs img {
  width: 68px; height: 68px; object-fit: cover; border-radius: 10px; flex-shrink: 0;
  border: 2px solid var(--border); cursor: pointer; opacity: .65; transition: all .15s ease;
}
.pd-thumbs img:hover { opacity: 1; }
.pd-thumbs img.active { border-color: var(--accent); opacity: 1; box-shadow: 0 0 10px rgba(255,90,20,.5); }
.pd-count-badge {
  display: inline-block; margin-top: 10px; font-size: 12px; color: var(--muted);
  background: var(--panel-2); border: 1px solid var(--border); padding: 3px 10px; border-radius: 20px;
}

.pd-info { text-align: right; }
.pd-title { font-size: 24px; font-weight: 800; margin: 0 0 8px; }
.pd-price {
  display: inline-block; font-size: 20px; font-weight: 800; color: #fff;
  background: var(--accent-grad); padding: 6px 16px; border-radius: 10px; margin-bottom: 16px;
}
.pd-desc { color: var(--text); line-height: 1.9; font-size: 15px; margin-bottom: 18px; white-space: pre-line; }
.pd-features { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-direction: column; gap: 10px; }
.pd-features li {
  display: flex; align-items: center; gap: 10px; background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; font-size: 14px;
  cursor: help;
}
.pd-features li::before { content: "✅"; }
.pd-order-title { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.pd-order-btns { display: flex; flex-direction: column; gap: 12px; }
.pd-order-btns .btn { width: 100%; justify-content: center; }

/* Lightbox */
.pd-lightbox {
  position: fixed; inset: 0; background: rgba(6,8,14,.92); z-index: 999;
  display: none; align-items: center; justify-content: center; flex-direction: column;
}
.pd-lightbox.open { display: flex; }
.pd-lightbox img { max-width: 90vw; max-height: 78vh; border-radius: 12px; box-shadow: 0 0 40px rgba(0,0,0,.6); }
.pd-lb-controls { display: flex; align-items: center; gap: 22px; margin-top: 18px; }
.pd-lb-controls button {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  width: 44px; height: 44px; border-radius: 50%; font-size: 18px; cursor: pointer;
}
.pd-lb-controls button:hover { border-color: var(--accent); color: var(--accent-2); }
.pd-lb-close {
  position: absolute; top: 18px; left: 18px; background: rgba(255,255,255,.08);
  border: 1px solid var(--border); color: #fff; width: 40px; height: 40px; border-radius: 50%;
  font-size: 18px; cursor: pointer;
}
.pd-lb-counter { color: var(--muted); font-size: 13px; margin-top: 8px; }

/* فيديو المنتج بصفحة التفاصيل */
.pd-video-wrap { margin-bottom: 18px; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); }
.pd-video-wrap iframe, .pd-video-wrap video {
  width: 100%; aspect-ratio: 16/9; display: block; border: none; background: #000;
}

/* صفوف روابط الطلب بلوحة التحكم */
.ol-rows input[type=text] { margin: 0; }
