/*
 * Smart Relations Manager – v0.5
 * File: styles.css
 * Role: Global styles for landing page and portal user interface.
 * Data Flow (high-level):
 *   - See README_v0.5.md for full architecture and data flow diagrams.
 * Impacted future releases: v0.6 (logging & validation), v0.7 (portal UX & history views), v0.8 (language & localization), v0.9 (external webhooks & deeper actions), v1.0 (security & hardening), v1.1 (multi-channel), v1.2 (analytics), v1.3 (templates & playbooks), v1.4 (licensing & plans), v1.5 (flow-based conversations).
 */

/* ========== الأساسيات ========== */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #10b981;
  --accent: #f59e0b;
  --dark: #1e293b;
  --light: #f8fafc;
  --gray: #64748b;
  --transition: all 0.3s ease;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Cairo', sans-serif; line-height: 1.6; color: var(--dark); background-color: var(--light); overflow-x: hidden; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.section-title { text-align: center; margin-bottom: 3rem; }
.section-title h2 { font-size: 2.5rem; margin-bottom: 1rem; color: var(--dark); position: relative; display: inline-block; }
.section-title h2::after { content: ''; position: absolute; bottom: -10px; right: 0; width: 80px; height: 4px; background: var(--primary); border-radius: 2px; }
.section-title p { font-size: 1.2rem; color: var(--gray); max-width: 700px; margin: 0 auto; }
.section-pad { padding: 3rem 0; }

/* الهيدر */
header { background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05); position: fixed; top: 0; width: 100%; z-index: 1000; transition: var(--transition); }
.nav-container { display: flex; justify-content: space-between; align-items: center; padding: 1rem 2rem; }
.logo { display: flex; align-items: center; font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.logo i { margin-left: 0.5rem; font-size: 1.8rem; }
.nav-links { display: flex; list-style: none; }
.nav-links li { margin: 0 1rem; }
.nav-links a { text-decoration: none; color: var(--dark); font-weight: 600; transition: var(--transition); position: relative; }
.nav-links a:hover { color: var(--primary); }
.nav-links a::after { content: ''; position: absolute; bottom: -5px; right: 0; width: 0; height: 2px; background: var(--primary); transition: var(--transition); }
.nav-links a:hover::after { width: 100%; }
.cta-button { background: var(--primary); color: #fff; padding: 0.8rem 1.5rem; border-radius: 50px; text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; transition: var(--transition); box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3); }
.cta-button:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4); }
.cta-button i { margin-right: 0.5rem; }

/* البطل */
.hero { background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%); color: #fff; padding: 10rem 0 5rem; margin-top: 70px; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; top: 0; right: 0; width: 100%; height: 100%; background: url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"none\"><path d=\"M0,0 L100,0 L100,100 Z\" fill=\"rgba(255,255,255,0.05)\"/></svg>'); background-size: cover; }
.hero-content { max-width: 1200px; margin: 0 auto; padding: 0 2rem; text-align: center; }
.hero h1 { font-size: 3rem; margin-bottom: 1.5rem; line-height: 1.2; }
.hero p { font-size: 1.3rem; margin-bottom: 2.5rem; max-width: 800px; margin-left: auto; margin-right: auto; opacity: 0.9; }
.hero-buttons { display: flex; justify-content: center; gap: 1rem; margin-bottom: 3rem; flex-wrap: wrap; }
.whatsapp-button { background: #25d366; color: #fff; padding: 0.8rem 1.5rem; border-radius: 50px; text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; transition: var(--transition); box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3); }
.whatsapp-button:hover { background: #128c7e; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4); }
.whatsapp-button i { margin-right: 0.5rem; }
.hero-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; max-width: 900px; margin: 0 auto; }
.stat-card { background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(10px); padding: 1.5rem; border-radius: 15px; text-align: center; transition: var(--transition); border: 1px solid rgba(255, 255, 255, 0.2); }
.stat-card:hover { transform: translateY(-5px); background: rgba(255, 255, 255, 0.15); }
.stat-number { display: block; font-size: 2.5rem; font-weight: 700; margin-bottom: 0.5rem; }
.stat-label { font-size: 1rem; opacity: 0.9; }

/* بطاقات الوكلاء */
.agents-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 2rem; margin-top: 2rem; }
.agent-category { background: #fff; border-radius: 15px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08); transition: var(--transition); border: 1px solid #f1f5f9; }
.agent-category:hover { transform: translateY(-10px); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12); }
.category-header { padding: 1.5rem; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #fff; display: flex; align-items: center; }
.category-icon { width: 60px; height: 60px; background: rgba(255, 255, 255, 0.2); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-left: 1rem; font-size: 1.5rem; }
.category-title { font-size: 1.3rem; }
.category-title a { color: #fff; text-decoration: none; }

/* إصلاح لون النص داخل بطاقات الوكلاء (عدم وراثة الأزرق) */
.agent-category .category-description,
.agent-category .examples-grid .example-item div,
.agent-category .agent-comparison .comparison-title,
.agent-category .comparison-stat .label,
.agent-category .category-footer,
.agent-category .agent-count {
  color: var(--dark);
}
.agent-category .comparison-stat .value { color: var(--primary); }

.category-description { padding: 1.5rem; color: var(--gray); line-height: 1.6; }
.examples-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; padding: 0 1.5rem; }
.example-item { display: flex; align-items: center; padding: 0.8rem; border-radius: 8px; transition: var(--transition); background: #f8fafc; }
.example-item:hover { background: #e2e8f0; }
.example-item i { margin-left: 0.5rem; color: var(--primary); }

.agent-comparison { padding: 1.5rem; background: #f8fafc; border-top: 1px solid #e2e8f0; }
.comparison-title { font-size: 1.1rem; margin-bottom: 1rem; color: var(--dark); }
.comparison-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.comparison-stat { text-align: center; padding: 0.8rem; background: #fff; border-radius: 8px; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05); }
.comparison-stat .value { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.3rem; }

.category-footer { padding: 1.5rem; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #e2e8f0; }
.agent-count span { color: var(--primary); }
.secondary-button { color: var(--primary); text-decoration: none; font-weight: 600; display: flex; align-items: center; transition: var(--transition); }
.secondary-button:hover { color: var(--primary-dark); }
.secondary-button i { margin-right: 0.5rem; transition: var(--transition); }
.secondary-button:hover i { transform: translateX(-5px); }

/* التبويبات */
.industries-tabs { background: #fff; border-radius: 15px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08); }
.tab-headers { display: flex; overflow-x: auto; background: #f8fafc; border-bottom: 1px solid #e2e8f0; scrollbar-width: none; }
.tab-headers::-webkit-scrollbar { display: none; }
.tab-header { padding: 1rem 1.5rem; cursor: pointer; white-space: nowrap; transition: var(--transition); border-bottom: 3px solid transparent; font-weight: 600; }
.tab-header.active { color: var(--primary); border-bottom-color: var(--primary); background: #fff; }
.tab-header:hover:not(.active) { background: #e2e8f0; }
.tab-content { display: none; padding: 2rem; }
.tab-content.active { display: block; animation: fadeIn 0.5s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.industry-workflows { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.workflow-item { background: #f8fafc; border-radius: 10px; padding: 1.5rem; transition: var(--transition); border: 1px solid #e2e8f0; }
.workflow-item:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1); background: #fff; }
.workflow-item h4 { display: flex; align-items: center; margin-bottom: 1rem; color: var(--dark); }
.workflow-item h4 i { margin-left: 0.5rem; color: var(--primary); }
.workflow-stats { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.workflow-stat { display: flex; align-items: center; background: #fff; padding: 0.4rem 0.8rem; border-radius: 20px; font-size: 0.8rem; color: var(--gray); box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05); }
.workflow-stat i { margin-left: 0.3rem; color: var(--secondary); }
.workflow-description { color: var(--gray); margin-bottom: 1rem; line-height: 1.5; }
.workflow-link { color: var(--primary); text-decoration: none; font-weight: 600; display: flex; align-items: center; transition: var(--transition); }
.workflow-link:hover { color: var(--primary-dark); }
.workflow-link i { margin-right: 0.5rem; transition: var(--transition); }
.workflow-link:hover i { transform: translateX(-5px); }

/* CTA والفوتر */
.cta-section { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #fff; padding: 5rem 0; text-align: center; }
.cta-container { max-width: 800px; margin: 0 auto; padding: 0 2rem; }
.cta-container h2 { font-size: 2.5rem; margin-bottom: 1rem; }
.cta-container p { font-size: 1.2rem; margin-bottom: 2.5rem; opacity: 0.9; }
.cta-buttons { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }

footer { background: var(--dark); color: #fff; padding: 4rem 0 2rem; }
.footer-container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; }
.footer-col h3 { font-size: 1.3rem; margin-bottom: 1.5rem; position: relative; display: inline-block; }
.footer-col h3::after { content: ''; position: absolute; bottom: -8px; right: 0; width: 40px; height: 3px; background: var(--primary); border-radius: 2px; }
.footer-col p { margin-bottom: 1rem; opacity: 0.8; line-height: 1.6; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 0.8rem; }
.footer-links a, .footer-links li { color: rgba(255, 255, 255, 0.8); text-decoration: none; transition: var(--transition); display: flex; align-items: center; }
.footer-links a:hover { color: #fff; transform: translateX(-5px); }
.footer-links i { margin-left: 0.5rem; }
.social-links { display: flex; gap: 1rem; margin-top: 1.5rem; }
.social-links a { width: 40px; height: 40px; background: rgba(255, 255, 255, 0.1); border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.social-links a:hover { background: var(--primary); transform: translateY(-3px); }
.copyright { text-align: center; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid rgba(255, 255, 255, 0.1); opacity: 0.7; }

/* استجابة */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hero h1 { font-size: 2.2rem; }
  .hero p { font-size: 1.1rem; }
  .section-title h2 { font-size: 2rem; }
  .agents-container { grid-template-columns: 1fr; }
  .hero-buttons, .cta-buttons { flex-direction: column; align-items: center; }
  .hero-buttons a, .cta-buttons a { width: 100%; max-width: 300px; text-align: center; justify-content: center; }
  .category-footer { flex-direction: column; gap: 1rem; text-align: center; }
  .tab-headers { flex-wrap: nowrap; justify-content: flex-start; }
}

/* زر واتساب العائم */
.floating-whatsapp { position: fixed; bottom: 2rem; left: 2rem; width: 60px; height: 60px; background: #25d366; color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4); z-index: 1000; transition: var(--transition); animation: pulse 2s infinite; }
.floating-whatsapp:hover { transform: scale(1.1); box-shadow: 0 6px 25px rgba(37, 211, 102, 0.6); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);} 70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);} 100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);} }
