/* ==========================================================================
   VCARD PRO LUXURY DESIGN SYSTEM (Dark Obsidian, Royal Navy & Champagne Gold)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&family=Outfit:wght@400;600;700;800&family=Tajawal:wght@300;400;500;700;900&display=swap');

:root {
  --bg-primary: #060913;
  --bg-secondary: #0A0F1F;
  --bg-card: rgba(13, 20, 38, 0.82);
  --bg-card-hover: rgba(20, 31, 56, 0.92);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --surface-border: rgba(212, 175, 55, 0.22);
  --surface-border-strong: rgba(212, 175, 55, 0.55);

  --gold-100: #FFF6D6;
  --gold-200: #FCE69B;
  --gold-300: #EAC460;
  --gold-400: #D4AF37;
  --gold-500: #B8860B;
  --gold-600: #8C6207;

  --gold-gradient: linear-gradient(135deg, #FFF2BD 0%, #D4AF37 45%, #AA771C 100%);
  --gold-gradient-soft: linear-gradient(135deg, rgba(255, 242, 189, 0.15) 0%, rgba(212, 175, 55, 0.08) 100%);
  
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-gold: #ECC880;
  --emerald: #10B981;
  --cyan: #38BDF8;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 30px;
  --radius-full: 9999px;

  --shadow-luxury: 0 25px 60px -15px rgba(0, 0, 0, 0.85), 0 0 35px -5px rgba(212, 175, 55, 0.12);
  --shadow-gold-glow: 0 0 25px rgba(212, 175, 55, 0.35);
  
  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: 'Tajawal', 'Cairo', sans-serif;
  min-height: 100vh;
  line-height: 1.6;
  direction: rtl;
}

/* Ambient glow backgrounds */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-sphere {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.3;
  animation: ambientFloat 18s ease-in-out infinite alternate;
}

.sphere-1 {
  top: -100px;
  right: -50px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #D4AF37 0%, rgba(212, 175, 55, 0) 70%);
  opacity: 0.22;
}

.sphere-2 {
  top: 40%;
  left: -120px;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, #1E3A8A 0%, rgba(30, 58, 138, 0) 70%);
  opacity: 0.3;
}

@keyframes ambientFloat {
  0% { transform: translateY(0) scale(1); }
  50% { transform: translateY(30px) scale(1.05); }
  100% { transform: translateY(-20px) scale(0.95); }
}

/* Base Navigation Bar */
.platform-navbar {
  background: rgba(10, 15, 30, 0.85);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--surface-border);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #FFF;
}

.brand-icon-logo {
  width: 36px;
  height: 36px;
  background: var(--gold-gradient);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #1A1202;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

.brand-text {
  font-family: 'Cairo', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.3px;
}

.brand-badge {
  font-size: 0.65rem;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid var(--gold-400);
  color: var(--gold-200);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-weight: 700;
}

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

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
  color: var(--gold-200);
  background: rgba(212, 175, 55, 0.08);
}

.nav-btn {
  background: var(--gold-gradient);
  color: #1A1202;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.86rem;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.nav-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(212, 175, 55, 0.5);
}

/* ==========================================================================
   CARDS & KPI STATS (DASHBOARD & ANALYTICS)
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-fast);
}

.kpi-card:hover {
  border-color: var(--gold-400);
  transform: translateY(-3px);
  box-shadow: var(--shadow-luxury);
}

.kpi-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: var(--gold-gradient);
  opacity: 0.7;
}

.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.kpi-title {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.kpi-icon.views { background: rgba(56, 189, 248, 0.15); color: #38BDF8; }
.kpi-icon.downloads { background: rgba(16, 185, 129, 0.15); color: #10B981; }
.kpi-icon.conversion { background: rgba(212, 175, 55, 0.15); color: var(--gold-300); }
.kpi-icon.leads { background: rgba(168, 85, 247, 0.15); color: #C084FC; }

.kpi-value {
  font-size: 1.9rem;
  font-weight: 900;
  color: #FFF;
  font-family: 'Outfit', sans-serif;
  line-height: 1.1;
  margin-bottom: 6px;
}

.kpi-subtext {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.kpi-trend-up {
  color: #10B981;
  font-weight: 700;
}

/* Dashboard Panels */
.dashboard-panel {
  background: var(--bg-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.panel-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #FFF;
  font-family: 'Cairo', sans-serif;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Legends & Chart Helpers */
.chart-legend-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-left: 8px;
}

.legend-text {
  color: var(--text-muted);
  flex: 1;
}

.legend-val {
  color: #FFF;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
}

/* Form Styles */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold-300);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  background: rgba(14, 21, 38, 0.9);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: #FFF;
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-control:focus {
  border-color: var(--gold-400);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.25);
}

/* Tables */
.luxury-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.luxury-table th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--gold-300);
  text-align: right;
  padding: 12px 16px;
  font-weight: 700;
  border-bottom: 1px solid var(--surface-border);
}

.luxury-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #E2E8F0;
}

.luxury-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Toast System */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(14, 22, 40, 0.96);
  border: 1px solid var(--gold-400);
  color: #FFF;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-luxury);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  z-index: 2000;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
  opacity: 0;
  pointer-events: none;
}

.toast-container.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE ADAPTATIONS (Comprehensive Scalability)
   ========================================================================== */

/* Universal Responsive Table Wrapper */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 16px;
}

/* Tablet Screens (max-width: 1024px) */
@media (max-width: 1024px) {
  .platform-navbar {
    padding: 12px 18px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
}

/* Mobile Devices (max-width: 768px) */
@media (max-width: 768px) {
  .platform-navbar {
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .brand-text {
    font-size: 1.05rem;
  }

  .nav-links {
    gap: 8px;
    flex-wrap: wrap;
  }

  .nav-link {
    font-size: 0.8rem;
    padding: 5px 8px;
  }

  .nav-btn {
    padding: 7px 14px;
    font-size: 0.8rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 18px;
  }

  .kpi-card {
    padding: 14px 12px;
  }

  .kpi-value {
    font-size: 1.5rem;
  }

  .kpi-icon {
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
  }

  .dashboard-panel {
    padding: 16px 14px;
    border-radius: var(--radius-md);
  }

  .panel-header {
    margin-bottom: 14px;
  }

  .panel-title {
    font-size: 1rem;
  }

  .luxury-table th, .luxury-table td {
    padding: 10px 12px;
    font-size: 0.78rem;
  }

  .form-control {
    font-size: 0.84rem;
    padding: 9px 12px;
  }
}

/* Compact Mobile Screens (max-width: 480px) */
@media (max-width: 480px) {
  .brand-badge {
    display: none;
  }

  .platform-navbar {
    padding: 8px 10px;
  }

  .brand-icon-logo {
    width: 30px;
    height: 30px;
    font-size: 1rem;
  }

  .brand-text {
    font-size: 0.95rem;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .kpi-card {
    padding: 10px 8px;
  }

  .kpi-title {
    font-size: 0.72rem;
  }

  .kpi-value {
    font-size: 1.35rem;
  }

  .kpi-subtext {
    font-size: 0.66rem;
  }
}
