@import url("https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800;900&family=Outfit:wght@400;500;700;900&display=swap");

:root {
  --background: 224 71% 4%;
  --foreground: 213 31% 91%;
  --card: 224 71% 6%;
  --card-foreground: 213 31% 91%;
  --primary: 217 91% 60%;
  --primary-rgb: 59, 130, 246;
  --primary-foreground: 222 47% 11%;
  --muted: 223 47% 11%;
  --muted-foreground: 215 20% 65%;
  --border: 216 34% 17%;
  --radius: 1.5rem;
  --font-tajawal: 'Tajawal', sans-serif;
  --font-outfit: 'Outfit', sans-serif;
}

.light-theme {
  --background: 220 33% 98%;
  --foreground: 224 71% 4%;
  --card: 0 0% 100%;
  --card-foreground: 224 71% 4%;
  --primary: 221 83% 53%;
  --primary-rgb: 37, 99, 235;
  --primary-foreground: 210 40% 98%;
  --muted: 210 40% 96%;
  --muted-foreground: 215 16% 47%;
  --border: 214 32% 91%;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-color: hsl(var(--border));
}

html, body {
  font-family: var(--font-tajawal);
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  min-height: 100vh;
  overflow-x: hidden;
  direction: rtl;
  text-align: right;
  scroll-behavior: smooth;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* Background Gradients */
.bg-ocean-gradient {
  position: relative;
  background: radial-gradient(circle at top right, rgba(var(--primary-rgb), 0.08), transparent),
              radial-gradient(circle at bottom left, rgba(var(--primary-rgb), 0.04), transparent),
              hsl(var(--background));
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: -1;
  opacity: 0.6;
}

/* Layout Elements */
.container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background-color: rgba(var(--background), 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all 0.3s ease;
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.2rem;
  list-style: none;
}

.nav-links a {
  color: hsl(var(--foreground));
  opacity: 0.7;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  position: relative;
  padding-bottom: 0.25rem;
}

.nav-links a:hover {
  opacity: 1;
  color: hsl(var(--primary));
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: hsl(var(--primary));
  transition: width 0.3s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

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

/* Glass Card */
.glass-card {
  background-color: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border-radius: var(--radius);
  transition: all 0.3s ease;
}

.light-theme .glass-card {
  background-color: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(0, 0, 0, 0.07);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.06);
}

.glass-card:hover {
  border-color: rgba(var(--primary-rgb), 0.3);
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.3);
}

/* Typography elements */
h1, h2, h3, h4, h5, h6 {
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.text-gradient {
  background: linear-gradient(to left, hsl(var(--primary)), #3b82f6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-muted {
  color: hsl(var(--muted-foreground));
  font-weight: 500;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0.8rem 1.6rem;
  border: none;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 1.1rem 2.2rem;
  font-size: 1.1rem;
}

.btn-primary {
  background-color: hsl(var(--primary));
  color: #fff;
  box-shadow: 0 10px 25px -5px rgba(var(--primary-rgb), 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px -5px rgba(var(--primary-rgb), 0.5);
  background-color: rgba(var(--primary-rgb), 0.95);
}

.btn-outline {
  background: transparent;
  color: hsl(var(--foreground));
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.btn-outline:hover {
  transform: translateY(-2px);
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(var(--primary-rgb), 0.4);
}

.light-theme .btn-outline {
  border-color: rgba(0, 0, 0, 0.1);
}

.light-theme .btn-outline:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

.btn-ghost {
  background: transparent;
  color: hsl(var(--foreground));
  padding: 0.5rem;
  opacity: 0.8;
}

.btn-ghost:hover {
  opacity: 1;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
}

/* Animations */
.animate-float {
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-15px); }
}

.animate-pulse-slow {
  animation: pulse 6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 800;
  border: 1px solid transparent;
}

.badge-primary {
  background-color: rgba(var(--primary-rgb), 0.1);
  color: hsl(var(--primary));
  border-color: rgba(var(--primary-rgb), 0.2);
}

.badge-green {
  background-color: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.2);
}

.badge-orange {
  background-color: rgba(249, 115, 22, 0.1);
  color: #f97316;
  border-color: rgba(249, 115, 22, 0.2);
}

/* Hamburguer mobile menu */
.menu-btn {
  display: none;
  cursor: pointer;
  background: none;
  border: none;
  color: hsl(var(--foreground));
}

/* Hero Section */
.hero-section {
  padding-top: 8rem;
  padding-bottom: 5rem;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

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

.hero-content {
  text-align: right;
}

.hero-visual {
  display: flex;
  justify-content: center;
  position: relative;
}

.hero-visual-card {
  position: relative;
  padding: 1rem;
  border-radius: 3rem;
  transform: rotate(2deg);
  transition: transform 0.6s ease;
}

.hero-visual-card:hover {
  transform: rotate(0deg);
}

.hero-visual-card img {
  width: 100%;
  max-width: 580px;
  border-radius: 2.2rem;
  display: block;
}

.floating-card {
  position: absolute;
  padding: 1.2rem;
  border-radius: 1.5rem;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.floating-growth {
  top: -2.5rem;
  left: -2.5rem;
  animation: float 5s ease-in-out infinite;
}

.floating-ai {
  bottom: -2rem;
  right: -2rem;
  animation: float 6s ease-in-out infinite 1s;
}

/* Grid configs */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
}

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

/* Utility classes */
.w-full { width: 100%; }

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: 90%;
  max-width: 550px;
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
}

.close-modal {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: hsl(var(--foreground));
  opacity: 0.6;
}

.close-modal:hover {
  opacity: 1;
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media(max-width: 600px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 700;
}

.form-input {
  background-color: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.75rem;
  padding: 0.8rem 1rem;
  color: #fff;
  font-family: var(--font-tajawal);
  font-weight: 500;
  transition: all 0.3s ease;
}

.light-theme .form-input {
  background-color: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.1);
  color: #000;
}

.form-input:focus {
  border-color: hsl(var(--primary));
  outline: none;
  background-color: rgba(255,255,255,0.08);
}

/* Mobile Sidebar Menu */
.sidebar {
  position: fixed;
  top: 0;
  left: -300px;
  bottom: 0;
  width: 300px;
  background-color: rgba(10, 15, 30, 0.95);
  backdrop-filter: blur(20px);
  z-index: 99;
  border-right: 1px solid rgba(255,255,255,0.1);
  padding: 6rem 2rem 2rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  transition: left 0.4s cubic-bezier(0.1, 0.9, 0.2, 1);
}

.sidebar.active {
  left: 0;
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  list-style: none;
}

.sidebar-links a {
  color: hsl(var(--foreground));
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 700;
}

/* Custom styles for footer */
footer {
  margin-top: 8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 5rem;
  padding-bottom: 3rem;
  background-color: rgba(0, 0, 0, 0.2);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 4rem;
}

@media(max-width: 992px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

.footer-links a {
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: hsl(var(--primary));
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-btn {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--muted-foreground));
  transition: all 0.3s ease;
}

.social-btn:hover {
  background-color: hsl(var(--primary));
  color: #fff;
}

/* Chat Assistant box styles */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 520px;
  overflow: hidden;
  border-radius: 2rem;
}

.chat-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(var(--primary-rgb), 0.05);
}

.chat-body {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.chat-message {
  display: flex;
  gap: 1rem;
  max-width: 80%;
}

.chat-message.user {
  align-self: flex-start;
  flex-direction: row-reverse;
}

.chat-message.assistant {
  align-self: flex-end;
}

.chat-bubble {
  padding: 1.2rem 1.5rem;
  border-radius: 1.5rem;
  font-weight: 500;
  line-height: 1.6;
}

.chat-message.user .chat-bubble {
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top-right-radius: 0;
}

.chat-message.assistant .chat-bubble {
  background-color: hsl(var(--primary));
  color: #fff;
  border-top-left-radius: 0;
  box-shadow: 0 10px 20px rgba(var(--primary-rgb), 0.15);
}

/* Table Style for download.html */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 1.5rem;
  text-align: right;
}

tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Responsiveness */
@media(max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }
  .hero-content {
    text-align: center;
  }
  .nav-links {
    display: none;
  }
  .nav-actions .btn-sm:not(.menu-btn) {
    display: none;
  }
  .menu-btn {
    display: block;
  }
  .grid-3 {
    grid-template-columns: 1fr 1fr;
  }
  .grid-4 {
    grid-template-columns: 1fr 1fr;
  }
}

@media(max-width: 768px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
  h1 { font-size: 2.2rem !important; }
  h2 { font-size: 1.8rem !important; }
  .hero-section { padding-top: 6rem; }
}
