/* ============================================================
   منصة معين التعليمية — الخطط الدراسية (Shared Styles)
   ============================================================ */

:root {
  --bg-card: #FFFFFF;
  --bg-dark: #012727;
  --bg-dark-2: #0A2C2C;
  --bg-section: #F2F7F8;
  --btn-bg: #074842;
  --btn-bg-hover: #053631;
  --desc-color: #5F6C70;
  --gold: #D4AF37;
  --gold-dark: #B8941F;
  --gold-glow: #E5C158;
  --gold-text: #be9632;
  --gray-light: #E2E8F0;
  --icon-circle-bg: #EBF4F0;
  --radius-btn: 10px;
  --radius-card: 20px;
  --title-color: #0B3B3C;
  --transition: 0.3s ease;
  --white: #FFFFFF;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Cairo', Tahoma, Arial, sans-serif; background: var(--bg-section); color: var(--title-color); line-height: 1.6; min-height: 100vh; -webkit-font-smoothing: antialiased; display: flex; flex-direction: column; align-items: center; }
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }

.page-wrapper { width: 100%; max-width: 1280px; display: flex; flex-direction: column; gap: 20px; padding: 20px; flex: 1; }

/* HEADER */
.header { width: 100%; background: var(--bg-dark); background-image: linear-gradient(135deg, rgba(1,42,43,0.95) 0%, rgba(10,44,44,0.95) 100%); border-radius: 24px; padding: 18px 24px; display: grid; grid-template-columns: 1fr 2fr 1fr; align-items: center; gap: 20px; box-shadow: 0 10px 40px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05); }
.header-logo-moaeen { display: flex; align-items: center; justify-content: flex-start; }
.header-logo-moaeen img { width: 90px; height: auto; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.2)); transition: var(--transition); }
.header-logo-moaeen img:hover { transform: scale(1.05); }
.header-pill { display: flex; align-items: center; justify-content: center; gap: 14px; background: rgba(1,32,32,0.6); border: 2px solid var(--gold); border-radius: 50px; padding: 12px 28px; box-shadow: 0 0 20px rgba(212,175,55,0.3), 0 0 40px rgba(212,175,55,0.15), inset 0 0 20px rgba(0,0,0,0.3); backdrop-filter: blur(8px); }
.pill-line { width: 50px; height: 2px; background: linear-gradient(90deg, transparent, var(--gold), transparent); border-radius: 2px; flex-shrink: 0; }
.pill-text { color: var(--white); font-size: 16px; font-weight: 700; white-space: nowrap; }
.pill-star { color: var(--gold); font-size: 18px; }
.header-seu-box { display: flex; align-items: center; justify-content: center; }
.seu-rect { display: flex; align-items: center; gap: 12px; }
.seu-rect img { width: 44px; height: 44px; object-fit: contain; }
.seu-text-en { color: var(--white); font-size: 12px; font-weight: 600; }
@media (max-width: 768px) { .header { grid-template-columns: 1fr 1fr; padding: 14px 16px; } .header-pill { display: none; } .header-logo-moaeen img { width: 70px; } .seu-rect img { width: 38px; height: 38px; } }
.mobile-pill-bar { display: none; width: 100%; }
.mobile-pill { display: flex; align-items: center; justify-content: center; gap: 10px; background: rgba(1,32,32,0.6); border: 1px solid rgba(212,175,55,0.6); border-radius: 50px; padding: 8px 16px; }
.mobile-pill .pill-text { font-size: 12px; }
@media (max-width: 768px) { .mobile-pill-bar { display: block; } }

/* BACK BAR */
.back-bar { width: 100%; background: var(--white); border-radius: 16px; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); flex-wrap: wrap; }
.back-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--btn-bg); color: var(--white); padding: 8px 18px; border-radius: var(--radius-btn); font-size: 14px; font-weight: 700; transition: var(--transition); }
.back-btn:hover { background: var(--btn-bg-hover); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(7,72,66,0.3); }
.back-btn i { font-size: 12px; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--desc-color); flex-wrap: wrap; }
.breadcrumb .crumb-home { font-weight: 700; color: var(--btn-bg); }
.breadcrumb .crumb-current { font-weight: 700; color: var(--gold-text); }
.breadcrumb i { font-size: 10px; }

/* HERO */
.hero { width: 100%; background: var(--bg-dark); background-image: linear-gradient(135deg, rgba(1,42,43,0.92) 0%, rgba(10,44,44,0.88) 100%); border-radius: 24px; padding: 32px 28px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.3); }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; background: rgba(212,175,55,0.15); border: 1px solid rgba(212,175,55,0.4); border-radius: 50px; padding: 6px 16px; font-size: 12px; font-weight: 700; color: var(--gold-glow); }
.hero-badge i { font-size: 12px; }
.hero h1 { font-size: 24px; font-weight: 800; color: var(--white); line-height: 1.4; max-width: 800px; }
.hero h1 .gold { color: var(--gold); }
.hero p { font-size: 14px; color: rgba(255,255,255,0.85); max-width: 700px; line-height: 1.7; }
@media (min-width: 768px) { .hero h1 { font-size: 28px; } .hero p { font-size: 15px; } }

/* ===== COLLEGE CARDS ===== */
.colleges-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 768px) { .colleges-grid { grid-template-columns: 1fr 1fr; } }

.college-card { background: var(--white); border-radius: var(--radius-card); overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,0.06); transition: var(--transition); border: 1px solid var(--gray-light); display: flex; flex-direction: column; }
.college-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0,0,0,0.12); border-color: var(--gold); }

.college-header { background: var(--bg-dark); background-image: linear-gradient(135deg, rgba(1,42,43,0.95) 0%, rgba(10,44,44,0.95) 100%); padding: 20px 24px; display: flex; align-items: center; gap: 14px; position: relative; overflow: hidden; }
.college-header::after { content: ''; position: absolute; top: -30%; left: -10%; width: 50%; height: 160%; background: radial-gradient(ellipse, rgba(212,175,55,0.1), transparent 70%); pointer-events: none; }
.college-icon { width: 52px; height: 52px; border-radius: 14px; background: rgba(212,175,55,0.15); border: 1px solid rgba(212,175,55,0.3); display: flex; align-items: center; justify-content: center; flex-shrink: 0; position: relative; z-index: 1; }
.college-icon i { font-size: 24px; color: var(--gold); }
.college-title-wrap { position: relative; z-index: 1; flex: 1; }
.college-title { font-size: 16px; font-weight: 800; color: var(--white); line-height: 1.4; }
.college-title-en { font-size: 11px; color: rgba(255,255,255,0.7); margin-top: 2px; }
.college-count { position: relative; z-index: 1; background: rgba(212,175,55,0.2); color: var(--gold-glow); font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px; border: 1px solid rgba(212,175,55,0.3); }

.college-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }

.spec-link { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--bg-section); border: 1px solid var(--gray-light); transition: var(--transition); }
.spec-link:hover { background: #fffbeb; border-color: var(--gold); transform: translateX(-3px); }
.spec-link-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--icon-circle-bg); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.spec-link-icon i { font-size: 18px; color: var(--btn-bg); }
.spec-link-text { flex: 1; min-width: 0; }
.spec-link-name { font-size: 14px; font-weight: 700; color: var(--title-color); }
.spec-link-name-en { font-size: 11px; color: var(--desc-color); }
.spec-link-arrow { color: var(--gold); font-size: 14px; flex-shrink: 0; transition: transform 0.2s; }
.spec-link:hover .spec-link-arrow { transform: translateX(-3px); }
.spec-link.coming { opacity: 0.6; cursor: not-allowed; }
.spec-link.coming:hover { transform: none; background: var(--bg-section); border-color: var(--gray-light); }
.coming-badge { font-size: 9px; font-weight: 700; color: var(--desc-color); background: var(--gray-light); padding: 2px 8px; border-radius: 20px; }

/* ===== CURRICULUM VIEW ===== */
.spec-header { width: 100%; background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-dark-2) 100%); border-radius: 24px; padding: 28px 28px; display: flex; align-items: center; gap: 18px; box-shadow: 0 10px 40px rgba(0,0,0,0.3); position: relative; overflow: hidden; }
.spec-header::before { content: ''; position: absolute; top: -30%; left: -10%; width: 50%; height: 160%; background: radial-gradient(ellipse, rgba(212,175,55,0.1), transparent 70%); pointer-events: none; }
.spec-header-icon { width: 64px; height: 64px; border-radius: 18px; background: rgba(212,175,55,0.15); border: 1px solid rgba(212,175,55,0.3); display: flex; align-items: center; justify-content: center; flex-shrink: 0; position: relative; z-index: 1; }
.spec-header-icon i { font-size: 30px; color: var(--gold); }
.spec-header-text { position: relative; z-index: 1; flex: 1; }
.spec-header-college { font-size: 12px; font-weight: 600; color: var(--gold-glow); }
.spec-header-name { font-size: 22px; font-weight: 900; color: var(--white); margin-top: 2px; }
.spec-header-name-en { font-size: 13px; color: rgba(255,255,255,0.7); margin-top: 2px; }
@media (max-width: 640px) { .spec-header { padding: 20px; flex-direction: column; text-align: center; } .spec-header-text { text-align: center; } }

/* Stats row */
.spec-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.spec-stat { background: var(--white); border-radius: 16px; padding: 16px 12px; text-align: center; box-shadow: 0 2px 12px rgba(0,0,0,0.06); border: 1px solid var(--gray-light); }
.spec-stat-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin: 0 auto 8px; background: var(--icon-circle-bg); }
.spec-stat-icon i { font-size: 18px; color: var(--btn-bg); }
.spec-stat-num { font-size: 22px; font-weight: 900; color: var(--title-color); }
.spec-stat-label { font-size: 10px; color: var(--desc-color); margin-top: 2px; }

/* ===== LEVEL TABS (sticky) ===== */
.level-tabs-bar { width: 100%; background: var(--white); border-radius: 16px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); overflow: hidden; position: sticky; top: 12px; z-index: 50; border: 1px solid var(--gray-light); }
.level-tabs-scroll { display: flex; gap: 6px; overflow-x: auto; padding: 10px; scrollbar-width: thin; }
.level-tabs-scroll::-webkit-scrollbar { height: 4px; }
.level-tabs-scroll::-webkit-scrollbar-thumb { background: rgba(7,72,66,0.2); border-radius: 20px; }
.level-tab { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 20px; border: 1.5px solid var(--gray-light); background: var(--white); color: var(--desc-color); font-size: 13px; font-weight: 700; transition: var(--transition); white-space: nowrap; flex-shrink: 0; }
.level-tab:hover { border-color: var(--gold); color: var(--btn-bg); background: #fffbeb; }
.level-tab.active { background: var(--btn-bg); color: var(--white); border-color: var(--btn-bg); box-shadow: 0 2px 8px rgba(7,72,66,0.25); }
.level-tab i { font-size: 12px; }
.level-tab .tab-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 10px; font-size: 10px; font-weight: 800; background: rgba(255,255,255,0.2); }
.level-tab:not(.active) .tab-count { background: var(--bg-section); color: var(--desc-color); }

/* ===== LEVEL SECTIONS ===== */
.level-section { margin-bottom: 24px; scroll-margin-top: 130px; }
.level-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding: 0 4px; }
.level-badge { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, var(--gold), var(--gold-dark)); display: flex; align-items: center; justify-content: center; color: var(--white); font-size: 18px; font-weight: 900; flex-shrink: 0; box-shadow: 0 4px 12px rgba(212,175,55,0.25); }
.level-title { font-size: 17px; font-weight: 800; color: var(--title-color); }
.level-subtitle { font-size: 12px; color: var(--desc-color); }
.level-hours { margin-right: auto; background: var(--bg-section); color: var(--gold-dark); font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 20px; }

/* ===== COURSE TABLE ===== */
.courses-table-wrap { background: var(--white); border-radius: var(--radius-card); overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.courses-scroll { overflow-x: auto; }
table.courses-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 600px; }
table.courses-table thead th { background: rgba(236,253,245,0.7); color: var(--title-color); font-size: 12px; font-weight: 700; padding: 12px 16px; text-align: right; border-bottom: 2px solid #d1fae5; white-space: nowrap; }
table.courses-table tbody td { padding: 12px 16px; border-bottom: 1px solid rgba(209,250,229,0.6); vertical-align: middle; }
table.courses-table tbody tr:last-child td { border-bottom: none; }
table.courses-table tbody tr { transition: background 0.15s; }
table.courses-table tbody tr:hover { background: rgba(236,253,245,0.4); }
.course-code { font-weight: 800; color: var(--btn-bg); white-space: nowrap; }
.course-code.optional { color: #7c3aed; }
.course-name { font-weight: 600; color: var(--title-color); }
.course-hours { text-align: center; font-weight: 800; color: var(--gold-dark); }
.course-hours-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 28px; padding: 0 8px; border-radius: 8px; background: rgba(212,175,55,0.12); color: var(--gold-dark); font-size: 12px; font-weight: 800; }
.course-prereq { font-size: 12px; color: var(--desc-color); }
.course-prereq.none { color: #9ca3af; font-style: italic; }
.prereq-chip { display: inline-block; background: rgba(7,72,66,0.08); color: var(--btn-bg); font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 6px; margin: 1px 2px; }
.prereq-chip.special { background: rgba(124,58,237,0.1); color: #7c3aed; }

/* Mobile card view for courses */
@media (max-width: 640px) {
  table.courses-table { min-width: auto; }
  table.courses-table thead { display: none; }
  table.courses-table, table.courses-table tbody, table.courses-table tr, table.courses-table td { display: block; width: 100%; }
  table.courses-table tr { background: var(--white); border: 1px solid var(--gray-light); border-radius: 12px; margin-bottom: 10px; padding: 12px; }
  table.courses-table td { border: none; padding: 6px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  table.courses-table td::before { content: attr(data-label); font-weight: 700; color: var(--desc-color); font-size: 11px; flex-shrink: 0; }
  table.courses-table tr:hover { background: var(--white); }
}

/* Helper note */
.helper-note { display: flex; align-items: flex-start; gap: 12px; border: 1px solid rgba(212,175,55,0.3); background: rgba(255,251,235,0.6); border-radius: var(--radius-card); padding: 16px; }
.helper-note .star { font-size: 18px; color: var(--gold); flex-shrink: 0; margin-top: 2px; }
.helper-note .note-title { font-size: 13px; font-weight: 700; color: var(--title-color); margin-bottom: 4px; }
.helper-note .note-text { font-size: 12px; line-height: 1.6; color: rgba(7,72,66,0.8); }

/* FOOTER */
.footer { width: 100%; background: var(--bg-dark); background-image: linear-gradient(135deg, rgba(1,42,43,0.95) 0%, rgba(10,44,44,0.95) 100%); border-radius: 24px; padding: 24px; box-shadow: 0 10px 40px rgba(0,0,0,0.4); }
.footer-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand img { width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(212,175,55,0.5); object-fit: contain; }
.footer-brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.footer-brand-name { font-size: 16px; font-weight: 700; color: var(--gold); }
.footer-brand-sub { font-size: 11px; color: rgba(255,255,255,0.8); }
.footer-whatsapp { display: flex; align-items: center; gap: 8px; background: #25D366; color: var(--white); padding: 10px 20px; border-radius: 12px; font-size: 14px; font-weight: 700; transition: var(--transition); }
.footer-whatsapp:hover { background: #1fae54; transform: translateY(-2px); }
.footer-whatsapp i { font-size: 16px; }
.footer-social { display: flex; align-items: center; gap: 12px; }
.footer-social-icons { display: flex; gap: 10px; }
.social-link { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: var(--transition); color: var(--white); }
.social-link:hover { transform: scale(1.1); }
.social-link.snapchat { background: #FFFC00; color: #000; }
.social-link.telegram { background: #0088CC; }
.social-link.x { background: #000; }
.social-link i { font-size: 16px; }
.footer-phone { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--gold); direction: ltr; }
.footer-phone i { font-size: 14px; }
.footer-divider { height: 1px; width: 100%; background: rgba(212,175,55,0.3); margin: 20px 0; }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; }
.footer-copy { color: rgba(255,255,255,0.7); }
.footer-slogan { display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,0.9); }
.footer-slogan .star { color: var(--gold); }
.footer-made { display: flex; align-items: center; gap: 4px; color: rgba(255,255,255,0.7); }
.footer-made .heart { color: #10b981; }
