@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  /* Dark theme colors */
  --primary: #00d4ff;
  --secondary: #7c3aed;
  --accent: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  
  --bg-primary: #0a0a0f;
  --bg-secondary: #1a1a2e;
  --bg-tertiary: #16213e;
  --bg-card: #1e1e2e;
  --bg-hover: #2a2a3e;
  
  --text-primary: #ffffff;
  --text-secondary: #b4b4c8;
  --text-muted: #8b8ba0;
  
  --border: #2a2a3e;
  --border-hover: #3a3a5e;
  
  --gradient-primary: linear-gradient(135deg, #00d4ff, #7c3aed);
  --gradient-secondary: linear-gradient(135deg, #10b981, #00d4ff);
  --gradient-bg: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #16213e 100%);
  
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.3);
  
  --radius: 12px;
  --radius-lg: 16px;
}

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

html, body { 
  height: 100%; 
  font-family: "Inter", sans-serif;
}

body {
  background: var(--gradient-bg);
  color: var(--text-primary);
  overflow-x: hidden;
  position: relative;
}

/* Animated Background */
.animated-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

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

.shape {
  position: absolute;
  background: var(--gradient-primary);
  border-radius: 50%;
  opacity: 0.1;
  animation: float 20s infinite linear;
}

.shape:nth-child(1) {
  width: 80px;
  height: 80px;
  top: 20%;
  left: 10%;
  animation-delay: 0s;
  animation-duration: 25s;
}

.shape:nth-child(2) {
  width: 120px;
  height: 120px;
  top: 60%;
  left: 80%;
  animation-delay: 5s;
  animation-duration: 30s;
}

.shape:nth-child(3) {
  width: 60px;
  height: 60px;
  top: 80%;
  left: 20%;
  animation-delay: 10s;
  animation-duration: 20s;
}

.shape:nth-child(4) {
  width: 100px;
  height: 100px;
  top: 30%;
  left: 70%;
  animation-delay: 15s;
  animation-duration: 35s;
}

.shape:nth-child(5) {
  width: 90px;
  height: 90px;
  top: 10%;
  left: 50%;
  animation-delay: 8s;
  animation-duration: 28s;
}

@keyframes float {
  0% {
    transform: translateY(0px) rotate(0deg);
    opacity: 0.1;
  }
  50% {
    opacity: 0.3;
  }
  100% {
    transform: translateY(-100vh) rotate(360deg);
    opacity: 0;
  }
}

/* Grid pattern overlay */
.grid-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(0, 212, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  z-index: -1;
  opacity: 0.3;
  animation: gridMove 60s linear infinite;
}

@keyframes gridMove {
  0% { transform: translate(0, 0); }
  100% { transform: translate(50px, 50px); }
}

/* Utility Classes */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-4 { margin-top: 1rem; }
.p-4 { padding: 1rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }

/* Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(20px);
  background: rgba(10, 10, 15, 0.95);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: all 0.3s ease;
  height: 80px;
}

/* >>> إضافات لضبط التخطيط ومنع التراكب <<< */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
/* اعرض user-menu كـ flex أفقيًا بمحاذاة صحيحة */
.user-menu {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
/* تأكد أن زر اللغة داخل الهيدر غير مطلق التموضع */
header .lang-btn {
  position: relative !important;
  inset: auto !important;
  margin: 0 !important;
  white-space: nowrap;
  height: 36px;
  line-height: 36px;
  padding: 0 .75rem !important;
}
/* القائمة المنسدلة ثابتة بالنسبة للأفاتار */
.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  margin-top: 0;
}

/* Main content adjustment for fixed header */
main {
  margin-top: 80px;
  min-height: calc(100vh - 80px);
  padding: 2rem;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: transform 0.3s ease;
}

.logo-container:hover {
  transform: scale(1.05);
}

.logo-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.5));
}

.logo { 
  font-size: 1.75rem; 
  font-weight: 700; 
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-family: "JetBrains Mono", monospace;
}

nav ul { 
  list-style: none; 
  display: flex; 
  gap: 2rem; 
  align-items: center;
}

nav a { 
  position: relative; 
  font-weight: 500;
  transition: all 0.3s ease;
  color: var(--text-secondary);
  text-decoration: none;
}

nav a:hover {
  color: var(--primary);
  transform: translateY(-2px);
}

nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0%;
  height: 2px;
  background: var(--gradient-primary);
  transition: width 0.3s ease;
}

nav a:hover::after { width: 100%; }

.auth-buttons {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  background: var(--gradient-primary);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text-primary);
}

.btn-secondary:hover {
  border-color: var(--primary);
  background: rgba(0, 212, 255, 0.1);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

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

/* Theme toggle */
.theme-toggle {
  width: 3rem;
  height: 1.5rem;
  background: var(--bg-card);
  border-radius: 1rem;
  position: relative;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.theme-toggle::after {
  content: "🌙";
  position: absolute;
  top: 50%;
  left: 0.25rem;
  transform: translateY(-50%);
  font-size: 0.8rem;
  transition: all 0.3s ease;
}

/* Hero Section */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12rem 2rem 8rem;
  position: relative;
  min-height: 100vh;
  justify-content: center;
}

.hero-content {
  max-width: 800px;
  z-index: 2;
}

.hero h1 {
  font-size: clamp(3rem, 8vw, 6rem);
  margin-bottom: 2rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
  font-weight: 700;
  animation: fadeInUp 1s ease-out;
}

.hero p { 
  font-size: 1.25rem; 
  margin-bottom: 3rem; 
  color: var(--text-secondary);
  line-height: 1.6;
  animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-buttons {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
  animation: fadeInUp 1s ease-out 0.4s both;
}

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

/* AI Elements */
.ai-elements {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.circuit-line {
  position: absolute;
  background: var(--gradient-primary);
  height: 2px;
  opacity: 0.3;
  animation: circuitFlow 3s ease-in-out infinite;
}

.circuit-line:nth-child(1) {
  top: 20%;
  left: 10%;
  width: 200px;
  animation-delay: 0s;
}

.circuit-line:nth-child(2) {
  top: 60%;
  right: 10%;
  width: 150px;
  animation-delay: 1s;
}

.circuit-line:nth-child(3) {
  bottom: 30%;
  left: 20%;
  width: 180px;
  animation-delay: 2s;
}

@keyframes circuitFlow {
  0%, 100% { opacity: 0.3; transform: scaleX(1); }
  50% { opacity: 0.8; transform: scaleX(1.2); }
}

/* Sections */
section { 
  padding: 8rem 2rem; 
  max-width: 1200px; 
  margin: 0 auto; 
  position: relative;
}

section h2 {
  text-align: center;
  font-size: 3rem;
  margin-bottom: 4rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
  font-weight: 700;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.card:hover::before {
  opacity: 1;
}

/* About Section */
.about-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.about-card {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.about-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

.about-card h3 {
  color: var(--primary);
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.about-card p {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Customers Section */
.customers-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-top: 3rem;
}

.customer-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.customer-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent, var(--primary), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  animation: rotate 3s linear infinite;
}

.customer-card:hover::before {
  opacity: 0.1;
}

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

.customer-logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: bold;
  color: white;
  position: relative;
  z-index: 2;
}

.customer-logo-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  object-fit: cover;
  position: relative;
  z-index: 2;
  border: 2px solid var(--border);
  transition: all 0.3s ease;
}

.customer-card:hover .customer-logo-img {
  border-color: var(--primary);
  transform: scale(1.1);
}

.customer-card h3 {
  color: var(--primary);
  margin-bottom: 1rem;
  font-size: 1.25rem;
  position: relative;
  z-index: 2;
}

.customer-card p {
  color: var(--text-secondary);
  line-height: 1.6;
  position: relative;
  z-index: 2;
}

@keyframes rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Pricing Section */
.pricing-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  margin-top: 3rem;
}

.pricing-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.pricing-card.featured {
  border-color: var(--primary);
  transform: scale(1.05);
  box-shadow: var(--shadow-glow);
}

.pricing-card.featured::before {
  content: "Most Popular";
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gradient-primary);
  color: white;
  padding: 0.5rem 1.5rem;
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 600;
}

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

.pricing-card.featured:hover {
  transform: scale(1.05) translateY(-8px);
}

.plan-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--primary);
}

.plan-price {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.plan-period {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.plan-features {
  list-style: none;
  margin-bottom: 2rem;
  text-align: left;
}

.plan-features li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  position: relative;
  padding-left: 1.5rem;
}

/* removed tick overlay */

.plan-features li:last-child {
  border-bottom: none;
}

/* Contact Section */
.contact-container {
  display: grid;
  gap: 4rem;
  grid-template-columns: 1fr 1fr;
  align-items: start;
}

.contact-form {
  background: var(--bg-card);
  padding: 3rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.contact-info {
  background: var(--bg-card);
  padding: 3rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.map-container {
  width: 100%;
  height: 300px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-top: 2rem;
}

.map-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  filter: invert(90%) hue-rotate(180deg);
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
}

.form-input {
  width: 100%;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
  background: var(--bg-primary);
}

.form-input::placeholder {
  color: var(--text-muted);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem;
  width: 90%;
  max-width: 450px;
  box-shadow: var(--shadow-lg);
  animation: modalSlideIn 0.3s ease;
  position: relative;
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(-30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.modal-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.modal-close:hover {
  color: var(--text-primary);
}

/* User Menu */
.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.user-avatar:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-glow);
}

.user-dropdown {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  z-index: 50;
  overflow: hidden;
}

.user-dropdown a,
.user-dropdown button {
  display: block;
  width: 100%;
  padding: 1rem;
  text-align: left;
  border: none;
  background: none;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.2s ease;
  text-decoration: none;
}

.user-dropdown a:hover,
.user-dropdown button:hover {
  background: var(--bg-hover);
}

/* Dashboard */
.dashboard {
  max-width: 1000px;
  margin: 0 auto;
  padding: 8rem 2rem 2rem;
}

.dashboard-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  margin-bottom: 3rem;
}

.stat-card {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.5rem;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 1rem;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  transition: width 0.3s ease;
  border-radius: 4px;
}

/* Footer */
footer {
  text-align: center;
  padding: 3rem 2rem;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 768px) {
  header { padding: 1rem; }
  nav ul { gap: 1rem; }
  .hero { padding: 8rem 1rem 6rem; }
  .hero-buttons { flex-direction: column; align-items: center; }
  .contact-container { grid-template-columns: 1fr; }
  .pricing-card.featured { transform: none; }
  .pricing-card.featured:hover { transform: translateY(-8px); }
  section { padding: 4rem 1rem; }
  section h2 { font-size: 2rem; }

  /* تأكد من بقاء عناصر اليمين أفقية على الموبايل */
  .header-actions { gap: .5rem; }
  .user-menu { gap: .5rem; }
}

/* Loading States */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Alert Messages */
.alert {
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  border: 1px solid;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--error);
  color: var(--error);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: var(--warning);
  color: var(--warning);
}

/* Scroll animations */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* RTL Support */
[dir="rtl"] {
  text-align: right;
}

[dir="rtl"] .hero-content {
  text-align: center;
}

[dir="rtl"] .about-grid,
[dir="rtl"] .customers-grid,
[dir="rtl"] .pricing-grid {
  direction: rtl;
}

[dir="rtl"] .about-card,
[dir="rtl"] .customer-card,
[dir="rtl"] .pricing-card {
  text-align: right;
}

[dir="rtl"] .contact-container {
  direction: rtl;
}

[dir="rtl"] .contact-form,
[dir="rtl"] .contact-info {
  text-align: right;
}

[dir="rtl"] .form-label {
  text-align: right;
}

[dir="rtl"] .modal {
  text-align: right;
}

[dir="rtl"] .modal-header {
  text-align: center;
}

[dir="rtl"] nav ul {
  direction: rtl;
}

[dir="rtl"] .auth-buttons {
  direction: rtl;
}

[dir="rtl"] .hero-buttons {
  direction: ltr;
  justify-content: center;
}

[dir="rtl"] .user-dropdown {
  right: auto;
  left: 0;
  text-align: right;
}

/* Language toggle button styling */
#lang-toggle {
  margin-right: 0.5rem;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
}

[dir="rtl"] #lang-toggle {
  margin-right: 0;
  margin-left: 0.5rem;
}

/* Dashboard Styles */
.dashboard {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.dashboard-header {
  text-align: center;
  margin-bottom: 3rem;
}

.dashboard-header h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

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

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  margin-top: 1rem;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.card-header h3 {
  margin: 0;
  font-size: 1.25rem;
}

.table-container {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.data-table th,
.data-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 600;
}

.data-table tr:hover {
  background: var(--bg-hover);
}

.btn-small {
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  border-radius: 4px;
  margin-right: 0.5rem;
}

.btn-danger {
  background: var(--error);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-active {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent);
}

.status-pending {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.status-inactive {
  background: rgba(239, 68, 68, 0.2);
  color: var(--error);
}

.status-featured {
  background: rgba(0, 212, 255, 0.2);
  color: var(--primary);
}

.status-normal {
  background: rgba(180, 180, 200, 0.2);
  color: var(--text-secondary);
}

.role-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: capitalize;
}

.role-admin {
  background: rgba(239, 68, 68, 0.2);
  color: var(--error);
}

.role-employee {
  background: rgba(0, 212, 255, 0.2);
  color: var(--primary);
}

.role-customer {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent);
}

.subscription-info {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
  align-items: start;
}

.subscription-plan h4 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.subscription-features {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.feature-item {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.usage-chart {
  margin-bottom: 2rem;
}

.usage-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.usage-stat {
  display: flex;
  justify-content: space-between;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius);
}

.usage-label {
  color: var(--text-secondary);
}

.usage-value {
  color: var(--text-primary);
  font-weight: 600;
}

.support-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.support-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}

.support-card h4 {
  margin-bottom: 1rem;
  color: var(--primary);
}

.support-card p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.report-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.report-card h4 {
  margin-bottom: 1rem;
  color: var(--primary);
}

.report-card p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .dashboard { padding: 1rem; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .card-header { flex-direction: column; gap: 1rem; align-items: stretch; }
  .subscription-info { grid-template-columns: 1fr; }
  .usage-stats { grid-template-columns: 1fr; }
}

/* Enhanced Pricing Card Styles */
.pricing-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
  overflow: hidden;
}

.pricing-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.pricing-card.featured {
  border: 2px solid var(--primary);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(0, 212, 255, 0.05) 100%);
  transform: scale(1.05);
}

.pricing-card.featured::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
}

.plan-header {
  margin-bottom: 1.5rem;
  position: relative;
}

.plan-emoji {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.plan-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.popular-badge {
  position: absolute;
  top: -1rem;
  right: -1rem;
  background: var(--gradient-primary);
  color: white;
  padding: 0.25rem 1rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  transform: rotate(15deg);
}

.plan-price {
  font-size: 3rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.5rem;
  line-height: 1;
}

.plan-period {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
  text-align: left;
}

.plan-features li {
  padding: 0.5rem 0;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.875rem;
}

.plan-features li:last-child {
  border-bottom: none;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

/* Responsive pricing cards */
@media (max-width: 768px) {
  .pricing-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .pricing-card.featured { transform: none; }
  .plan-price { font-size: 2.5rem; }
}

/* Enhanced Dashboard Styles */
.chart-container { padding: 1rem; min-height: 200px; }
.chart-bar { display: flex; align-items: center; margin-bottom: 0.75rem; gap: 1rem; }
.chart-bar-label { min-width: 80px; font-size: 0.875rem; color: var(--text-secondary); }
.chart-bar-fill { height: 8px; background: var(--gradient-primary); border-radius: 4px; min-width: 4px; flex: 1; max-width: 200px; }
.chart-bar-value { min-width: 60px; text-align: right; font-weight: 500; font-size: 0.875rem; }

.plan-performance-container { padding: 1rem; }
.plan-performance-item { display: flex; justify-content: space-between; align-items: center; padding: 1rem; background: var(--bg-secondary); border-radius: var(--radius); margin-bottom: 0.75rem; border: 1px solid var(--border); }
.plan-name { font-weight: 600; color: var(--text-primary); }
.plan-stats { display: flex; gap: 1rem; font-size: 0.875rem; color: var(--text-secondary); }
.plan-subscriptions { color: var(--primary); }
.plan-revenue { color: var(--accent); font-weight: 500; }

/* Review Cards */
.review-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.review-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.review-author { font-weight: 600; color: var(--text-primary); }
.review-rating { color: var(--warning); }
.review-title { font-weight: 500; color: var(--primary); margin-bottom: 0.5rem; }
.review-content { color: var(--text-secondary); margin-bottom: 1rem; line-height: 1.5; }
.review-meta { display: flex; gap: 1rem; margin-bottom: 1rem; font-size: 0.875rem; }
.review-date { color: var(--text-muted); }
.review-status.approved { color: var(--accent); }
.review-status.pending { color: var(--warning); }
.review-featured { color: var(--primary); font-weight: 500; }
.review-actions { display: flex; gap: 0.5rem; }

/* Plan Cards */
.plan-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.plan-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.plan-header h3 { color: var(--primary); margin: 0; }
.plan-price { font-weight: 600; color: var(--accent); }
.plan-description { color: var(--text-secondary); margin-bottom: 1rem; }
.plan-features { margin-bottom: 1rem; }
.feature-item { color: var(--text-secondary); margin-bottom: 0.25rem; font-size: 0.875rem; }
.plan-actions { display: flex; gap: 0.5rem; }

/* Role and Status Badges */
.role-badge { padding: 0.25rem 0.5rem; border-radius: 4px; font-size: 0.75rem; font-weight: 500; text-transform: uppercase; }
.role-admin { background: rgba(239, 68, 68, 0.2); color: var(--error); }
.role-employee { background: rgba(16, 185, 129, 0.2); color: var(--accent); }
.role-customer { background: rgba(0, 212, 255, 0.2); color: var(--primary); }

.status-badge { padding: 0.25rem 0.5rem; border-radius: 4px; font-size: 0.75rem; font-weight: 500; }
.status-badge.verified { background: rgba(16, 185, 129, 0.2); color: var(--accent); }
.status-badge.unverified { background: rgba(245, 158, 11, 0.2); color: var(--warning); }

/* Button Variants */
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.875rem; border-radius: 6px; }
.btn-danger { background: var(--error); color: white; border: none; }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: var(--accent); color: white; border: none; }
.btn-success:hover { background: #059669; }
.btn-warning { background: var(--warning); color: white; border: none; }
.btn-warning:hover { background: #d97706; }

/* Dashboard Grid Responsive */
@media (max-width: 768px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .chart-container { min-height: 150px; }
  .plan-performance-item { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .review-header { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
  .review-actions { flex-wrap: wrap; }
}

/* Language Button Styles */
.lang-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  color: white !important;
  border: none !important;
  border-radius: 25px !important;
  padding: 0.5rem 1rem !important;
  font-weight: 600 !important;
  font-size: 0.875rem !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3) !important;
  position: relative !important;
  overflow: hidden !important;
  margin-right: 1rem !important;
}

.lang-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s;
}

.lang-btn:hover::before { left: 100%; }

.lang-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5) !important;
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%) !important;
}

.lang-btn:active {
  transform: translateY(0) !important;
  box-shadow: 0 2px 10px rgba(102, 126, 234, 0.4) !important;
}

/* User menu language button */
#lang-toggle-user {
  margin-right: 1rem !important;
  margin-bottom: 0 !important; /* كان ممكن يسبب نزول تحت الأفاتار */
}

/* RTL adjustments for language buttons */
[dir="rtl"] .lang-btn {
  margin-right: 0 !important;
  margin-left: 1rem !important;
}

[dir="rtl"] #lang-toggle-user {
  margin-right: 0 !important;
  margin-left: 1rem !important;
}

/* Responsive language button */
@media (max-width: 768px) {
  .lang-btn {
    padding: 0.4rem 0.8rem !important;
    font-size: 0.8rem !important;
    margin-right: 0.5rem !important;
  }
  [dir="rtl"] .lang-btn {
    margin-right: 0 !important;
    margin-left: 0.5rem !important;
  }
}

/* Animation for language button text change */
.lang-btn { animation: langButtonPulse 2s ease-in-out infinite; }
@keyframes langButtonPulse {
  0%, 100% { box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3); }
  50% { box-shadow: 0 4px 20px rgba(102, 126, 234, 0.5); }
}

/* Enlarged Logo Styles */
.logo-img-large {
  width: 60px !important;
  height: 60px !important;
  object-fit: contain;
  filter: drop-shadow(0 0 15px rgba(0, 212, 255, 0.6));
  transition: all 0.3s ease;
}

.logo-img-large:hover {
  filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.8));
  transform: scale(1.1);
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
  padding: 0.5rem;
}

.logo-container:hover { transform: scale(1.05); }

@media (max-width: 768px) {
  .logo-img-large { width: 50px !important; height: 50px !important; }
}
@media (max-width: 480px) {
  .logo-img-large { width: 45px !important; height: 45px !important; }
}

/* =========================
   ICONS FOR BUTTONS (ADDED)
   ========================= */
.btn:not(.no-icon) { padding-left: 2.25rem; }
.btn:not(.no-icon)::after {
  content: "➜";
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  opacity: 0.9;
  pointer-events: none;
}

/* Password row */
.password-row { display: flex; gap: 0.5rem; align-items: center; }
.password-row .form-input { flex: 1; min-width: 0; }
.password-row .btn-sm { height: 44px; white-space: nowrap; }

[dir="rtl"] .password-row { flex-direction: row-reverse; }

.no-icon::before { content: none !important; display: none !important; }

.link-btn {
  background: none;
  border: 0;
  color: var(--text-secondary);
  text-decoration: underline;
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.link-btn:hover { color: var(--primary); }
html { scroll-behavior: smooth; }
#employees, #users, #plans, #reviews, #messages { scroll-margin-top: 100px; }
