:root {
  --primary: #667eea;
  --secondary: #764ba2;
  --gradient: linear-gradient(135deg, var(--primary), var(--secondary));
  --white: #ffffff;
  --text: #1a202c;
  --muted: #64748b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --light-bg: #f8fafc;
  --border: #e2e8f0;
}

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

body {
  font-family: 'Cairo', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--gradient);
  min-height: 100vh;
  color: var(--text);
  direction: rtl;
  line-height: 1.6;
}

/* موحد الحاوي */
.unified-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

/* موحد التنقل */
.unified-nav {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 15px 20px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.unified-nav a {
  color: white;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.15);
  font-weight: 600;
  transition: all 0.3s ease;
  font-size: 14px;
}

.unified-nav a:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

/* موحد الهيدر */
.unified-header {
  text-align: center;
  color: white;
  padding: 30px 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  margin-bottom: 25px;
  backdrop-filter: blur(10px);
}

.unified-header h1 {
  font-size: 2.2rem;
  margin-bottom: 10px;
  font-weight: 800;
}

.unified-header p {
  font-size: 1.1rem;
  opacity: 0.9;
  line-height: 1.5;
}

/* موحد البطاقات */
.unified-card {
  background: var(--white);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  margin-bottom: 25px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.unified-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

/* موحد النماذج */
.unified-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 25px;
}

.unified-form-group {
  display: flex;
  flex-direction: column;
}

.unified-form-group label {
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.unified-form-group input,
.unified-form-group select {
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 16px;
  font-family: inherit;
  transition: all 0.3s ease;
  background: var(--white);
}

.unified-form-group input:focus,
.unified-form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* موحد الأزرار */
.unified-btn-primary {
  width: 100%;
  background: var(--gradient);
  color: white;
  border: none;
  padding: 16px 24px;
  border-radius: 50px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.unified-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.unified-back-btn {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 10px 20px;
  border-radius: 25px;
  text-decoration: none;
  margin-bottom: 20px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.unified-back-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  color: white;
  text-decoration: none;
  transform: translateY(-2px);
}

/* موحد النتائج */
.unified-results {
  display: none;
  animation: fadeIn 0.5s ease;
}

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

.unified-success-message {
  background: linear-gradient(135deg, var(--success), #059669);
  color: white;
  padding: 15px 20px;
  border-radius: 15px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.unified-result-card {
  background: var(--light-bg);
  border: 2px solid var(--border);
  border-radius: 15px;
  padding: 20px;
  margin: 15px 0;
  text-align: center;
}

.unified-result-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 5px;
}

.unified-result-label {
  color: var(--muted);
  font-weight: 600;
}

/* موحد الفوتر */
.unified-footer {
  margin-top: 40px;
  text-align: center;
  color: white;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 20px;
  padding: 25px;
  backdrop-filter: blur(5px);
}

.unified-footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin: 15px 0;
}

.unified-footer-links a {
  color: white;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.3s ease;
  font-size: 14px;
}

.unified-footer-links a:hover {
  opacity: 1;
  text-decoration: underline;
}

/* أزرار عائمة موحدة */
.unified-whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  background: #25d366;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.4);
  z-index: 1000;
  text-decoration: none;
  transition: all 0.3s ease;
}

.unified-whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 25px rgba(37, 211, 102, 0.6);
  color: white;
}

.unified-back-to-top {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 45px;
  height: 45px;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  z-index: 999;
  cursor: pointer;
  transition: all 0.3s ease;
}

.unified-back-to-top:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.5);
}

/* تجاوب الجوال */
@media (max-width: 768px) {
  .unified-container {
    padding: 15px;
  }
  
  .unified-header h1 {
    font-size: 1.8rem;
  }
  
  .unified-form-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .unified-nav {
    padding: 12px 15px;
    gap: 8px;
  }
  
  .unified-nav a {
    padding: 6px 12px;
    font-size: 13px;
  }
  
  .unified-whatsapp-float {
    width: 50px;
    height: 50px;
    bottom: 15px;
    right: 15px;
  }
  
  .unified-back-to-top {
    bottom: 80px;
    right: 15px;
    width: 40px;
    height: 40px;
  }
  
  .unified-footer-links {
    gap: 15px;
  }
  
  .unified-footer-links a {
    font-size: 13px;
  }
}

/* أدوات مساعدة */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.hidden { display: none; }
.visible { display: block; }

.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

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