/* ============================================
   ETTQAN - مركز منهاج الإتقان
   Shared CSS - النمط المشترك
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Scheherazade+New:wght@400;500;600;700&family=Tajawal:wght@300;400;500;700&display=swap');

/* ---- CSS Variables ---- */
:root {
  --gold-primary:    #C9A84C;
  --gold-light:      #E2C97E;
  --gold-dark:       #8B6914;
  --gold-muted:      #A08440;
  --black-deep:      #0A0A0A;
  --black-card:      #111111;
  --black-border:    #1E1E1E;
  --black-hover:     #181818;
  --text-primary:    #F5EDD6;
  --text-secondary:  #B8A070;
  --text-muted:      #6B5B3E;
  --danger:          #C0392B;
  --success:         #1E8449;
  --warning:         #D4AC0D;
  --info:            #1A6B8A;

  --font-arabic:     'Scheherazade New', 'Amiri', serif;
  --font-ui:         'Tajawal', sans-serif;

  --radius-sm:       6px;
  --radius-md:       12px;
  --radius-lg:       20px;
  --radius-xl:       32px;

  --shadow-gold:     0 4px 24px rgba(201, 168, 76, 0.18);
  --shadow-card:     0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow:     0 0 40px rgba(201, 168, 76, 0.12);

  --transition:      all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-width:   260px;
}

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

html {
  direction: rtl;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-ui);
  background-color: var(--black-deep);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.7;
  overflow-x: hidden;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--black-card); }
::-webkit-scrollbar-thumb { background: var(--gold-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-primary); }

/* ---- Typography ---- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-arabic);
  color: var(--text-primary);
  line-height: 1.4;
}

.quran-text {
  font-family: var(--font-arabic);
  font-size: 1.5rem;
  color: var(--gold-light);
  text-align: center;
  line-height: 2.2;
}

.arabic-label {
  font-family: var(--font-arabic);
  font-size: 1.1rem;
}

/* ---- Layout Shell ---- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--black-card);
  border-left: 1px solid var(--black-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: var(--transition);
}

.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid var(--black-border);
  text-align: center;
}

.sidebar-logo img {
  width: 100%;
  max-width: 180px;
  height: auto;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
}

.nav-section-title {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  padding: 12px 20px 6px;
  text-transform: uppercase;
  font-family: var(--font-ui);
  font-weight: 500;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  border-right: 3px solid transparent;
  cursor: pointer;
  position: relative;
}

.nav-item:hover {
  background: var(--black-hover);
  color: var(--gold-light);
  border-right-color: var(--gold-muted);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(201,168,76,0.08) 0%, transparent 100%);
  color: var(--gold-primary);
  border-right-color: var(--gold-primary);
}

.nav-item .nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.8;
}

.nav-item.active .nav-icon,
.nav-item:hover .nav-icon { opacity: 1; }

.nav-badge {
  margin-right: auto;
  background: var(--gold-primary);
  color: var(--black-deep);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--black-border);
}

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

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold-primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-arabic);
  font-size: 1rem;
  color: var(--black-deep);
  font-weight: 700;
  flex-shrink: 0;
}

.user-info { flex: 1; overflow: hidden; }
.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role {
  font-size: 0.72rem;
  color: var(--gold-muted);
}

/* ---- Main Content ---- */
.main-content {
  flex: 1;
  margin-right: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- Top Bar ---- */
.topbar {
  height: 64px;
  background: var(--black-card);
  border-bottom: 1px solid var(--black-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-family: var(--font-arabic);
  font-size: 1.2rem;
  color: var(--text-primary);
}

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

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--black-border);
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.icon-btn:hover {
  background: var(--black-hover);
  color: var(--gold-primary);
  border-color: var(--gold-dark);
}

.icon-btn.notif { position: relative; }
.icon-btn.notif::after {
  content: '';
  position: absolute;
  top: 7px; right: 7px;
  width: 7px; height: 7px;
  background: var(--gold-primary);
  border-radius: 50%;
  border: 2px solid var(--black-card);
}

/* ---- Page Content ---- */
.page-content {
  flex: 1;
  padding: 28px;
  overflow-y: auto;
}

/* ---- Stats Cards ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--black-card);
  border: 1px solid var(--black-border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 3px; height: 100%;
  background: var(--gold-primary);
  opacity: 0;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--gold-dark);
  box-shadow: var(--shadow-gold);
  transform: translateY(-2px);
}

.stat-card:hover::before { opacity: 1; }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  background: rgba(201, 168, 76, 0.1);
  border: 1px solid rgba(201, 168, 76, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--gold-primary);
}

.stat-info { flex: 1; }
.stat-value {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--gold-light);
  line-height: 1;
  font-family: var(--font-arabic);
}
.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---- Cards ---- */
.card {
  background: var(--black-card);
  border: 1px solid var(--black-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover { border-color: rgba(201,168,76,0.25); }

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--black-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-family: var(--font-arabic);
  font-size: 1.05rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title svg { color: var(--gold-primary); }

.card-body { padding: 20px; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

thead tr {
  background: rgba(201,168,76,0.06);
  border-bottom: 1px solid var(--black-border);
}

th {
  padding: 12px 16px;
  text-align: right;
  color: var(--gold-muted);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }

tbody tr:hover td {
  background: var(--black-hover);
  color: var(--text-primary);
}

/* ---- Badges / Pills ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-gold    { background: rgba(201,168,76,0.15); color: var(--gold-primary); border: 1px solid rgba(201,168,76,0.3); }
.badge-success { background: rgba(30,132,73,0.15);  color: #2ECC71; border: 1px solid rgba(46,204,113,0.3); }
.badge-danger  { background: rgba(192,57,43,0.15);  color: #E74C3C; border: 1px solid rgba(231,76,60,0.3); }
.badge-info    { background: rgba(26,107,138,0.15); color: #3498DB; border: 1px solid rgba(52,152,219,0.3); }
.badge-muted   { background: rgba(255,255,255,0.05); color: var(--text-muted); border: 1px solid rgba(255,255,255,0.08); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold-primary));
  color: var(--black-deep);
  font-weight: 700;
}

.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-light));
  box-shadow: 0 4px 16px rgba(201,168,76,0.3);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--black-border);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--gold-dark);
  color: var(--gold-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--black-hover);
  color: var(--gold-primary);
}

.btn-sm { padding: 5px 12px; font-size: 0.78rem; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }

/* ---- Forms ---- */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--black-deep);
  border: 1px solid var(--black-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  transition: var(--transition);
  direction: rtl;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.08);
}

.form-input::placeholder { color: var(--text-muted); }

/* ---- Progress ---- */
.progress-bar-wrap {
  height: 6px;
  background: var(--black-deep);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-primary));
  border-radius: 3px;
  transition: width 0.6s ease;
}

/* ---- Divider ---- */
.divider {
  border: none;
  border-top: 1px solid var(--black-border);
  margin: 20px 0;
}

/* ---- Grid Helpers ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* ---- Ornamental Divider ---- */
.ornament {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--gold-dark);
  font-size: 1.2rem;
}

.ornament::before,
.ornament::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dark));
}

.ornament::after {
  background: linear-gradient(90deg, var(--gold-dark), transparent);
}

/* ---- Role Tag ---- */
.role-tag-ST { color: #3498DB; background: rgba(52,152,219,0.1); border: 1px solid rgba(52,152,219,0.25); }
.role-tag-GR { color: #F39C12; background: rgba(243,156,18,0.1); border: 1px solid rgba(243,156,18,0.25); }
.role-tag-SH { color: var(--gold-primary); background: rgba(201,168,76,0.1); border: 1px solid rgba(201,168,76,0.25); }

/* ---- Animations ---- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201,168,76,0.3); }
  50%       { box-shadow: 0 0 0 8px rgba(201,168,76,0); }
}

.animate-in { animation: fadeInUp 0.4s ease both; }
.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }

/* ---- Login Page ---- */
.login-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(201,168,76,0.07) 0%, transparent 60%),
    var(--black-deep);
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--black-card);
  border: 1px solid var(--black-border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: var(--shadow-card);
  animation: fadeInUp 0.5s ease;
}

.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo img { max-width: 200px; }

.login-subtitle {
  text-align: center;
  font-family: var(--font-arabic);
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

/* ---- Surah Progress Rings ---- */
.ring-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ring-label {
  position: absolute;
  text-align: center;
}

.ring-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold-light);
  font-family: var(--font-arabic);
  display: block;
}

.ring-text {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* ---- Recitation Grade Display ---- */
.grade-circle {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--gold-dark);
  background: rgba(201,168,76,0.06);
}

.grade-num {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold-primary);
  font-family: var(--font-arabic);
  line-height: 1;
}

.grade-max {
  font-size: 0.6rem;
  color: var(--text-muted);
}

/* ---- Tabs ---- */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--black-border);
  margin-bottom: 20px;
  gap: 4px;
}

.tab-btn {
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 0.88rem;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: -1px;
}

.tab-btn:hover { color: var(--text-secondary); }

.tab-btn.active {
  color: var(--gold-primary);
  border-bottom-color: var(--gold-primary);
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  :root { --sidebar-width: 220px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .sidebar { transform: translateX(100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-right: 0; }
  .page-content { padding: 16px; }
}
/* تغير شكل التحديد */
::selection {
    background: rgba(201,168,76,0.14);
}