/* كنز العلم - منصة تعليمية لكل المراحل */
/* RTL Arabic Design System */

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

/* CSS Variables & Reset */
:root {
  --primary-dark: #0b1324;
  --primary-light: #1c2541;
  --gold-primary: #d4af37;
  --gold-light: #f4e4bc;
  --gold-gradient: linear-gradient(135deg, #d4af37 0%, #f4e4bc 50%, #d4af37 100%);
  --text-primary: #ffffff;
  --text-secondary: #e0e0e0;
  --card-bg: rgba(255, 255, 255, 0.05);
  --border-color: rgba(212, 175, 55, 0.3);
  --shadow-light: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 8px 16px rgba(0, 0, 0, 0.2);
  --shadow-heavy: 0 16px 32px rgba(0, 0, 0, 0.3);
  --transition: all 0.3s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Cairo', sans-serif;
  background-color: var(--primary-dark);
  color: var(--text-primary);
  line-height: 1.6;
  direction: rtl;
  text-align: right;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
html, body { height: 100%; }

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--gold-light);
}
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p { margin-bottom: 1rem; color: var(--text-secondary); }

a { color: var(--gold-light); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--gold-primary); }

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }

/* Buttons */
.btn {
  display: inline-block; padding: 0.75rem 1.5rem; border: none; border-radius: 8px;
  font-family: 'Cairo', sans-serif; font-size: 1rem; font-weight: 600;
  cursor: pointer; transition: var(--transition); text-align: center; text-decoration: none;
}
.btn-primary { background: var(--gold-gradient); color: var(--primary-dark); box-shadow: var(--shadow-light); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-medium); }
.btn-secondary { background: transparent; color: var(--gold-light); border: 2px solid var(--gold-primary); }
.btn-secondary:hover { background: var(--gold-primary); color: var(--primary-dark); }

/* Social Media Buttons */
.btn.fb { background: #1877F2 !important; color: #fff !important; }
.btn.fb:hover { background: #166fe5 !important; transform: translateY(-2px); }
.btn.yt { background: #FF0000 !important; color: #fff !important; }
.btn.yt:hover { background: #cc0000 !important; transform: translateY(-2px); }
.btn.wa { background: #25D366 !important; color: #fff !important; }
.btn.wa:hover { background: #20ba56 !important; transform: translateY(-2px); }
.btn.loc { background: var(--gold-gradient) !important; color: var(--primary-dark) !important; }
.btn.loc:hover { transform: translateY(-2px); box-shadow: var(--shadow-medium); }

/* Cards */
.card {
  background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px;
  padding: 1.5rem; margin-bottom: 1.5rem; box-shadow: var(--shadow-light); transition: var(--transition);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-medium); }

/* Header */
.header {
  background: var(--primary-light); box-shadow: var(--shadow-light);
  position: sticky; top: 0; z-index: 1000; backdrop-filter: blur(10px);
}
.header-content { display: flex; justify-content: space-between; align-items: center; padding: 1rem 0; }

.logo-section { display: flex; align-items: center; gap: 1rem; }
.logo { width: 50px; height: 50px; border-radius: 8px; object-fit: cover; }
.brand-info h1 { font-size: 1.5rem; margin-bottom: 0.25rem; }
.brand-info p { font-size: 0.9rem; margin-bottom: 0; }

/* Navigation (Desktop) */
.nav-menu { position: relative; }
.nav-menu .menu-list{
  list-style: none;
  display: flex;            /* العناصر جنب بعض */
  align-items: center;
  gap: 1rem 1.5rem;
  margin: 0;
  padding: 0;
}
.nav-item { position: relative; }
.dropbtn{
  background: none; border: none; color: var(--text-primary);
  font-family: 'Cairo', sans-serif; font-size: 1rem; font-weight: 600;
  cursor: pointer; padding: 0.5rem 1rem; border-radius: 6px; transition: var(--transition);
}
.dropbtn:hover{ background: rgba(212,175,55,.1); color: var(--gold-light); }

.dropdown{ position: relative; }
.dropmenu{
  position: absolute; top: 100%; right: 0;
  background: var(--primary-light); min-width: 200px;
  box-shadow: var(--shadow-heavy); border-radius: 8px; border: 1px solid var(--border-color);
  opacity: 0; visibility: hidden; transform: translateY(-10px);
  transition: var(--transition); z-index: 1001; padding: .25rem 0;
}
.dropdown:hover .dropmenu, .dropdown.active .dropmenu{ opacity: 1; visibility: visible; transform: translateY(0); }
.dropmenu a{
  display: block; padding: 0.75rem 1rem; color: var(--text-primary);
  border-bottom: 1px solid rgba(212,175,55,.1); transition: var(--transition);
}
.dropmenu a:hover{ background: rgba(212,175,55,.1); color: var(--gold-light); }
.dropmenu a:last-child{ border-bottom: none; }

/* Mobile Menu Toggle */
.mobile-menu-toggle{ display: none; background: none; border: none; color: var(--text-primary); font-size: 1.5rem; cursor: pointer; }

/* Hero */
.hero{ padding: 4rem 0; text-align: center; background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%); }
.hero-content{ display: flex; flex-direction: column; align-items: center; gap: 2rem; }
.hero-logo{ width: 120px; height: 120px; border-radius: 12px; object-fit: cover; box-shadow: var(--shadow-medium); }
.hero h1{
  font-size: 3rem; margin-bottom: 1rem;
  background: var(--gold-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero p{ font-size: 1.25rem; max-width: 600px; margin: 0 auto; }

/* Stage Cards */
.stages{ padding: 3rem 0; }
.stages-grid{ display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; margin-top: 2rem; }
.stage-card{
  background: var(--card-bg); border: 2px solid var(--border-color); border-radius: 12px;
  padding: 2rem; text-align: center; transition: var(--transition); cursor: pointer;
}
.stage-card:hover{ border-color: var(--gold-primary); transform: translateY(-4px); box-shadow: var(--shadow-medium); }
.stage-card.active{ border-color: var(--gold-primary); background: rgba(212,175,55,.1); }
.stage-card h3{ color: var(--gold-light); margin-bottom: 1rem; }

/* Subjects */
.subjects{ padding: 3rem 0; }
.subjects-grid{ display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 2rem; margin-top: 2rem; }
.subject-card{
  background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden; transition: var(--transition);
}
.subject-card:hover{ transform: translateY(-4px); box-shadow: var(--shadow-medium); }
.subject-card img{ width: 100%; height: 200px; object-fit: cover; }
.subject-card-content{ padding: 1.5rem; }
.subject-card h3{ margin-bottom: .5rem; }
.subject-card p{ margin-bottom: 1rem; font-size: .9rem; }

/* Filters & Courses */
.filters{ background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; padding: 1.5rem; margin-bottom: 2rem; }
.filters-grid{ display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.filter-group{ display: flex; flex-direction: column; gap: .5rem; }
.filter-group label{ font-weight: 600; color: var(--gold-light); }
.filter-group select{
  padding: .75rem; border: 1px solid var(--border-color); border-radius: 6px; background: var(--primary-dark); color: var(--text-primary); font-family: 'Cairo', sans-serif;
}

.courses-grid{ display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.course-card{ background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden; transition: var(--transition); }
.course-card:hover{ transform: translateY(-4px); box-shadow: var(--shadow-medium); }
.course-card img{ width: 100%; height: 180px; object-fit: cover; }
.course-card-content{ padding: 1.5rem; }
.course-card h3{ margin-bottom: .5rem; }
.course-card p{ margin-bottom: 1rem; font-size: .9rem; }
.course-tags{ display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.tag{ background: rgba(212,175,55,.2); color: var(--gold-light); padding: .25rem .75rem; border-radius: 20px; font-size: .8rem; font-weight: 600; }

/* Course Page Layout */
.course-layout{ display: grid; grid-template-columns: 350px 1fr; gap: 2rem; padding: 2rem 0; }
.playlist{
  background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px;
  padding: 1.5rem; height: fit-content; position: sticky; top: 100px;
}
.playlist h3{ margin-bottom: 1rem; color: var(--gold-light); }
.unit{ margin-bottom: 1rem; }
.unit-header{
  background: rgba(212,175,55,.1); border: 1px solid var(--border-color); border-radius: 8px;
  padding: 1rem; cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: var(--transition);
}
.unit-header:hover{ background: rgba(212,175,55,.2); }
.unit-content{ max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.unit.active .unit-content{ max-height: 500px; }
.lesson-item{
  padding: .75rem; border-bottom: 1px solid rgba(212,175,55,.1); cursor: pointer; transition: var(--transition);
  display: flex; justify-content: space-between; align-items: center;
}
.lesson-item:hover{ background: rgba(212,175,55,.05); }
.lesson-item.active{ background: rgba(212,175,55,.1); color: var(--gold-light); }
.lesson-item.next{ border-right: 3px solid var(--gold-primary); }
.lesson-status{ font-size: .8rem; color: var(--gold-light); }
.player-section{ background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; padding: 1.5rem; }
.video-container{ position: relative; width: 100%; height: 0; padding-bottom: 56.25%; margin-bottom: 1rem; }
.video-container iframe{ position: absolute; top: 0; right: 0; width: 100%; height: 100%; border: none; border-radius: 8px; }
.progress-bar{ width: 100%; height: 8px; background: rgba(212,175,55,.2); border-radius: 4px; overflow: hidden; margin-bottom: 1rem; }
.progress-fill{ height: 100%; background: var(--gold-gradient); width: 0%; transition: width .3s ease; }

/* Teacher */
.teacher-banner{ width: 100%; height: 300px; object-fit: cover; border-radius: 12px; margin-bottom: 2rem; }
.teacher-info{ background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; padding: 2rem; margin-bottom: 2rem; text-align: center; }
.teacher-avatar{ width: 120px; height: 120px; border-radius: 50%; object-fit: cover; margin: 0 auto 1rem; border: 3px solid var(--gold-primary); }
.teacher-badges{ display: flex; justify-content: center; gap: 1rem; margin: 1rem 0; }
.badge{ background: rgba(212,175,55,.2); color: var(--gold-light); padding: .5rem 1rem; border-radius: 20px; font-size: .9rem; font-weight: 600; }
.teacher-actions{ display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; }

/* Contact */
.contact-content{ display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; padding: 2rem 0; }
.map-container{ background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; padding: 1.5rem; }
.map-container iframe{ width: 100%; height: 400px; border: none; border-radius: 8px; }
.contact-info{ background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; padding: 1.5rem; }
.social-links{ display: flex; gap: 1rem; margin: 1rem 0; flex-wrap: wrap; }
.whatsapp-form{ background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; padding: 1.5rem; margin-top: 2rem; }
.form-group{ margin-bottom: 1rem; }
.form-group label{ display: block; margin-bottom: .5rem; color: var(--gold-light); font-weight: 600; }
.form-group input, .form-group select, .form-group textarea{
  width: 100%; padding: .75rem; border: 1px solid var(--border-color); border-radius: 6px; background: var(--primary-dark); color: var(--text-primary); font-family: 'Cairo', sans-serif;
}
.form-group textarea{ resize: vertical; min-height: 100px; }

/* Footer */
.footer{ background: var(--primary-light); border-top: 1px solid var(--border-color); margin-top: auto; padding: 3rem 0 1rem; }
.footer-content{
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; margin-bottom: 2rem;
}
.footer-section h3{ color: var(--gold-light); margin-bottom: 1rem; }
.footer-section ul{ list-style: none; }
.footer-section ul li{ margin-bottom: .5rem; }
.footer-section ul li a{ color: var(--text-secondary); transition: var(--transition); }
.footer-section ul li a:hover{ color: var(--gold-light); }
.footer-social{ display: flex; gap: 1rem; margin-top: 1rem; flex-wrap: wrap; }
.footer-bottom{ text-align: center; padding-top: 2rem; border-top: 1px solid var(--border-color); color: var(--text-secondary); }
.footer-bottom a{ color: var(--gold-light); font-weight: 600; }

/* Modal */
.modal{
  display: none; position: fixed; z-index: 2000; right: 0; top: 0; width: 100%; height: 100%;
  background-color: rgba(0,0,0,.8); backdrop-filter: blur(5px);
}
.modal-content{
  background-color: var(--primary-light); margin: 5% auto; padding: 0; border: 1px solid var(--border-color);
  border-radius: 12px; width: 90%; max-width: 800px; max-height: 80vh; display: flex; flex-direction: column;
}
.modal-header{
  padding: 1rem 1.5rem; border-bottom: 1px solid var(--border-color);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-title{ color: var(--gold-light); margin: 0; }
.close{ color: var(--text-primary); font-size: 28px; font-weight: bold; cursor: pointer; transition: var(--transition); }
.close:hover{ color: var(--gold-light); }
.modal-body{ padding: 0; flex: 1; display: flex; flex-direction: column; }
.viewer-frame{ width: 100%; height: 60vh; border: none; border-radius: 0 0 12px 12px; }
.modal-actions{ padding: 1rem 1.5rem; border-top: 1px solid var(--border-color); display: flex; gap: 1rem; justify-content: flex-end; }

/* Toast */
.toast{
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  background: var(--gold-gradient); color: var(--primary-dark);
  padding: 1rem 2rem; border-radius: 8px; box-shadow: var(--shadow-heavy);
  z-index: 3000; opacity: 0; visibility: hidden; transition: var(--transition);
}
.toast.show{ opacity: 1; visibility: visible; }

/* Animations */
.fade-in{ animation: fadeIn .5s ease-in; }
@keyframes fadeIn{ from{opacity:0; transform: translateY(20px);} to{opacity:1; transform: translateY(0);} }
.lift{ animation: lift .5s ease-out; }
@keyframes lift{ from{ transform: translateY(20px); opacity: 0; } to{ transform: translateY(0); opacity: 1; } }

/* Responsive */
@media (max-width: 768px){
  .header-content{ flex-direction: column; gap: 1rem; }
  .nav-menu{ width: 100%; display: none; }      /* تخفي القائمة */
  .nav-menu.active{ display: block; }           /* وتظهر عند التفعيل */
  .nav-menu .menu-list{ flex-direction: column; align-items: stretch; gap: .25rem; }
  .dropdown .dropmenu{
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: none; background: transparent; padding: 0;
  }
  .dropmenu a{ padding-inline: 0; }
  .mobile-menu-toggle{ display: block; }

  .hero h1{ font-size: 2rem; }
  .hero p{ font-size: 1rem; }
  .stages-grid, .subjects-grid, .courses-grid{ grid-template-columns: 1fr; }
  .course-layout{ grid-template-columns: 1fr; }
  .playlist{ position: static; }
  .contact-content{ grid-template-columns: 1fr; }
  .footer-content{ grid-template-columns: 1fr; text-align: center; }
  .teacher-actions, .social-links{ flex-direction: column; align-items: center; }
  .filters-grid{ grid-template-columns: 1fr; }
}
@media (max-width: 480px){
  .container{ padding: 0 .5rem; }
  h1{ font-size: 2rem; } h2{ font-size: 1.5rem; } h3{ font-size: 1.25rem; }
  .hero{ padding: 2rem 0; }
  .hero-logo{ width: 80px; height: 80px; }
  .modal-content{ width: 95%; margin: 10% auto; }
  .viewer-frame{ height: 50vh; }
}
