/* ==========================================================================
   css/hub.css - تنسيقات البوابة الموحدة (PRE Unified Hub Stylesheet)
   مؤسسة اللؤلؤة العقارية - PEARL REAL ESTATE (PRE)
   ========================================================================== */

:root {
  --hub-primary: #7b1123;
  --hub-primary-dark: #500a16;
  --hub-primary-deep: #38070f;
  --hub-primary-light: #9e1830;
  --hub-primary-gradient: linear-gradient(135deg, #7b1123 0%, #500a16 100%);
  --hub-primary-glow: rgba(123, 17, 35, 0.25);
  
  --hub-gold: #c58d60;
  --hub-gold-light: #e5b892;
  --hub-gold-dark: #96633b;
  --hub-gold-gradient: linear-gradient(135deg, #dfa97b 0%, #b87c4c 100%);
  
  --hub-accent-teal: #0d9488;
  --hub-accent-blue: #2563eb;
  --hub-accent-purple: #7c3aed;
  --hub-accent-green: #10b981;
  --hub-accent-amber: #d97706;

  --hub-bg: #f8fafc;
  --hub-card-bg: #ffffff;
  --hub-card-border: #e2e8f0;
  --hub-text-main: #0f172a;
  --hub-text-muted: #64748b;
  --hub-text-light: #94a3b8;
  --hub-nav-bg: rgba(255, 255, 255, 0.92);
  --hub-footer-bg: #1e293b;
  --hub-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --hub-shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.07), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --hub-shadow-lg: 0 20px 35px -5px rgba(123, 17, 35, 0.12), 0 10px 15px -5px rgba(0, 0, 0, 0.04);
  --hub-shadow-hover: 0 25px 45px -10px rgba(123, 17, 35, 0.22), 0 12px 20px -8px rgba(0, 0, 0, 0.08);

  --hub-radius-sm: 10px;
  --hub-radius-md: 16px;
  --hub-radius-lg: 24px;
  --hub-radius-xl: 32px;
  --hub-font: 'Cairo', 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[data-theme="dark"] {
  --hub-bg: #090d16;
  --hub-card-bg: #131b2e;
  --hub-card-border: #1e293b;
  --hub-text-main: #f8fafc;
  --hub-text-muted: #94a3b8;
  --hub-text-light: #64748b;
  --hub-nav-bg: rgba(15, 23, 42, 0.94);
  --hub-footer-bg: #0b0f19;
  --hub-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --hub-shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  --hub-shadow-lg: 0 20px 35px -5px rgba(0, 0, 0, 0.6);
  --hub-shadow-hover: 0 25px 50px -10px rgba(123, 17, 35, 0.4);
}

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

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

body {
  font-family: var(--hub-font);
  background-color: var(--hub-bg);
  color: var(--hub-text-main);
  direction: rtl;
  text-align: right;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ================== Animated Background Pattern ================== */
.hub-bg-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.hub-glow-circle {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.15;
  transition: opacity 0.5s ease;
}

.hub-glow-1 {
  width: 650px;
  height: 650px;
  background: var(--hub-primary);
  top: -150px;
  right: -100px;
}

.hub-glow-2 {
  width: 500px;
  height: 500px;
  background: var(--hub-gold);
  bottom: 5%;
  left: -150px;
  opacity: 0.12;
}

.hub-glow-3 {
  width: 400px;
  height: 400px;
  background: var(--hub-accent-teal);
  top: 40%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.06;
}

/* ================== Top Navigation Bar ================== */
.hub-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--hub-nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--hub-card-border);
  padding: 0.85rem 0;
  transition: all 0.3s ease;
}

.hub-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

.hub-nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.hub-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
}

.hub-logo-img {
  height: 52px;
  width: auto;
  max-width: 150px;
  border-radius: 10px;
  object-fit: contain;
  background: #ffffff;
  padding: 3px 8px;
  border: 1.5px solid var(--hub-gold);
  box-shadow: 0 4px 12px rgba(123, 17, 35, 0.15);
}

.hub-brand-info h1 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--hub-primary);
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

[data-theme="dark"] .hub-brand-info h1 {
  color: #f1a5b4;
}

.hub-brand-badge {
  display: inline-block;
  background: var(--hub-gold-gradient);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 1px;
}

.hub-brand-desc {
  font-size: 0.8rem;
  color: var(--hub-text-muted);
  font-weight: 500;
}

.hub-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hub-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.1);
  color: var(--hub-accent-green);
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 50px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hub-accent-green);
  box-shadow: 0 0 8px var(--hub-accent-green);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.hub-btn-theme {
  background: var(--hub-card-bg);
  border: 1px solid var(--hub-card-border);
  color: var(--hub-text-main);
  padding: 8px 14px;
  border-radius: var(--hub-radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.hub-btn-theme:hover {
  background: var(--hub-primary);
  color: #ffffff;
  border-color: var(--hub-primary);
  transform: translateY(-2px);
}

/* ================== Hero Section ================== */
.hub-hero {
  padding: 3.5rem 0 2.5rem 0;
  text-align: center;
  position: relative;
}

.hub-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(123, 17, 35, 0.08) 0%, rgba(197, 141, 96, 0.12) 100%);
  border: 1px solid rgba(123, 17, 35, 0.2);
  color: var(--hub-primary);
  padding: 6px 18px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

[data-theme="dark"] .hub-hero-badge {
  color: var(--hub-gold-light);
  border-color: rgba(229, 184, 146, 0.3);
  background: rgba(123, 17, 35, 0.3);
}

.hub-hero-title {
  font-size: 2.75rem;
  font-weight: 900;
  color: var(--hub-text-main);
  line-height: 1.25;
  margin-bottom: 1rem;
  letter-spacing: -0.5px;
}

.hub-hero-title .highlight-text {
  background: var(--hub-primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

[data-theme="dark"] .hub-hero-title .highlight-text {
  background: linear-gradient(135deg, #f43f5e 0%, #fb923c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hub-hero-subtitle {
  font-size: 1.15rem;
  color: var(--hub-text-muted);
  max-width: 720px;
  margin: 0 auto 1.5rem auto;
  font-weight: 500;
}

/* ================== Live Quick Stats Bar ================== */
.hub-stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 3.5rem;
}

.hub-stat-item {
  background: var(--hub-card-bg);
  border: 1px solid var(--hub-card-border);
  border-radius: var(--hub-radius-md);
  padding: 1.25rem 1rem;
  text-align: center;
  box-shadow: var(--hub-shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hub-stat-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--hub-shadow-md);
  border-color: var(--hub-gold);
}

.hub-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.hub-stat-icon.red { background: rgba(123, 17, 35, 0.1); color: var(--hub-primary); }
.hub-stat-icon.gold { background: rgba(197, 141, 96, 0.15); color: var(--hub-gold-dark); }
.hub-stat-icon.teal { background: rgba(13, 148, 136, 0.1); color: var(--hub-accent-teal); }
.hub-stat-icon.purple { background: rgba(124, 58, 237, 0.1); color: var(--hub-accent-purple); }

.hub-stat-text {
  text-align: right;
}

.hub-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--hub-text-main);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.hub-stat-label {
  font-size: 0.8rem;
  color: var(--hub-text-muted);
  font-weight: 600;
  margin-top: 2px;
}

/* ================== The Two Core Portals Grid ================== */
.hub-portals-section {
  margin-bottom: 4rem;
}

.hub-section-header {
  text-align: center;
  margin-bottom: 2rem;
}

.hub-section-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--hub-text-main);
  margin-bottom: 0.5rem;
}

.hub-section-subtitle {
  font-size: 0.95rem;
  color: var(--hub-text-muted);
}

.hub-portals-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.hub-portal-card {
  background: var(--hub-card-bg);
  border: 1px solid var(--hub-card-border);
  border-radius: var(--hub-radius-xl);
  overflow: hidden;
  box-shadow: var(--hub-shadow-md);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  color: inherit;
}

.hub-portal-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--hub-shadow-hover);
  border-color: var(--hub-primary);
}

.hub-portal-card.card-admin:hover {
  border-color: var(--hub-primary);
}

.hub-portal-card.card-cases:hover {
  border-color: var(--hub-gold-dark);
}

/* Card Header Banner */
.portal-card-header {
  padding: 2.25rem 2rem 1.75rem 2rem;
  position: relative;
  color: #ffffff;
  overflow: hidden;
}

.card-admin .portal-card-header {
  background: linear-gradient(135deg, #7b1123 0%, #500a16 60%, #30050c 100%);
}

.card-cases .portal-card-header {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 60%, #020617 100%);
}

.card-header-decor {
  position: absolute;
  top: -30px;
  left: -30px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.card-top-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 50px;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
}

.card-cases .card-top-tag {
  background: rgba(197, 141, 96, 0.25);
  border-color: var(--hub-gold);
  color: var(--hub-gold-light);
}

.portal-title-wrapper {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.portal-big-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--hub-radius-md);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.25rem;
  flex-shrink: 0;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.portal-title-text h2 {
  font-size: 1.65rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
  margin-bottom: 4px;
}

.portal-title-text p {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
}

/* Card Body */
.portal-card-body {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: space-between;
}

.portal-desc {
  font-size: 0.95rem;
  color: var(--hub-text-muted);
  line-height: 1.65;
  margin-bottom: 1.5rem;
}

.portal-features-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.portal-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--hub-text-main);
  font-weight: 600;
}

.feature-bullet {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.card-admin .feature-bullet {
  background: rgba(123, 17, 35, 0.1);
  color: var(--hub-primary);
}

.card-cases .feature-bullet {
  background: rgba(197, 141, 96, 0.15);
  color: var(--hub-gold-dark);
}

/* Card Live Tags Strip */
.portal-tags-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--hub-card-border);
}

.portal-tag {
  background: var(--hub-bg);
  color: var(--hub-text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--hub-card-border);
}

/* Card Action Button */
.portal-action-btn {
  width: 100%;
  padding: 1rem 1.5rem;
  border-radius: var(--hub-radius-md);
  font-size: 1.05rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.25s ease;
}

.card-admin .portal-action-btn {
  background: var(--hub-primary-gradient);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(123, 17, 35, 0.3);
}

.card-admin .portal-action-btn:hover {
  background: linear-gradient(135deg, #9e1830 0%, #680e1e 100%);
  box-shadow: 0 12px 25px rgba(123, 17, 35, 0.45);
  transform: translateY(-2px);
}

.card-cases .portal-action-btn {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
  border: 1px solid var(--hub-gold);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
}

.card-cases .portal-action-btn:hover {
  background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
  box-shadow: 0 12px 25px rgba(197, 141, 96, 0.35);
  transform: translateY(-2px);
}

/* Quick Direct Links */
.portal-sublinks {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  font-size: 0.85rem;
}

.portal-sublinks a {
  color: var(--hub-text-muted);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.portal-sublinks a:hover {
  color: var(--hub-primary);
  text-decoration: underline;
}

[data-theme="dark"] .portal-sublinks a:hover {
  color: var(--hub-gold-light);
}

/* ================== Feature Highlights Grid ================== */
.hub-features-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.hub-feature-box {
  background: var(--hub-card-bg);
  border: 1px solid var(--hub-card-border);
  border-radius: var(--hub-radius-lg);
  padding: 1.75rem;
  box-shadow: var(--hub-shadow-sm);
  transition: transform 0.2s ease;
}

.hub-feature-box:hover {
  transform: translateY(-4px);
  border-color: var(--hub-gold);
}

.hub-feat-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.hub-feature-box h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--hub-text-main);
  margin-bottom: 0.5rem;
}

.hub-feature-box p {
  font-size: 0.85rem;
  color: var(--hub-text-muted);
  line-height: 1.6;
}

/* ================== Footer ================== */
.hub-footer {
  margin-top: auto;
  background: var(--hub-footer-bg);
  color: #94a3b8;
  padding: 2.5rem 0 1.5rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.hub-footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hub-footer-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hub-footer-logo {
  width: auto;
  max-width: 120px;
  height: 44px;
  border-radius: 8px;
  object-fit: contain;
  background: #ffffff;
  padding: 2px 6px;
  border: 1px solid var(--hub-gold);
}

.hub-footer-info h4 {
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 2px;
}

.hub-footer-info p {
  font-size: 0.8rem;
  color: #94a3b8;
}

.hub-footer-links {
  display: flex;
  gap: 1.5rem;
}

.hub-footer-links a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: color 0.2s ease;
}

.hub-footer-links a:hover {
  color: var(--hub-gold-light);
}

.hub-footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  font-size: 0.8rem;
  color: #64748b;
}

/* ================== Responsive Breakpoints ================== */
@media (max-width: 992px) {
  .hub-portals-grid {
    grid-template-columns: 1fr;
  }
  .hub-stats-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .hub-features-row {
    grid-template-columns: 1fr;
  }
  .hub-hero-title {
    font-size: 2.2rem;
  }
}

@media (max-width: 640px) {
  .hub-nav-content {
    flex-direction: column;
    align-items: flex-start;
  }
  .hub-nav-actions {
    width: 100%;
    justify-content: space-between;
  }
  .hub-stats-strip {
    grid-template-columns: 1fr;
  }
  .hub-hero-title {
    font-size: 1.75rem;
  }
  .hub-footer-content {
    flex-direction: column;
    align-items: flex-start;
  }
}
