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

:root {
  --primary: #1a56db;
  --primary-dark: #1343b0;
  --accent: #f97316;
  --bg: #0a0f1e;
  --bg2: #111827;
  --card: #1f2937;
  --text: #f9fafb;
  --text2: #9ca3af;
  --border: #374151;
  --success: #10b981;
  --error: #ef4444;
}

body {
  font-family: 'Cairo', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

/* ===== خلفية متحركة ===== */
.bg-animation {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

.floating-phones {
  position: absolute;
  width: 100%; height: 100%;
}

.phone-icon {
  position: absolute;
  font-size: clamp(20px, 3vw, 40px);
  opacity: 0.06;
  animation: floatPhone linear infinite;
  user-select: none;
}

@keyframes floatPhone {
  0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10% { opacity: 0.06; }
  90% { opacity: 0.06; }
  100% { transform: translateY(-100px) rotate(360deg); opacity: 0; }
}

.gradient-overlay {
  position: absolute;
  width: 100%; height: 100%;
  background: radial-gradient(ellipse at 20% 50%, rgba(26,86,219,0.15) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(249,115,22,0.1) 0%, transparent 50%);
}

/* Parallax */
.listings-section { position: relative; z-index: 1; }

/* ===== هيدر ===== */
.header {
  position: fixed;
  top: 0; width: 100%;
  z-index: 1000;
  padding: 16px 0;
  transition: all 0.3s;
  background: rgba(10,15,30,0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.header.scrolled {
  padding: 10px 0;
  box-shadow: 0 4px 30px rgba(0,0,0,0.3);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 24px;
  font-weight: 900;
  text-decoration: none;
  color: var(--text);
}

.logo-icon { font-size: 28px; }
.accent { color: var(--accent); }

.nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-link {
  color: var(--text2);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.nav-link:hover { color: var(--text); }

/* ===== بوتونات ===== */
.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 22px;
  border-radius: 10px;
  font-family: 'Cairo', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s;
}

.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-primary.large { padding: 14px 30px; font-size: 17px; border-radius: 12px; }
.btn-primary.full { width: 100%; margin-top: 10px; padding: 14px; font-size: 16px; }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--border);
  padding: 12px 28px;
  border-radius: 12px;
  font-family: 'Cairo', sans-serif;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-whatsapp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #25d366;
  color: white;
  text-decoration: none;
  padding: 14px 24px;
  border-radius: 12px;
  font-family: 'Cairo', sans-serif;
  font-size: 16px;
  font-weight: 700;
  margin: 16px 0;
  transition: all 0.2s;
}

.btn-whatsapp:hover { background: #1fba5a; transform: translateY(-2px); }

/* ===== هيرو ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 20px 60px;
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 20px;
  animation: fadeUp 0.8s ease forwards;
}

.hero-subtitle {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text2);
  margin-bottom: 40px;
  animation: fadeUp 0.8s ease 0.2s both;
}

.hero-btns {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeUp 0.8s ease 0.4s both;
}

.hero-stats {
  display: flex;
  gap: 40px;
  justify-content: center;
  margin-top: 60px;
  animation: fadeUp 0.8s ease 0.6s both;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-num {
  font-size: 32px;
  font-weight: 900;
  color: var(--accent);
}

.stat span:last-child {
  font-size: 14px;
  color: var(--text2);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== بحث ===== */
.search-section {
  position: relative;
  z-index: 1;
  padding: 40px 0 20px;
}

.search-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--card);
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.search-input, .filter-select {
  flex: 1;
  min-width: 150px;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 10px;
  font-family: 'Cairo', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus, .filter-select:focus { border-color: var(--primary); }
.filter-select option { background: var(--bg2); }

/* ===== إعلانات ===== */
.listings-section { padding: 40px 0 80px; }

.section-title {
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 30px;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
  margin-top: 8px;
}

.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.listing-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s;
  animation: fadeUp 0.5s ease forwards;
}

.listing-card:hover {
  transform: translateY(-6px);
  border-color: var(--primary);
  box-shadow: 0 20px 40px rgba(26,86,219,0.2);
}

.listing-img {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.listing-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.listing-card:hover .listing-img img { transform: scale(1.05); }

.condition-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.condition-badge.ممتاز { background: rgba(16,185,129,0.9); color: white; }
.condition-badge.كويس { background: rgba(249,115,22,0.9); color: white; }
.condition-badge.مقبول { background: rgba(239,68,68,0.9); color: white; }

.listing-info { padding: 16px; }
.listing-name { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.listing-area { font-size: 13px; color: var(--text2); margin-bottom: 6px; }
.listing-desc { font-size: 13px; color: var(--text2); margin-bottom: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.listing-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.listing-price {
  font-size: 20px;
  font-weight: 900;
  color: var(--accent);
}

.btn-see-phone {
  background: var(--primary);
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-family: 'Cairo', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-see-phone:hover { background: var(--primary-dark); }

/* ===== لودينج ===== */
.loading-spinner {
  grid-column: 1/-1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 60px;
  color: var(--text2);
}

.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.no-results {
  grid-column: 1/-1;
  text-align: center;
  padding: 60px;
  color: var(--text2);
}

.no-results p:first-child { font-size: 24px; margin-bottom: 8px; }

/* ===== مودال ===== */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.active { display: flex; }

.modal-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.3s ease;
  z-index: 1;
}

.modal-content.large-modal { max-width: 600px; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: 16px;
  left: 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover { background: var(--error); border-color: var(--error); }

.modal-title {
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 24px;
  text-align: center;
}

.modal-switch {
  text-align: center;
  color: var(--text2);
  font-size: 14px;
  margin-top: 16px;
}

.modal-switch a { color: var(--primary); text-decoration: none; font-weight: 700; }

/* ===== فورم ===== */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text2);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-input {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 10px;
  font-family: 'Cairo', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus { border-color: var(--primary); }
.form-input.textarea { min-height: 80px; resize: none; }
.form-input option { background: var(--bg2); }

.char-count {
  font-size: 12px;
  color: var(--text2);
  float: left;
  margin-top: 4px;
}

.hint { font-size: 12px; color: var(--text2); font-weight: 400; }

/* ===== رفع صور ===== */
.image-upload-area {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 16px;
  transition: border-color 0.2s;
}

.image-upload-area:hover { border-color: var(--primary); }

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px;
  cursor: pointer;
  color: var(--text2);
}

.upload-icon { font-size: 32px; }
.file-input { display: none; }

.image-previews {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.image-preview-item {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
}

.image-preview-item img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.remove-img {
  position: absolute;
  top: 4px; right: 4px;
  background: rgba(239,68,68,0.9);
  color: white;
  border: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== معلومات الدفع ===== */
.payment-info {
  display: flex;
  gap: 12px;
  background: rgba(249,115,22,0.1);
  border: 1px solid rgba(249,115,22,0.3);
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
}

.payment-icon { font-size: 24px; }
.payment-title { font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.payment-desc { font-size: 13px; color: var(--text2); line-height: 1.6; }

/* ===== عرض الرقم ===== */
.phone-reveal-content { text-align: center; padding: 10px 0; }
.phone-reveal-icon { font-size: 48px; margin-bottom: 12px; }
.phone-reveal-desc { color: var(--text2); margin-bottom: 12px; line-height: 1.6; }

.vodafone-number {
  background: var(--bg2);
  border: 2px solid var(--accent);
  border-radius: 12px;
  padding: 16px;
  font-size: 24px;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: 2px;
  margin: 12px 0;
}

.center { text-align: center; }

/* ===== تفاصيل الإعلان ===== */
.listing-detail {}
.listing-images-slider {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 16px;
  border-radius: 12px;
  scrollbar-width: thin;
}

.slide-img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.slide-img:hover { transform: scale(1.02); }
.slide-img.active { border: 2px solid var(--primary); }

.detail-name { font-size: 24px; font-weight: 900; margin-bottom: 12px; }

.detail-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.area-badge, .brand-badge {
  background: var(--bg2);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
}

.detail-desc {
  color: var(--text2);
  line-height: 1.8;
  margin-bottom: 20px;
  font-size: 15px;
}

.detail-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.detail-price { font-size: 32px; font-weight: 900; color: var(--accent); }
.seller-name { color: var(--text2); font-size: 14px; }

/* ===== إشعار ===== */
.notification {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 20px;
  font-family: 'Cairo', sans-serif;
  font-size: 14px;
  font-weight: 700;
  z-index: 9999;
  transform: translateX(200%);
  transition: transform 0.3s ease;
  max-width: 320px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.notification.show { transform: translateX(0); }
.notification.success { border-color: var(--success); color: var(--success); }
.notification.error { border-color: var(--error); color: var(--error); }
.notification.info { border-color: var(--primary); color: var(--primary); }

/* ===== إيرور ===== */
.error-msg {
  color: var(--error);
  font-size: 13px;
  margin-top: 8px;
  min-height: 20px;
}

.error-text { color: var(--error); text-align: center; padding: 40px; }

/* ===== فوتر ===== */
.footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 40px 0;
  text-align: center;
  position: relative;
  z-index: 1;
}

.footer-logo { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 22px; font-weight: 900; margin-bottom: 12px; }
.footer-text { color: var(--text2); margin-bottom: 8px; }
.footer-copy { color: var(--border); font-size: 13px; }

/* ===== ريسبونسيف ===== */
@media (max-width: 768px) {
  .hero-stats { gap: 24px; }
  .stat-num { font-size: 24px; }
  .search-bar { flex-direction: column; }
  .search-input, .filter-select { min-width: 100%; }
  .form-row { grid-template-columns: 1fr; }
  .nav { gap: 10px; }
  .nav-link { display: none; }
  .listings-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .notification { left: 20px; right: 20px; bottom: 20px; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }
