/* --- Global Variables & Basic Reset (استخدم نفس المتغيرات من ملفات CSS الأخرى لـ Creen) --- */
:root {
  --legal-primary-color: #007bff; /* اللون الأزرق الرئيسي لـ Creen */
  --legal-bg: #f7fafc; /* خلفية رمادية فاتحة جدًا */
  --legal-card-bg: #ffffff;
  --legal-header-bg: #ffffff;
  --legal-text-primary: #1a202c;
  --legal-text-secondary: #4a5568;
  --legal-text-light: #718096;
  --legal-border-color: #e2e8f0;
  --font-family-legal: "Cairo", sans-serif;
  --safe-area-top-legal: env(safe-area-inset-top, 0px);
  --border-radius-legal: 8px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html,
body {
  font-family: var(--font-family-legal);
  background-color: var(--legal-bg);
  color: var(--legal-text-primary);
  line-height: 1.7; /* مسافة جيدة بين الأسطر للنصوص الطويلة */
  direction: rtl;
  min-height: 100vh;
  font-size: 15px; /* حجم خط مناسب للقراءة */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a {
  text-decoration: none;
  color: var(--legal-primary-color);
  font-weight: 600;
}
a:hover {
  text-decoration: underline;
}

.legal-page-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.legal-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background-color: var(--legal-header-bg);
  border-bottom: 1px solid var(--legal-border-color);
  flex-shrink: 0;
  position: sticky; /* Or fixed */
  top: 0;
  z-index: 10;
  padding-top: calc(var(--safe-area-top-legal) + 12px);
}
.legal-page-header h1 {
  font-size: 1.15em;
  font-weight: 700;
  color: var(--legal-text-primary);
  text-align: center;
  flex-grow: 1;
}
.action-btn-legal {
  background: none;
  border: none;
  font-size: 1.3em;
  color: var(--legal-text-secondary);
  cursor: pointer;
  padding: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.action-btn-legal:hover {
  color: var(--legal-primary-color);
}

.legal-page-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 20px;
}

/* Help Center Specific Styles */
.search-help-section {
  position: relative;
  margin-bottom: 30px;
}
.search-help-section input {
  width: 100%;
  padding: 12px 15px 12px 45px; /* Space for icon on left (RTL) */
  border: 1px solid var(--legal-border-color);
  border-radius: var(--border-radius-legal);
  font-family: var(--font-family-legal);
  font-size: 1em;
  background-color: var(--legal-card-bg);
}
.search-help-section input::placeholder {
  color: var(--legal-text-light);
}
.search-help-section i.fa-search {
  position: absolute;
  top: 50%;
  left: 15px; /* RTL */
  transform: translateY(-50%);
  color: var(--legal-text-light);
  font-size: 1.1em;
}

.faq-section h2,
.contact-support-section h2 {
  font-size: 1.3em;
  font-weight: 700;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--legal-border-color);
}
.contact-support-section {
  margin-top: 30px;
  text-align: center;
}
.contact-support-section p {
  margin-bottom: 15px;
  color: var(--legal-text-secondary);
}
.btn-legal.contact-support-btn {
  background-color: var(--legal-primary-color);
  color: white;
  padding: 10px 25px;
  border-radius: var(--border-radius-legal);
  font-size: 1em;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 5px rgba(0, 123, 255, 0.2);
}
.btn-legal.contact-support-btn:hover {
  background-color: #0056b3;
}

.faq-item {
  margin-bottom: 10px;
  border: 1px solid var(--legal-border-color);
  border-radius: var(--border-radius-legal);
  background-color: var(--legal-card-bg);
  overflow: hidden; /* For smooth transition */
}
.faq-question {
  width: 100%;
  padding: 15px;
  background: none;
  border: none;
  text-align: right; /* RTL */
  font-family: var(--font-family-legal);
  font-size: 1em;
  font-weight: 600;
  color: var(--legal-text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-question i.fa-chevron-down {
  transition: transform 0.3s ease;
  font-size: 0.9em;
  color: var(--legal-text-secondary);
}
.faq-question.active i.fa-chevron-down {
  transform: rotate(180deg);
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, padding 0.3s ease-out;
  background-color: #fdfdfd; /* Slightly different bg for answer */
}
.faq-answer.active {
  /* max-height will be set by JS based on scrollHeight */
  padding: 0px 15px 15px 15px;
}
.faq-answer p {
  font-size: 0.95em;
  color: var(--legal-text-secondary);
  line-height: 1.8;
}

/* Text Content Section (Privacy Policy, Terms of Service) */
.text-content-section .last-updated {
  font-size: 0.85em;
  color: var(--legal-text-light);
  margin-bottom: 20px;
  text-align: center;
}
.text-content-section h2 {
  font-size: 1.4em;
  font-weight: 700;
  color: var(--legal-text-primary);
  margin-top: 25px;
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--legal-border-color);
}
.text-content-section h2:first-of-type {
  margin-top: 0;
}
.text-content-section p {
  font-size: 1em;
  color: var(--legal-text-secondary);
  margin-bottom: 15px;
  line-height: 1.8;
}
.text-content-section ul {
  list-style: disc; /* أو decimal, circle */
  margin-right: 20px; /* RTL padding for list items */
  padding-right: 5px;
  margin-bottom: 15px;
}
.text-content-section ul li {
  font-size: 0.95em;
  color: var(--legal-text-secondary);
  margin-bottom: 8px;
}

/* Responsive */
@media (max-width: 768px) {
  .legal-page-header h1 {
    font-size: 1.1em;
  }
  .legal-page-content {
    padding: 15px;
  }
  .search-help-section input {
    font-size: 0.95em;
  }
  .faq-section h2,
  .contact-support-section h2,
  .text-content-section h2 {
    font-size: 1.2em;
  }
  .faq-question {
    font-size: 0.95em;
    padding: 12px;
  }
  .faq-answer p,
  .text-content-section p,
  .text-content-section ul li {
    font-size: 0.9em;
  }
}
@media (max-width: 480px) {
  body {
    font-size: 14px;
  }
  .legal-page-header h1 {
    font-size: 1em;
  }
  .action-btn-legal {
    font-size: 1.2em;
  }
  .text-content-section h2 {
    font-size: 1.1em;
  }
}
