/* =============================================
   المنظومة الصحية المصرية - التصميم الرئيسي
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;900&family=Tajawal:wght@300;400;500;700&display=swap');

:root {
  --primary:    #0a5c6e;
  --primary-lt: #0e7d94;
  --accent:     #00c9a7;
  --accent2:    #f4a622;
  --danger:     #e53e3e;
  --success:    #38a169;
  --bg:         #f0f4f8;
  --card:       #ffffff;
  --text:       #1a202c;
  --muted:      #718096;
  --border:     #e2e8f0;
  --shadow:     0 4px 20px rgba(0,0,0,.08);
  --radius:     14px;
  --radius-sm:  8px;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Cairo', 'Tajawal', sans-serif;
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  line-height: 1.7;
  min-height: 100vh;
}

/* ── NAVBAR ── */
.navbar {
  background: var(--primary);
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.nav-inner {
  max-width: 1280px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: #fff;
  font-weight: 900;
  font-size: 1.25rem;
}
.nav-brand .brand-icon { font-size: 1.7rem; }
.nav-links { display: flex; align-items: center; gap: .25rem; }
.nav-links a {
  color: rgba(255,255,255,.85);
  text-decoration: none;
  padding: .45rem .9rem;
  border-radius: var(--radius-sm);
  font-size: .92rem;
  font-weight: 600;
  transition: background .2s, color .2s;
}
.nav-links a:hover, .nav-links a.active {
  background: rgba(255,255,255,.15);
  color: #fff;
}
.nav-btn {
  background: var(--accent) !important;
  color: var(--primary) !important;
  font-weight: 700 !important;
  padding: .45rem 1.1rem !important;
  border-radius: 50px !important;
}
.nav-user {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #fff;
  font-size: .9rem;
}
.nav-user .avatar {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  color: var(--primary);
}
.hamburger { display: none; background: none; border: none; cursor: pointer; color: #fff; font-size: 1.5rem; }
@media(max-width:768px){
  .nav-links { display: none; flex-direction: column; position: absolute; top: 64px; right: 0; left: 0; background: var(--primary); padding: 1rem; gap: .5rem; }
  .nav-links.open { display: flex; }
  .hamburger { display: block; }
}

/* ── HERO ── */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #073f4d 50%, #041f28 100%);
  color: #fff;
  padding: 5rem 1.5rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2300c9a7' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='30'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
  pointer-events: none;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 900; line-height: 1.2; }
.hero h1 span { color: var(--accent); }
.hero p { font-size: 1.15rem; margin: 1rem auto 2rem; max-width: 650px; opacity: .85; }
.hero-search {
  display: flex;
  max-width: 640px;
  margin: auto;
  background: #fff;
  border-radius: 50px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
}
.hero-search input {
  flex: 1;
  border: none;
  outline: none;
  padding: .9rem 1.5rem;
  font-family: inherit;
  font-size: 1rem;
  direction: rtl;
}
.hero-search button {
  background: var(--accent);
  border: none;
  padding: .9rem 1.8rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  transition: background .2s;
}
.hero-search button:hover { background: #00b396; }
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-top: 3rem;
}
.hero-stat { text-align: center; }
.hero-stat .num { font-size: 2.5rem; font-weight: 900; color: var(--accent); }
.hero-stat .lbl { font-size: .9rem; opacity: .8; }

/* ── CONTAINER ── */
.container { max-width: 1280px; margin: auto; padding: 0 1.5rem; }
.section { padding: 4rem 0; }
.section-title {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 2rem;
  position: relative;
  padding-right: 1.2rem;
}
.section-title::before {
  content: '';
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 70%;
  background: var(--accent);
  border-radius: 4px;
}

/* ── CARDS ── */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.25rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 1.5rem; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem;
  transition: transform .2s, box-shadow .2s;
  border: 1px solid var(--border);
}
.card:hover { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(0,0,0,.12); }

.gov-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 2px solid var(--border);
  transition: all .2s;
  box-shadow: var(--shadow);
}
.gov-card:hover {
  border-color: var(--primary-lt);
  background: linear-gradient(135deg, rgba(10,92,110,.04), rgba(0,201,167,.04));
  transform: translateY(-3px);
}
.gov-card .icon {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--primary), var(--primary-lt));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.gov-card .info h3 { font-weight: 700; font-size: 1.05rem; }
.gov-card .info .count { font-size: .85rem; color: var(--muted); }

.center-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: .75rem;
  transition: all .2s;
}
.center-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.center-card .badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .25rem .75rem;
  border-radius: 50px;
  font-size: .8rem;
  font-weight: 700;
}
.badge-hospital { background: #ebf8ff; color: #2b6cb0; }
.badge-clinic   { background: #f0fff4; color: #276749; }
.badge-center   { background: #fefcbf; color: #744210; }
.badge-pharmacy { background: #fff5f5; color: #9b2c2c; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .6rem 1.4rem;
  border-radius: 50px;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 700;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-lt); }
.btn-accent { background: var(--accent); color: var(--primary); }
.btn-accent:hover { background: #00b396; }
.btn-outline { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: .4rem 1rem; font-size: .85rem; }
.btn-full { width: 100%; justify-content: center; border-radius: var(--radius-sm); }

/* ── FORMS ── */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-weight: 600; font-size: .92rem; color: var(--primary); margin-bottom: .4rem; }
.form-control {
  width: 100%;
  padding: .75rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .95rem;
  direction: rtl;
  transition: border-color .2s, box-shadow .2s;
  background: #fff;
}
.form-control:focus { outline: none; border-color: var(--primary-lt); box-shadow: 0 0 0 3px rgba(14,125,148,.15); }
select.form-control { cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media(max-width:600px){ .form-row { grid-template-columns: 1fr; } }

/* ── ALERTS ── */
.alert {
  padding: .9rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.alert-error   { background: #fff5f5; color: var(--danger);  border-right: 4px solid var(--danger); }
.alert-success { background: #f0fff4; color: var(--success); border-right: 4px solid var(--success); }
.alert-info    { background: #ebf8ff; color: #2b6cb0;        border-right: 4px solid #3182ce; }
.alert-warn    { background: #fffbeb; color: #744210;        border-right: 4px solid var(--accent2); }

/* ── DASHBOARD SIDEBAR ── */
.dash-layout { display: grid; grid-template-columns: 260px 1fr; gap: 2rem; margin: 2rem auto; max-width: 1280px; padding: 0 1.5rem; }
.sidebar {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  height: fit-content;
  position: sticky;
  top: 80px;
  border: 1px solid var(--border);
}
.sidebar-avatar {
  text-align: center;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}
.sidebar-avatar .av-circle {
  width: 70px; height: 70px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  margin: 0 auto .5rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  color: #fff;
}
.sidebar-avatar h4 { font-weight: 700; font-size: 1rem; }
.sidebar-avatar p  { font-size: .8rem; color: var(--muted); }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .65rem .9rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: .92rem;
  margin-bottom: .25rem;
  transition: background .15s, color .15s;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  background: linear-gradient(135deg, rgba(10,92,110,.08), rgba(0,201,167,.08));
  color: var(--primary);
}
.sidebar-nav a .icon { font-size: 1.1rem; width: 24px; text-align: center; }
@media(max-width:900px){
  .dash-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}

/* ── STATS CARDS ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.stat-card .s-icon { font-size: 2.2rem; margin-bottom: .5rem; }
.stat-card .s-num  { font-size: 2rem; font-weight: 900; color: var(--primary); }
.stat-card .s-lbl  { font-size: .85rem; color: var(--muted); }

/* ── FILE CARDS ── */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.file-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  transition: box-shadow .2s;
}
.file-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.1); }
.file-card .f-icon { font-size: 2.2rem; }
.file-card .f-name { font-weight: 700; font-size: .95rem; word-break: break-all; }
.file-card .f-meta { font-size: .8rem; color: var(--muted); }
.file-card .f-tag { font-size: .78rem; font-weight: 600; padding: .2rem .65rem; border-radius: 50px; background: var(--bg); }

/* ── NEWS ── */
.news-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform .2s;
}
.news-card:hover { transform: translateY(-4px); }
.news-card img  { width: 100%; height: 200px; object-fit: cover; }
.news-card .nc-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; gap: .5rem; }
.news-card .nc-cat { font-size: .78rem; font-weight: 700; color: var(--primary-lt); background: rgba(14,125,148,.1); padding: .2rem .7rem; border-radius: 50px; display: inline-block; }
.news-card .nc-title { font-size: 1.05rem; font-weight: 700; line-height: 1.4; }
.news-card .nc-title a { color: var(--text); text-decoration: none; }
.news-card .nc-title a:hover { color: var(--primary); }
.news-card .nc-meta { font-size: .82rem; color: var(--muted); margin-top: auto; }

/* ── PAGE HEADER ── */
.page-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-lt));
  color: #fff;
  padding: 3rem 1.5rem;
  margin-bottom: 2rem;
}
.page-header h1 { font-size: 2rem; font-weight: 900; }
.page-header p  { opacity: .85; margin-top: .5rem; }
.breadcrumb { display: flex; gap: .5rem; align-items: center; font-size: .88rem; opacity: .8; margin-bottom: .75rem; }
.breadcrumb a { color: rgba(255,255,255,.8); text-decoration: none; }
.breadcrumb a:hover { color: #fff; }
.breadcrumb span { opacity: .6; }

/* ── MODAL / UPLOAD PANEL ── */
.upload-panel {
  background: var(--bg);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s;
  position: relative;
}
.upload-panel:hover, .upload-panel.drag { border-color: var(--primary-lt); }
.upload-panel input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ── SUBSCRIPTION BOX ── */
.sub-box {
  background: linear-gradient(135deg, #fff8e1, #fffde7);
  border: 2px solid var(--accent2);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.sub-box h3 { color: #744210; font-weight: 800; margin-bottom: .5rem; }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
thead th { background: var(--primary); color: #fff; padding: .85rem 1rem; text-align: right; font-weight: 700; }
tbody tr:nth-child(even) { background: #f7fafc; }
tbody td { padding: .75rem 1rem; border-bottom: 1px solid var(--border); }

/* ── FOOTER ── */
footer {
  background: var(--primary);
  color: rgba(255,255,255,.8);
  padding: 3rem 1.5rem 1.5rem;
  margin-top: 4rem;
}
.footer-grid { max-width: 1280px; margin: auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem; }
.footer-col h4 { color: #fff; font-weight: 800; margin-bottom: 1rem; }
.footer-col a  { display: block; color: rgba(255,255,255,.7); text-decoration: none; margin-bottom: .5rem; font-size: .9rem; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { max-width: 1280px; margin: 2rem auto 0; border-top: 1px solid rgba(255,255,255,.15); padding-top: 1.25rem; text-align: center; font-size: .88rem; }

/* ── MISC ── */
.text-center { text-align: center; }
.text-muted  { color: var(--muted); }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.gap-1 { gap: .5rem; }
.flex  { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.chip {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .75rem; border-radius: 50px;
  font-size: .8rem; font-weight: 700;
  background: rgba(10,92,110,.08); color: var(--primary);
}
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}
.empty-state .e-icon { font-size: 4rem; margin-bottom: 1rem; }
.empty-state p { font-size: 1.05rem; }
.tag { font-size: .8rem; padding: .2rem .6rem; border-radius: 50px; font-weight: 600; }
.tag-xray       { background: #ebf8ff; color: #2b6cb0; }
.tag-lab        { background: #f0fff4; color: #276749; }
.tag-report     { background: #fef3c7; color: #92400e; }
.tag-prescription { background: #fce7f3; color: #831843; }
.tag-other      { background: var(--bg); color: var(--muted); }

/* ══ نظام المواعيد ══ */
.appt-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 1rem;
  align-items: center;
  transition: box-shadow .2s;
}
.appt-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.1); }

.appt-date-box {
  background: linear-gradient(135deg, var(--primary), var(--primary-lt));
  color: #fff;
  border-radius: var(--radius-sm);
  padding: .7rem .85rem;
  text-align: center;
}
.appt-date-box .day   { font-size: 1.6rem; font-weight: 900; line-height: 1; }
.appt-date-box .month { font-size: .72rem; opacity: .85; }
.appt-date-box .time  { font-size: .85rem; font-weight: 700; margin-top: .35rem; }

.slot-btn:hover {
  background: rgba(10,92,110,.08) !important;
  border-color: var(--primary-lt) !important;
}

/* تقويم المواعيد */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.cal-day {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  border: 1.5px solid transparent;
  position: relative;
}
.cal-day.has-appt { background: rgba(10,92,110,.12); color: var(--primary); border-color: var(--primary-lt); }
.cal-day.today    { background: var(--primary); color: #fff !important; }
.cal-day.past     { opacity: .4; cursor: default; }
.cal-day:hover:not(.past) { border-color: var(--primary); }
.cal-day .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); position: absolute; bottom: 3px; }

/* ══ TOP BAR + TICKER + SPONSORS ══ */
#top-bar { font-family: 'Cairo', sans-serif; }

/* responsive */
@media(max-width:640px) {
  #top-bar .tb-inner { grid-template-columns: 1fr 1fr; }
  #top-bar .tb-right { display: none; }
  #top-bar .tb-center { text-align: right; }
  #news-ticker .ticker-label { display: none; }
}

/* Editor + Video section responsive */
@media(max-width:768px) {
  #editor-video-section > div {
    grid-template-columns: 1fr !important;
  }
}

/* sponsor item hover */
.sponsor-item { transition: all .2s; }
.sponsor-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
