/* style.css — نظام تصميم منصة رابط (Rabet) */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&family=Tajawal:wght@400;500;700;800&display=swap');

:root {
  /* الألوان الأساسية من تحليل التصميم */
  --rabet-navy: #071B56;
  --rabet-navy-light: #0A1F63;
  --rabet-gold: #D9A441;
  --rabet-gold-light: #E0B24B;
  --rabet-bg: #F8F9FC;
  --rabet-white: #FFFFFF;
  --rabet-gray-text: #6B7280;
  --rabet-ink: #111827;
  --rabet-line: #E5E7EB;
  
  /* ألوان الحالات */
  --status-green: #10B981;
  --status-green-bg: #ECFDF5;
  --status-yellow: #F59E0B;
  --status-yellow-bg: #FFFBEB;
  --status-red: #EF4444;
  --status-red-bg: #FEF2F2;
  --status-blue: #3B82F6;
  --status-blue-bg: #EFF6FF;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background-color: var(--rabet-bg);
  color: var(--rabet-ink);
  font-family: 'Cairo', 'Tajawal', sans-serif;
  line-height: 1.6;
  direction: rtl;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--rabet-navy); text-decoration: none; transition: 0.2s; }
a:hover { color: var(--rabet-gold); }

/* ---- الهيدر الاحترافي ---- */
.topbar {
  background: var(--rabet-white);
  border-bottom: 1px solid var(--rabet-line);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 10px 0;
}

.topbar-in {
  max-width: 1200px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  height: 45px;
}

.brand-text {
  font-size: 22px;
  font-weight: 800;
  color: var(--rabet-navy);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.topnav a {
  font-weight: 600;
  color: var(--rabet-navy);
  font-size: 15px;
}

.btn-login {
  background: var(--rabet-navy);
  color: #fff !important;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
}

.btn-login:hover {
  background: var(--rabet-navy-light);
}

/* ---- التخطيط العام ---- */
.wrap {
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 20px;
}

/* ---- الهيرو سكشن (رابط) ---- */
.hero-rabet {
  background: linear-gradient(135deg, var(--rabet-navy), var(--rabet-navy-light));
  color: var(--rabet-white);
  border-radius: var(--radius-lg);
  padding: 60px 40px;
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.hero-rabet h1 {
  font-size: 38px;
  font-weight: 800;
  margin: 0 0 15px;
  line-height: 1.2;
}

.hero-rabet p {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 30px;
}

.hero-image {
  flex-shrink: 0;
  width: 300px;
  display: none; /* يظهر في الشاشات الكبيرة */
}

@media (min-width: 992px) {
  .hero-image { display: block; }
}

/* ---- البطاقات الاحترافية ---- */
.card {
  background: var(--rabet-white);
  border-radius: var(--radius-md);
  padding: 25px;
  box-shadow: var(--shadow);
  margin-bottom: 25px;
  border: 1px solid rgba(0,0,0,0.02);
}

.card-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--rabet-navy);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---- شبكة الأدوار (الصفحة الرئيسية) ---- */
.roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.role-box {
  background: var(--rabet-white);
  border: 1px solid var(--rabet-line);
  border-radius: var(--radius-md);
  padding: 30px 20px;
  text-align: center;
  transition: 0.3s;
}

.role-box:hover {
  border-color: var(--rabet-gold);
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.role-icon {
  font-size: 40px;
  margin-bottom: 15px;
  display: block;
}

.role-box h3 {
  margin: 0 0 10px;
  font-size: 18px;
  color: var(--rabet-navy);
}

.role-box p {
  font-size: 14px;
  color: var(--rabet-gray-text);
  margin: 0;
}

/* ---- النماذج (Forms) ---- */
.form-group { margin-bottom: 20px; }
label { display: block; font-weight: 700; margin-bottom: 8px; font-size: 14px; color: var(--rabet-navy); }
input, select, textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--rabet-line);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  transition: 0.2s;
  background: #F9FAFB;
}
input:focus {
  outline: none;
  border-color: var(--rabet-gold);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(217, 164, 65, 0.1);
}

.btn-primary {
  background: var(--rabet-navy);
  color: #fff;
  border: none;
  padding: 14px 25px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  font-size: 16px;
  transition: 0.2s;
}

.btn-primary:hover {
  background: var(--rabet-navy-light);
}

.btn-secondary {
  background: var(--rabet-white);
  color: var(--rabet-navy);
  border: 1px solid var(--rabet-navy);
  padding: 14px 25px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  font-size: 16px;
  margin-top: 10px;
}

/* ---- الموبايل فيو (Mobile Specific) ---- */
@media (max-width: 768px) {
  .hero-rabet { padding: 40px 25px; text-align: center; }
  .hero-rabet h1 { font-size: 28px; }
  .hero-rabet p { font-size: 16px; }
  .topbar-in { padding: 0 15px; }
  .brand-text { font-size: 18px; }
  .topnav { gap: 10px; }
  .topnav a { font-size: 13px; }
}

/* ---- لوحة التحكم (Dashboard) ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
}

.stat-card {
  background: #fff;
  padding: 20px;
  border-radius: var(--radius-md);
  text-align: center;
  border: 1px solid var(--rabet-line);
}

.stat-val {
  font-size: 24px;
  font-weight: 800;
  color: var(--rabet-navy);
  display: block;
}

.stat-lbl {
  font-size: 13px;
  color: var(--rabet-gray-text);
  font-weight: 600;
}

/* ---- شارات الحالة ---- */
.badge {
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 700;
  display: inline-block;
}
.badge-success { background: var(--status-green-bg); color: var(--status-green); }
.badge-warning { background: var(--status-yellow-bg); color: var(--status-yellow); }
.badge-danger { background: var(--status-red-bg); color: var(--status-red); }
.badge-info { background: var(--status-blue-bg); color: var(--status-blue); }

/* ---- الجداول ---- */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th { text-align: right; padding: 12px; background: #F3F4F6; color: var(--rabet-navy); font-size: 14px; }
td { padding: 15px 12px; border-bottom: 1px solid var(--rabet-line); font-size: 14px; }

/* ---- الفوتر ---- */
.footer {
  background: var(--rabet-white);
  border-top: 1px solid var(--rabet-line);
  padding: 40px 0;
  margin-top: 60px;
  text-align: center;
}

.footer p { color: var(--rabet-gray-text); font-size: 14px; }

/* ---- إخفاء عناصر وضع التطوير ---- */
.dev-only { display: none !important; }
<?php if (defined('APP_ENV') && APP_ENV === 'dev'): ?>
.dev-only { display: block !important; }
<?php endif; ?>
