/* Base Variables & Theme Tokens */
:root {
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Form & Interactive */
  --transition: all 0.3s ease;
  --radius: 6px;
  --radius-lg: 12px;
}

/* Dark Theme (Default) */
body.dark-theme {
  --bg-color: #0d0d0f;
  --surface: #161619;
  --surface-hover: #1e1e24;
  --border: #2d2d33;
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;

  --primary-color: #ffffff;
  --primary-text: #000000;

  --secondary-bg: #212126;
  --secondary-border: #3f3f46;
}

/* Light Theme */
body.light-theme {
  --bg-color: #f4f4f5;
  --surface: #ffffff;
  --surface-hover: #f0f0f5;
  --border: #e4e4e7;
  --text-primary: #18181b;
  --text-secondary: #52525b;

  --primary-color: #18181b;
  --primary-text: #ffffff;

  --secondary-bg: #e4e4e7;
  --secondary-border: #d4d4d8;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color var(--transition), color var(--transition);
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: 1.2;
  font-weight: 700;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--text-secondary);
  font-size: 0.85em;
  font-weight: normal;
}

/* --- Layout Utility --- */
main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

.boxed {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  margin-bottom: 60px;
  background-color: var(--surface);
}

/* --- Navbar --- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(var(--bg-color), 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.scroll-link {
  color: var(--text-secondary);
  text-decoration: none;
}

.scroll-link:hover {
  color: var(--text-primary);
}

.nav-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-text {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.5px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Buttons */
button {
  cursor: pointer;
  font-family: var(--font-sans);
  border: none;
  border-radius: var(--radius);
  transition: var(--transition);
}

.theme-btn {
  background: transparent;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 50%;
}

.theme-btn:hover {
  background-color: var(--surface-hover);
}

.cta-btn {
  padding: 10px 20px;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cta-btn.primary {
  background-color: var(--primary-color);
  color: var(--primary-text);
}

.cta-btn.primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

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

.cta-btn.secondary:hover {
  background-color: var(--surface);
}

/* --- Hero Section --- */
.hero-section {
  padding: 100px 0 60px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

.hero-headline {
  font-size: clamp(2.5rem, 5vw, 4rem);
  letter-spacing: -1.5px;
  margin-bottom: 20px;
}

.hero-subheadline {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 30px;
  font-family: var(--font-mono);
}

.hero-image {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

/* --- Hero Workflow Visual --- */
.workflow-visual {
  position: relative;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

/* Floating File Payload */
.floating-file {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  animation: float 4s ease-in-out infinite;
  z-index: 10;
}

body.light-theme .floating-file {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

@keyframes float {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-8px);
  }

  100% {
    transform: translateY(0px);
  }
}

.file-icon-wrapper {
  background-color: var(--secondary-bg);
  color: var(--text-primary);
  padding: 10px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px var(--secondary-border);
}

.file-details {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.file-name {
  font-weight: 600;
  font-size: 0.9rem;
  font-family: var(--font-mono);
  color: var(--primary-color);
  transition: opacity 0.3s ease;
}

.file-tag {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Drag Path */
.drag-path {
  height: 60px;
  margin: -15px 0 -15px 0;
  opacity: 0.6;
}

.dashed-path {
  stroke-dashoffset: 40;
  animation: dash 1.5s linear infinite;
}

@keyframes dash {
  to {
    stroke-dashoffset: 0;
  }
}

/* Settings Window */
.settings-window {
  width: 100%;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  text-align: left;
  position: relative;
}

body.light-theme .settings-window {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
}

.window-header {
  background-color: var(--secondary-bg);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.window-dots {
  display: flex;
  gap: 8px;
  margin-right: 16px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.red {
  background-color: #ff5f56;
}

.dot.yellow {
  background-color: #ffbd2e;
}

.dot.green {
  background-color: #27c93f;
}

.window-title {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  margin: 0 auto;
  transform: translateX(-20px);
}

.window-body {
  display: flex;
  height: 220px;
}

.sidebar-menu {
  width: 120px;
  border-right: 1px solid var(--border);
  padding: 16px 0;
  background-color: rgba(128, 128, 128, 0.03);
}

.menu-item {
  padding: 8px 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.menu-item.active {
  background-color: rgba(128, 128, 128, 0.1);
  color: var(--text-primary);
  font-weight: 600;
  border-left: 2px solid var(--text-primary);
}

.main-panel {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.panel-header h3 {
  font-size: 0.95rem;
}

.upload-btn-mock {
  background: var(--text-primary);
  color: var(--bg-color);
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
}

.upload-zone {
  flex: 1;
  border: 2px dashed var(--secondary-border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--secondary-bg);
  position: relative;
  overflow: hidden;
}

.upload-zone::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--text-primary);
  opacity: 0;
  animation: drop-pulse 4s ease-in-out infinite;
}

@keyframes drop-pulse {

  0%,
  40% {
    opacity: 0;
    transform: scale(1);
  }

  45% {
    opacity: 0.05;
    transform: scale(0.98);
    border-radius: var(--radius);
  }

  55% {
    opacity: 0;
    transform: scale(1);
  }

  100% {
    opacity: 0;
  }
}

.zone-content {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Success Toast Notification */
.success-toast {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background-color: #27c93f;
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  box-shadow: 0 4px 12px rgba(39, 201, 63, 0.3);
  animation: toast-pop 4s ease-in-out infinite;
}

@keyframes toast-pop {

  0%,
  60% {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }

  65%,
  90% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }

  95%,
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
  }
}

.toast-icon {
  font-size: 1rem;
}

/* Scroll Indicator */
.scroll-indicator {
  margin-top: 20px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.scroll-indicator:hover {
  color: var(--text-primary);
}

/* --- FAQ Section --- */
.faq-section {
  margin-bottom: 60px;
}

.faq-item {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
}

.faq-item summary {
  padding: 18px 24px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  /* Hide default arrow */
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color var(--transition);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary:hover {
  background-color: var(--surface-hover);
}

.faq-item summary::after {
  content: '+';
  color: var(--primary-color);
  font-size: 1.2rem;
  font-weight: normal;
}

.faq-item[open] summary::after {
  content: '−';
}

.faq-answer {
  padding: 0 24px 24px;
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.95rem;
  border-top: 1px solid transparent;
}

.faq-item[open] .faq-answer {
  border-top-color: var(--border);
  padding-top: 16px;
}

/* --- Filter Section (YES/NO Split) --- */
.filter-split {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-top: 40px;
}

@media (min-width: 768px) {
  .filter-split {
    flex-direction: row;
    gap: 48px;
  }
}

.filter-col {
  flex: 1;
}

.col-heading {
  font-size: 1.8rem;
  margin-bottom: 24px;
}

.yes-col .col-heading {
  color: #27c93f;
}

.no-col .col-heading {
  color: #ff5f56;
}

.muted-heading {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.filter-list li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 24px;
}

.filter-list li::before {
  position: absolute;
  left: 0;
  top: 2px;
  font-weight: bold;
  font-size: 1.1rem;
}

.yes-list li::before {
  content: '✓';
  color: #27c93f;
}

.no-list li::before {
  content: '✗';
  color: #ff5f56;
}

.filter-list strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text-primary);
  font-size: 1.05rem;
}

.filter-list p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.sub-heading {
  margin: 40px 0 20px;
  text-align: center;
}

.persona-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.persona-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  background-color: var(--bg-color);
}

.persona-card .icon {
  font-size: 2rem;
  margin-bottom: 16px;
}

.persona-card h4 {
  margin-bottom: 10px;
}

.persona-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* --- Visuals Section --- */
.visuals-section h2 {
  text-align: center;
  margin-bottom: 40px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}

.step-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gif-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  background-color: var(--secondary-bg);
  border: 1px dashed var(--secondary-border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
}

.placeholder-text {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.code-snippet {
  background-color: #000;
  color: #0f0;
  font-family: var(--font-mono);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.8rem;
  display: inline-block;
  align-self: flex-start;
  margin-top: auto;
}

body.light-theme .code-snippet {
  background-color: #2d2d33;
}

/* --- Catalog Section --- */
.catalog-section {
  margin-bottom: 60px;
}

.catalog-header {
  text-align: center;
  margin-bottom: 30px;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.catalog-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  background-color: var(--surface);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.catalog-item:hover {
  border-color: var(--text-secondary);
  transform: translateY(-2px);
}

.cat-icon {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.catalog-item h4 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.role-count {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  display: block;
}

.catalog-item p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: auto;
}

.catalog-footer {
  text-align: center;
  margin-top: 30px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* --- Conversion Section (Form) --- */
.conversion-section {
  text-align: center;
}

.conversion-section h2 {
  margin-bottom: 8px;
}

.conversion-section>p {
  color: var(--text-secondary);
  margin-bottom: 30px;
}

.form-container {
  max-width: 600px;
  margin: 0 auto;
}

.zoho-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: left;
}

.form-input {
  width: 100%;
  padding: 14px;
  background-color: var(--bg-color);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.form-label {
  display: block;
  margin-bottom: 12px;
  font-weight: 600;
}

.form-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}

.hidden-checkbox {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.form-card {
  cursor: pointer;
}

.card-inner {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  transition: var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.card-inner:hover {
  border-color: var(--text-secondary);
  transform: translateY(-2px);
}

/* Checked State styles */
.hidden-checkbox:checked+.card-inner {
  border-color: var(--primary-color);
  background-color: rgba(var(--primary-color), 0.05);
  /* Tinted background */
  box-shadow: 0 0 0 1px var(--primary-color);
}

body.dark-theme .hidden-checkbox:checked+.card-inner {
  background-color: rgba(255, 255, 255, 0.08);
}

body.light-theme .hidden-checkbox:checked+.card-inner {
  background-color: rgba(0, 0, 0, 0.03);
}

.card-icon {
  font-size: 1.8rem;
}

.card-name {
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1.3;
}

.card-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: var(--bg-color);
  padding: 2px 8px;
  border-radius: 12px;
  margin-top: auto;
}

.submit-btn {
  width: 100%;
  padding: 16px;
  background-color: var(--primary-color);
  color: var(--primary-text);
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.submit-btn:hover {
  opacity: 0.9;
}

.disclaimer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.success-message {
  margin-top: 20px;
  padding: 16px;
  background-color: rgba(39, 201, 63, 0.1);
  border: 1px solid #27c93f;
  color: #27c93f;
  border-radius: var(--radius);
  text-align: center;
  font-weight: 600;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 20px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
}

/* Responsive constraints */
@media (max-width: 768px) {
  .boxed {
    padding: 24px;
  }

  .hero-headline {
    font-size: 2.2rem;
  }

  .nav-anchors {
    display: none !important;
    /* Hide anchors on mobile to keep header clean */
  }
}

/* --- RTL (Arabic) Support --- */
@font-face {
  font-family: 'BahijTheSansArabic';
  src: url('./fonts/Bahij_TheSansArabic-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

[dir="rtl"] {
  --font-sans: 'BahijTheSansArabic', system-ui, -apple-system, sans-serif;
  text-align: right;
}

[dir="rtl"] .nav-anchors {
  margin-right: 0 !important;
  margin-left: 20px !important;
}

[dir="rtl"] .window-dots {
  margin-right: 0;
  margin-left: 16px;
}

[dir="rtl"] .window-title {
  transform: translateX(20px);
}

[dir="rtl"] .menu-item.active {
  border-left: none;
  border-right: 2px solid var(--text-primary);
}

[dir="rtl"] .file-details {
  text-align: right;
}

[dir="rtl"] .settings-window {
  text-align: right;
}

[dir="rtl"] .zoho-form {
  text-align: right;
}

[dir="rtl"] .form-label {
  text-align: right;
}

[dir="rtl"] .filter-list li {
  padding-left: 0;
  padding-right: 28px;
}

[dir="rtl"] .filter-list li::before {
  left: auto;
  right: 0;
}

[dir="rtl"] .drag-path {
  transform: scaleX(-1);
}

[dir="rtl"] .sidebar-menu {
  border-right: none;
  border-left: 1px solid var(--border);
}

/* --- Modal Styles --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.91);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal-box {
  background-color: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  max-width: 800px;
  width: 40%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transform: translateY(0);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@media (max-width: 768px) {
  .modal-box {
    width: 90%;
    padding: 24px;
  }
}

.modal-overlay.hidden .modal-box {
  transform: translateY(20px);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: var(--text-primary);
}

[dir="rtl"] .modal-close {
  right: auto;
  left: 16px;
}