/* =========================================================
   جامعة النور — جداول امتحانات الدور الثاني
   نظام الألوان مُستمَد من شعار الجامعة (كحلي / أحمر / أبيض)
   ========================================================= */

:root{
  --navy:        #0C245F;
  --navy-2:      #16336F;
  --navy-deep:   #081A45;
  --red:         #990E15;
  --red-2:       #B5232C;
  --bg:          #F4F6FB;
  --paper:       #FFFFFF;
  --ink:         #16203D;
  --muted:       #5C6580;
  --line:        #E3E7F2;
  --gold:        #D8B463;

  --font-display: 'El Messiri', serif;
  --font-body: 'Tajawal', sans-serif;

  --radius: 14px;
  --shadow-sm: 0 2px 8px rgba(12,36,95,0.08);
  --shadow-md: 0 12px 32px rgba(12,36,95,0.14);
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }

body{
  margin:0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img{ max-width:100%; display:block; }
a{ color: inherit; text-decoration: none; }

:focus-visible{
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* ===== شريط علوي ===== */
.topbar{
  background: var(--navy-deep);
  color: rgba(255,255,255,0.85);
  font-size: 0.8rem;
}
.topbar-inner{
  max-width: 1200px;
  margin: 0 auto;
  padding: 7px 24px;
  display:flex;
  align-items:center;
  gap:10px;
  justify-content:center;
}
.topbar-sep{ color: var(--red-2); }

/* ===== الترويسة ===== */
.site-header{
  background: var(--paper);
  position: sticky;
  top:0;
  z-index: 40;
  box-shadow: var(--shadow-sm);
}
.header-inner{
  max-width: 1200px;
  margin:0 auto;
  padding: 16px 24px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 20px;
}
.brand{
  display:flex;
  align-items:center;
  gap:14px;
}
.brand-logo{ width:56px; height:56px; }
.brand-text h1{
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin:0;
  color: var(--navy);
  font-weight:700;
}
.brand-text p{
  margin:0;
  font-size: 0.78rem;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
}
.main-nav{
  display:flex;
  gap: 28px;
}
.main-nav a{
  font-weight:500;
  color: var(--muted);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
  font-size: 0.95rem;
}
.main-nav a:hover,
.main-nav a.active{
  color: var(--red);
  border-color: var(--red);
}

.arch-row{ height:6px; background: linear-gradient(90deg, var(--red), var(--navy)); }

/* ===== قسم البطل ===== */
.hero{
  position:relative;
  background:
    radial-gradient(1200px 500px at 20% -10%, rgba(153,14,21,0.35), transparent 60%),
    linear-gradient(160deg, var(--navy-deep), var(--navy) 60%, var(--navy-2));
  color:#fff;
  padding: 64px 24px 90px;
  overflow:hidden;
}
.hero-inner{
  max-width: 800px;
  margin: 0 auto;
  text-align:center;
  position:relative;
  z-index:2;
}
.hero-eyebrow{
  display:inline-block;
  font-size: 0.78rem;
  letter-spacing: 3px;
  color: var(--gold);
  border: 1px solid rgba(216,180,99,0.5);
  padding: 5px 16px;
  border-radius: 999px;
  margin-bottom: 20px;
}
.hero h2{
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4.5vw, 2.7rem);
  margin: 0 0 16px;
  font-weight:700;
}
.hero-sub{
  color: rgba(255,255,255,0.82);
  font-size: 1.02rem;
  max-width: 620px;
  margin: 0 auto 32px;
}
.search-row{ display:flex; justify-content:center; }
.search-box{
  position:relative;
  width: 100%;
  max-width: 420px;
}
.search-icon{
  position:absolute;
  right: 16px;
  top:50%;
  transform: translateY(-50%);
  width:18px; height:18px;
  color: var(--muted);
}
#collegeSearch{
  width:100%;
  padding: 13px 46px 13px 18px;
  border-radius: 999px;
  border: none;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-md);
}
#collegeSearch::placeholder{ color: #9aa2b8; }

.hero-arches{
  position:absolute;
  bottom:-1px; right:0; left:0;
  line-height:0;
}
.hero-arches svg{ width:100%; height:44px; display:block; }

/* ===== فلاتر الكليات ===== */
.filters-wrap{
  background: var(--bg);
  padding: 26px 24px 6px;
  position: sticky;
  top: 89px;
  z-index: 20;
}
.filters{
  max-width: 1200px;
  margin: 0 auto;
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content:center;
  padding-bottom: 16px;
}
.chip{
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight:500;
  padding: 9px 20px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  cursor:pointer;
  transition: all .18s ease;
  white-space:nowrap;
}
.chip:hover{ border-color: var(--red-2); color: var(--red); }
.chip.active{
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

/* ===== شبكة الجداول ===== */
.schedules-section{
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 24px 70px;
}
.grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 26px;
}

.card{
  background: var(--paper);
  border-radius: var(--radius);
  overflow:hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  display:flex;
  flex-direction:column;
  transition: transform .2s ease, box-shadow .2s ease;
  animation: rise .45s ease both;
}
.card:hover{ transform: translateY(-4px); box-shadow: var(--shadow-md); }

@keyframes rise{
  from{ opacity:0; transform: translateY(14px); }
  to{ opacity:1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce){
  .card{ animation:none; }
  .card:hover{ transform:none; }
  html{ scroll-behavior:auto; }
}

.card-frame{
  position:relative;
  aspect-ratio: 4 / 3;
  background: linear-gradient(160deg, #eef1fa, #e4e8f5);
  clip-path: polygon(0 14%, 0 100%, 100% 100%, 100% 14%, 50% 0%);
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
.card-frame img{
  width:100%; height:100%;
  object-fit: cover;
  object-position: top center;
  cursor:zoom-in;
}
.card-frame.empty{
  border: 2px dashed #C4CBE0;
  clip-path: none;
  border-radius: 0 0 var(--radius) var(--radius);
}
.empty-inner{
  text-align:center;
  color: var(--muted);
  padding: 18px;
}
.empty-inner svg{ width:34px; height:34px; margin-bottom:8px; color:#AEB6CE; }
.empty-inner span{ display:block; font-size:0.85rem; }

.card-body{
  padding: 18px 20px 20px;
  display:flex;
  flex-direction:column;
  gap: 8px;
  flex:1;
}
.card-body h3{
  font-family: var(--font-display);
  font-size: 1.12rem;
  margin:0;
  color: var(--navy);
}
.card-meta{
  font-size: 0.82rem;
  color: var(--muted);
  display:flex;
  gap:8px;
  align-items:center;
}
.dot{ width:5px; height:5px; border-radius:50%; background: var(--red-2); display:inline-block; }

.card-btn{
  margin-top: 10px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  font-weight:600;
  font-size: 0.9rem;
  border:none;
  cursor:pointer;
  transition: background .18s ease;
}
.card-btn:hover{ background: var(--red-2); }
.card-btn[disabled]{
  background: #E3E7F2;
  color: #9aa2b8;
  cursor: not-allowed;
}

.empty-state{
  text-align:center;
  color: var(--muted);
  padding: 40px 0;
  font-size: 1rem;
  display:none;
}
.empty-state[hidden]{ display:none; }
.empty-state:not([hidden]){ display:block; }

/* ===== شريط تنبيه ===== */
.notice-band{
  background: linear-gradient(90deg, var(--red-2), var(--red));
  color:#fff;
}
.notice-inner{
  max-width: 1000px;
  margin:0 auto;
  padding: 18px 24px;
  display:flex;
  align-items:center;
  gap:14px;
}
.notice-icon{ width:26px; height:26px; flex-shrink:0; }
.notice-inner p{ margin:0; font-size:0.92rem; }

/* ===== التذييل ===== */
.site-footer{
  background: var(--navy-deep);
  color: rgba(255,255,255,0.85);
  position:relative;
}
.footer-arches{ line-height:0; margin-top:-1px; }
.footer-arches svg{ width:100%; height:32px; display:block; }

.footer-inner{
  max-width: 1200px;
  margin:0 auto;
  padding: 20px 24px 30px;
  display:grid;
  grid-template-columns: 1.2fr 1fr 1.2fr;
  gap: 30px;
}
.footer-col h3{
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 1rem;
  margin: 0 0 8px;
}
.footer-col p{ margin: 0 0 16px; font-size: 0.88rem; color: rgba(255,255,255,0.7); }
.footer-logo{ width:44px; height:44px; margin-bottom:10px; }
.footer-links{ display:flex; flex-direction:column; }
.footer-links a{
  font-size: 0.88rem;
  color: rgba(255,255,255,0.75);
  margin-bottom: 8px;
  transition: color .15s;
}
.footer-links a:hover{ color: var(--gold); }

/* عمود اللجنة الامتحانية ومركز الحاسبة الالكترونية — أسفل يمين الصفحة */
.footer-credit{ text-align: right; }

.footer-bottom{
  border-top: 1px solid rgba(255,255,255,0.12);
  text-align:center;
  padding: 14px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.55);
}

/* ===== نافذة عرض الصورة ===== */
.lightbox{
  position: fixed; inset:0; z-index: 100;
  display:flex; align-items:center; justify-content:center;
  padding: 24px;
}
.lightbox[hidden]{ display:none; }
.lightbox-backdrop{
  position:absolute; inset:0;
  background: rgba(8,26,69,0.88);
  backdrop-filter: blur(2px);
}
.lightbox-content{
  position:relative;
  max-width: min(900px, 92vw);
  max-height: 90vh;
  background: var(--paper);
  border-radius: 12px;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  box-shadow: 0 30px 80px rgba(0,0,0,0.4);
  animation: pop .2s ease;
}
@keyframes pop{ from{ transform: scale(.96); opacity:0; } to{ transform: scale(1); opacity:1; } }

.lightbox-toolbar{
  display:flex; align-items:center; justify-content:space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.lightbox-title{ font-weight:600; color: var(--navy); font-family: var(--font-display); }
.lightbox-actions{ display:flex; gap:8px; }
.lb-btn{
  width:34px; height:34px;
  display:flex; align-items:center; justify-content:center;
  border-radius:8px;
  background: var(--bg);
  color: var(--navy);
  border:none; cursor:pointer;
}
.lb-btn svg{ width:18px; height:18px; }
.lb-btn:hover{ background: var(--line); }
.lightbox-content img{
  max-height: 78vh;
  width:auto;
  margin: 0 auto;
  object-fit: contain;
}

/* ===== استجابة الشاشات الصغيرة ===== */
@media (max-width: 900px){
  .footer-inner{ grid-template-columns: 1fr 1fr; }
  .footer-brand{ grid-column: 1 / -1; }
}
@media (max-width: 640px){
  .main-nav{ display:none; }
  .filters-wrap{ top: 73px; }
  .footer-inner{ grid-template-columns: 1fr; text-align:center; }
  .footer-credit{ text-align:center; }
}
