/* ==========================================================================
   المجال الإلكتروني - Almajal Electronic
   Modern RTL Design System & Stylesheet
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --font-primary: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Color Palette */
  --bg-dark: #090d16;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --surface-glow: rgba(37, 99, 235, 0.15);
  
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #60a5fa;
  --accent: #06b6d4;
  --accent-gold: #f59e0b;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --border: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(37, 99, 235, 0.3);
  
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(6, 182, 212, 0.25);
  
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

body {
  font-family: var(--font-primary);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  direction: rtl;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(37, 99, 235, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 75%, rgba(6, 182, 212, 0.1) 0%, transparent 40%);
  background-attachment: fixed;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-fast);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 90%;
  max-width: 1240px;
  margin: 0 auto;
}

.section-padding {
  padding: 100px 0;
}

/* Typography & Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid var(--border-highlight);
  color: var(--primary-light);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
}

.section-title-wrap {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 60px;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin: 16px 0;
  background: linear-gradient(135deg, #ffffff 30%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1rem;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(6, 182, 212, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* Header & Navbar */
.navbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1000;
  padding: 20px 0;
  transition: var(--transition-smooth);
}

.navbar.scrolled {
  padding: 12px 0;
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

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

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.4rem;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.brand-text span {
  color: var(--accent);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-link {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  position: relative;
  padding: 4px 0;
}

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

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: var(--transition-fast);
  border-radius: 2px;
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

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

.menu-toggle {
  display: none;
  font-size: 1.5rem;
  color: var(--text-main);
  padding: 8px;
}

/* Mobile Nav Overlay */
@media (max-width: 991px) {
  .menu-toggle {
    display: block;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: #0d1322;
    flex-direction: column;
    align-items: flex-start;
    padding: 90px 30px 40px;
    gap: 24px;
    box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    transition: var(--transition-smooth);
    border-left: 1px solid var(--border);
  }

  .nav-menu.active {
    right: 0;
  }

  .nav-actions .btn-contact {
    display: none;
  }
}

/* Hero Section */
.hero {
  padding-top: 170px;
  padding-bottom: 100px;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero-title {
  font-size: 3.4rem;
  font-weight: 900;
  line-height: 1.25;
  margin: 20px 0;
}

.hero-title .highlight {
  background: linear-gradient(135deg, #60a5fa 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 36px;
  line-height: 1.8;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.hero-stats {
  display: flex;
  gap: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  width: 100%;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-number span {
  color: var(--accent);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Hero Visual Showcase */
.hero-visual {
  position: relative;
}

.hero-card-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.25) 0%, rgba(37, 99, 235, 0.05) 70%);
  filter: blur(50px);
  z-index: 0;
}

.hero-main-card {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
}

.hero-img-wrap {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.hero-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.hero-main-card:hover img {
  transform: scale(1.03);
}

.hero-card-floating {
  position: absolute;
  bottom: -20px;
  right: -20px;
  background: rgba(13, 19, 34, 0.9);
  border: 1px solid var(--border-highlight);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 2;
}

.floating-icon {
  width: 44px;
  height: 44px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-gold);
  font-size: 1.3rem;
}

.floating-text h4 {
  font-size: 0.95rem;
  color: var(--text-main);
}

.floating-text p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Products Section */
.products-section {
  position: relative;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: blur(16px);
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-8px);
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-glow);
}

.product-image-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  cursor: pointer;
}

.product-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-card:hover .product-image-container img {
  transform: scale(1.08);
}

.expand-overlay {
  position: absolute;
  inset: 0;
  background: rgba(9, 13, 22, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: white;
  opacity: 0;
  transition: var(--transition-fast);
  backdrop-filter: blur(4px);
}

.product-image-container:hover .expand-overlay {
  opacity: 1;
}

.expand-icon {
  width: 48px;
  height: 48px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.5);
}

.expand-text {
  font-size: 0.85rem;
  font-weight: 600;
}

.product-badge-tag {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(9, 13, 22, 0.75);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  backdrop-filter: blur(8px);
}

.product-info {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-main);
}

.product-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 20px;
  line-height: 1.6;
}

.product-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  margin-top: auto;
}

.spec-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.product-footer-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.btn-expand-trigger {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.btn-expand-trigger:hover {
  color: var(--primary-light);
  gap: 10px;
}

/* Lightbox Modal (Expand Image) */
.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(5, 8, 15, 0.92);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-modal.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  position: relative;
  max-width: 900px;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  transform: scale(0.92);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
}

.lightbox-modal.active .lightbox-content {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: white;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: var(--transition-fast);
}

.lightbox-close:hover {
  background: rgba(239, 68, 68, 0.8);
  border-color: transparent;
  transform: rotate(90deg);
}

.lightbox-image-wrap {
  width: 100%;
  height: 100%;
  min-height: 380px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lightbox-details {
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.lightbox-category {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.lightbox-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 14px;
}

.lightbox-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 24px;
}

.lightbox-meta {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 28px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.9rem;
}

.meta-row:last-child {
  border-bottom: none;
}

.meta-label {
  color: var(--text-muted);
}

.meta-val {
  font-weight: 700;
  color: var(--text-main);
}

@media (max-width: 768px) {
  .lightbox-content {
    grid-template-columns: 1fr;
    max-height: 85vh;
    overflow-y: auto;
  }
  .lightbox-image-wrap {
    min-height: 240px;
    height: 240px;
  }
}

/* Features / Services Section */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.feature-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 32px 24px;
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  transition: var(--transition-smooth);
}

.feature-box:hover {
  border-color: var(--border-highlight);
  transform: translateY(-5px);
  background: var(--bg-card-hover);
}

.feature-icon {
  width: 56px;
  height: 56px;
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 1.6rem;
  margin-bottom: 20px;
}

.feature-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.feature-text {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Contact Strip Banner */
.contact-banner {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.15) 0%, rgba(6, 182, 212, 0.15) 100%);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  padding: 48px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  backdrop-filter: blur(16px);
  margin-top: 40px;
}

.banner-content h3 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.banner-content p {
  color: var(--text-muted);
}

.banner-contacts {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .contact-banner {
    flex-direction: column;
    text-align: center;
  }
  .banner-contacts {
    justify-content: center;
  }
}

/* Footer */
.footer {
  background: #05080f;
  border-top: 1px solid var(--border);
  padding-top: 70px;
  padding-bottom: 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 48px;
  margin-bottom: 60px;
}

.footer-about p {
  color: var(--text-muted);
  margin-top: 16px;
  font-size: 0.95rem;
  line-height: 1.7;
}

.footer-col-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-main);
  position: relative;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.footer-links a:hover {
  color: var(--accent);
  padding-right: 6px;
}

.footer-contact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.contact-item-icon {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-dim);
  font-size: 0.875rem;
}

.footer-domain {
  color: var(--accent);
  font-weight: 700;
}

@media (max-width: 991px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-content {
    align-items: center;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .hero-stats {
    justify-content: center;
  }

  .hero-card-floating {
    right: 50%;
    transform: translateX(50%);
    bottom: -30px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 576px) {
  .hero-title {
    font-size: 2rem;
  }

  .section-title {
    font-size: 1.8rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}
