@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,700&family=Cairo:wght@300;400;600;700;800&display=swap');

:root {
  --primary-color: #BA002C;
  --primary-dark: #900022;
  --secondary-color: #1D427D;
  --text-dark: #222222;
  --text-muted: #555555;
  --bg-light: #F8F9FA;
  --white: #FFFFFF;
  --border-color: #E0E0E0;
}

*, *:before, *:after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  font-family: 'Roboto', 'Cairo', sans-serif;
  color: var(--text-dark);
  background-color: var(--white);
  line-height: 1.6;
  direction: ltr;
}

body.rtl {
  direction: rtl;
  font-family: 'Cairo', 'Roboto', sans-serif;
  text-align: right;
}

p, h1, h2, h3, h4, h5, h6, span, a, li, td, th {
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Header */
.header-wrapper {
  background: var(--white);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 0;
  gap: 15px;
}

.logo img {
  height: 45px;
  max-width: 100%;
  object-fit: contain;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--white);
  padding: 10px 22px;
  border-radius: 6px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
  display: inline-block;
  text-align: center;
  line-height: 1.3;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
}

.lang-toggle {
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  color: var(--secondary-color);
  transition: all 0.3s;
}

.lang-toggle:hover {
  background: var(--secondary-color);
  color: var(--white);
}

.btn-auth {
  background-color: var(--secondary-color);
  color: var(--white);
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 600;
  transition: background 0.3s, transform 0.2s;
  display: inline-block;
  text-align: center;
}

.btn-auth:hover {
  background-color: #132d5e;
  transform: translateY(-2px);
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 26px;
  color: var(--secondary-color);
  cursor: pointer;
  padding: 5px;
}

/* Navbar */
.navbar {
  background: var(--secondary-color);
  padding: 0 20px;
  width: 100%;
}

.nav-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.nav-list li a, .dropdown-toggle {
  color: var(--white);
  padding: 14px 10px;
  display: block;
  font-size: 15px;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-list li a:hover, .nav-list li a.active, .dropdown-toggle:hover {
  color: #ffcccc;
}

.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--white);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  min-width: 240px;
  display: none;
  border-radius: 6px;
  z-index: 100;
}

body.rtl .dropdown-menu {
  left: auto;
  right: 0;
}

.dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-menu li a {
  color: var(--text-dark);
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
}

.dropdown-menu li a:hover {
  background: var(--bg-light);
  color: var(--primary-color);
}

/* Mobile Drawer */
.mobile-drawer {
  position: fixed;
  top: 0;
  left: -100%;
  width: 290px;
  max-width: 85vw;
  height: 100%;
  background: var(--white);
  box-shadow: 5px 0 20px rgba(0,0,0,0.15);
  z-index: 2000;
  transition: all 0.3s ease;
  overflow-y: auto;
  padding: 20px;
}

body.rtl .mobile-drawer {
  left: auto;
  right: -100%;
}

.mobile-drawer.open {
  left: 0;
}

body.rtl .mobile-drawer.open {
  right: 0;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 15px;
}

.drawer-header img {
  height: 38px;
}

.close-drawer {
  background: none;
  border: none;
  font-size: 26px;
  cursor: pointer;
  color: var(--text-dark);
}

.mobile-nav-list li {
  margin-bottom: 12px;
}

.mobile-nav-list li a {
  color: var(--secondary-color);
  font-weight: 700;
  font-size: 16px;
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
}

.mobile-nav-list li a:hover {
  background: var(--bg-light);
  color: var(--primary-color);
}

.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1500;
  display: none;
}

.drawer-overlay.open {
  display: block;
}

/* Hero Banner */
.hero-banner {
  background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
  padding: 50px 0;
  width: 100%;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 35px;
  align-items: center;
}

.hero-content h1 {
  font-size: 36px;
  color: var(--secondary-color);
  margin-bottom: 18px;
  font-weight: 800;
  line-height: 1.35;
}

.hero-content h1 span {
  color: var(--primary-color);
}

.hero-content p {
  font-size: 17px;
  color: var(--text-muted);
  margin-bottom: 25px;
  line-height: 1.7;
}

.hero-buttons {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.btn-outline {
  border: 2px solid var(--secondary-color);
  color: var(--secondary-color);
  padding: 10px 22px;
  border-radius: 6px;
  font-weight: 600;
  background: transparent;
  display: inline-block;
  text-align: center;
  transition: all 0.3s;
}

.btn-outline:hover {
  background: var(--secondary-color);
  color: var(--white);
}

.hero-image-box {
  text-align: center;
  width: 100%;
}

.hero-image-box img {
  border-radius: 16px;
  box-shadow: 0 12px 35px rgba(0,0,0,0.15);
  max-height: 520px;
  width: 100%;
  object-fit: contain;
  background: #fff;
  padding: 8px;
  border: 1px solid var(--border-color);
}

/* Section Common */
.section-gap {
  padding: 70px 0;
  width: 100%;
}

.section-title {
  text-align: center;
  margin-bottom: 45px;
}

.section-title h2 {
  font-size: 34px;
  color: var(--text-dark);
  font-weight: 800;
}

.section-title h2 span {
  color: var(--primary-color);
}

.section-title p {
  color: var(--text-muted);
  max-width: 750px;
  margin: 12px auto 0;
  font-size: 16px;
  line-height: 1.7;
}

/* Upcoming Events Table */
.table-wrapper {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.05);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-color);
  width: 100%;
  margin-bottom: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  min-width: 580px;
}

body.rtl table {
  text-align: right;
}

th, td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
}

th {
  background-color: var(--secondary-color);
  color: var(--white);
  font-weight: 700;
  font-size: 15px;
}

tr:hover {
  background-color: var(--bg-light);
}

/* About Us Section */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.about-text h3 {
  font-size: 30px;
  margin-bottom: 18px;
  color: var(--secondary-color);
  font-weight: 800;
}

.about-text p {
  margin-bottom: 15px;
  color: var(--text-muted);
  line-height: 1.8;
}

/* Latest News */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  width: 100%;
}

.news-card {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  border: 1px solid var(--border-color);
  transition: transform 0.3s;
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  transform: translateY(-5px);
}

.news-img img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.news-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.news-date {
  font-size: 13px;
  color: var(--primary-color);
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.news-body h3 {
  font-size: 19px;
  margin-bottom: 10px;
  color: var(--text-dark);
  font-weight: 700;
}

.news-body p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

/* Why Us */
.why-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  background: var(--bg-light);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
}

.why-features {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 25px;
}

.why-feature-item {
  display: flex;
  gap: 15px;
  align-items: flex-start;
}

.why-feature-item h4 {
  font-size: 18px;
  margin-bottom: 4px;
  color: var(--secondary-color);
  font-weight: 700;
}

.why-feature-item p {
  color: var(--text-muted);
  font-size: 14px;
}

/* Gallery Section */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  width: 100%;
}

.gallery-item {
  border-radius: 12px;
  overflow: hidden;
  height: 240px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery-item:hover img {
  transform: scale(1.06);
}

/* Testimonials */
.testimonial-card {
  background: var(--white);
  border-radius: 16px;
  padding: 35px;
  text-align: center;
  max-width: 850px;
  margin: 0 auto;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
  width: 100%;
}

.testimonial-card p {
  font-size: 17px;
  color: var(--text-dark);
  margin-bottom: 25px;
  line-height: 1.8;
}

/* Worldwide Countries */
.countries-list-box {
  background: var(--bg-light);
  padding: 35px;
  border-radius: 16px;
  margin-top: 35px;
  width: 100%;
}

.countries-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  text-align: left;
}

body.rtl .countries-columns {
  text-align: right;
}

.countries-columns ul li {
  padding: 5px 0;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 14px;
}

/* Representative Banner Spotlight */
.rep-spotlight-card {
  background: var(--white);
  border-radius: 20px;
  padding: 40px;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
  width: 100%;
}

.rep-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 35px;
  align-items: center;
}

/* Footer */
.footer {
  background: var(--secondary-color);
  color: var(--white);
  padding: 50px 0 20px;
  width: 100%;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 25px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  padding-bottom: 35px;
}

.footer-logo img {
  height: 55px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.footer-links a {
  color: var(--white);
  font-size: 15px;
  font-weight: 500;
}

.footer-links a:hover {
  color: #ffcccc;
}

.social-links {
  display: flex;
  gap: 12px;
}

.social-links a {
  width: 42px;
  height: 42px;
  background: rgba(255,255,255,0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 18px;
  transition: all 0.3s;
}

.social-links a:hover {
  background: var(--primary-color);
  transform: translateY(-3px);
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  font-size: 14px;
  color: rgba(255,255,255,0.8);
}

/* Auth Cards */
.auth-card {
  background: var(--white);
  border-radius: 16px;
  padding: 35px;
  max-width: 580px;
  width: 100%;
  margin: 0 auto;
  box-shadow: 0 8px 25px rgba(0,0,0,0.08);
  border: 1px solid var(--border-color);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--secondary-color);
  font-size: 14px;
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.3s;
  background: #fff;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary-color);
}

/* Lightbox Modal */
.gallery-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.92);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 20px;
}

.gallery-modal.show {
  display: flex;
}

.gallery-modal img {
  max-width: 95%;
  max-height: 82vh;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  object-fit: contain;
}

.gallery-modal-close {
  position: absolute;
  top: 20px;
  right: 25px;
  color: #ffffff;
  font-size: 38px;
  cursor: pointer;
  z-index: 10000;
}

body.rtl .gallery-modal-close {
  right: auto;
  left: 25px;
}

.gallery-modal-caption {
  color: #ffffff;
  margin-top: 12px;
  font-size: 16px;
  text-align: center;
  font-weight: 600;
}

/* Responsive Media Queries */
@media (max-width: 992px) {
  .navbar {
    display: none;
  }
  .mobile-menu-btn {
    display: block;
  }
  .hero-grid, .about-grid, .why-grid, .rep-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .hero-content h1 {
    font-size: 28px;
  }
  .section-title h2 {
    font-size: 26px;
  }
  .why-grid, .rep-spotlight-card {
    padding: 25px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 15px;
  }
  .section-gap {
    padding: 45px 0;
  }
  .profile-grid {
    grid-template-columns: 1fr !important;
  }
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start !important;
  }
  .auth-card {
    padding: 25px 18px;
  }
  .btn-primary, .btn-auth, .btn-outline {
    padding: 9px 16px;
    font-size: 14px;
  }
  .top-header {
    gap: 10px;
  }
  .logo img {
    height: 38px;
  }
  .hero-image-box img {
    max-height: 420px;
  }
}

@media (max-width: 576px) {
  .hero-content h1 {
    font-size: 22px;
  }
  .hero-content p {
    font-size: 14px;
  }
  .top-header {
    flex-wrap: wrap;
  }
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  .logo img {
    height: 34px;
  }
}

/* Official Copernicus Syllabus Accordion Styles */
.syllabus-accordion-container {
  background: var(--bg-light);
  padding: 35px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  margin-bottom: 50px;
}

.accordian_wrap {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 20px;
}

.MuiAccordion-root, .MuiPaper-root.MuiAccordion-root {
  border-radius: 12px !important;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06) !important;
  border: 1px solid var(--border-color) !important;
  background: #ffffff !important;
  transition: all 0.3s ease;
}

.MuiAccordion-root:hover {
  box-shadow: 0 6px 18px rgba(186,0,44,0.15) !important;
}

.MuiAccordionSummary-root {
  width: 100%;
  background-color: var(--primary-color) !important;
  color: #ffffff !important;
  padding: 16px 24px !important;
  border: none !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  cursor: pointer !important;
  font-size: 17px !important;
  font-weight: 700 !important;
  text-align: right;
  transition: background-color 0.3s ease;
  outline: none;
}

body:not(.rtl) .MuiAccordionSummary-root {
  text-align: left;
}

.MuiAccordionSummary-root:hover {
  background-color: #920023 !important;
}

.MuiAccordionSummary-content {
  margin: 0 !important;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff !important;
  flex-grow: 1;
}

.MuiAccordionSummary-content p {
  margin: 0 !important;
  color: #ffffff !important;
  font-size: 17px !important;
  font-weight: 700 !important;
}

.MuiAccordionSummary-expandIconWrapper {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, background 0.3s ease;
  color: #ffffff;
  flex-shrink: 0;
}

.MuiAccordionSummary-root[aria-expanded="true"] .MuiAccordionSummary-expandIconWrapper {
  transform: rotate(45deg);
  background: rgba(255, 255, 255, 0.4);
}

.MuiCollapse-root {
  display: none;
  padding: 24px;
  background: #ffffff;
  border-top: 1px solid #f0f0f0;
  line-height: 1.8;
  color: var(--text-dark);
}

.MuiCollapse-root.open, .MuiCollapse-root[style*="display: block"] {
  display: block;
}

.syllabus-unit-card {
  background: #fdfdfd;
  border: 1px solid #edf2f7;
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 15px;
}

.syllabus-unit-title {
  font-weight: 800;
  color: var(--secondary-color);
  font-size: 16px;
  margin-bottom: 10px;
}

.syllabus-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.syllabus-list li {
  position: relative;
  padding-right: 20px;
  margin-bottom: 8px;
  font-size: 15px;
  color: var(--text-dark);
}

body:not(.rtl) .syllabus-list li {
  padding-right: 0;
  padding-left: 20px;
}

.syllabus-list li::before {
  content: "•";
  color: var(--primary-color);
  font-weight: bold;
  font-size: 18px;
  position: absolute;
  right: 0;
  top: -2px;
}

body:not(.rtl) .syllabus-list li::before {
  right: auto;
  left: 0;
}


/* Partners */
.partners-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 28px; margin-top: 30px; }
.partner-card { width: 220px; background: var(--white, #fff); border: 1px solid var(--border-color); border-radius: 16px; padding: 22px 16px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.partner-logo { width: 150px; height: 150px; display: flex; align-items: center; justify-content: center; }
.partner-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.partner-card h3 { font-size: 16px; color: var(--secondary-color); font-weight: 700; }
@media (max-width: 600px) { .partner-card { width: 100%; max-width: 280px; } }
