/* ==========================================================================
   Marketly - Privacy Policy Stylesheet
   Color Palette inspired by Marketly's Logo (Teal, Deep Slate, Mint & White)
   ========================================================================== */

:root {
  /* Brand Colors from Logo */
  --primary: #1B7A74;          /* Main Teal */
  --primary-dark: #135954;     /* Deep Teal */
  --primary-light: #2DA098;    /* Bright Sea Green */
  --primary-soft: #EBF5F4;     /* Soft Mint Background */
  --secondary: #1C3042;        /* Key Handle Dark Slate */
  
  /* Neutrals */
  --bg-page: #F8FBFA;          /* Calm, restful page background */
  --bg-surface: #FFFFFF;       /* Pure white card backgrounds */
  --text-main: #1F2937;        /* High-contrast readable body text */
  --text-muted: #5B6F77;       /* Soft secondary text */
  --border-light: #E2ECE9;     /* Subtle calm borders */
  --border-focus: #1B7A74;
  
  /* Highlights & Status */
  --success: #10B981;
  --accent-gold: #D97706;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(27, 122, 116, 0.05);
  --shadow-md: 0 4px 14px rgba(27, 122, 116, 0.08);
  --shadow-lg: 0 10px 25px rgba(27, 122, 116, 0.12);
  
  /* Spacing & Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --container-max: 1140px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.8;
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-sm);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: 0 4px 10px rgba(27, 122, 116, 0.15);
  border: 2px solid var(--primary-soft);
  transition: transform 0.25s ease;
}

.brand-logo:hover {
  transform: scale(1.04);
}

.brand-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--secondary);
  line-height: 1.2;
}

.brand-name span {
  color: var(--primary);
  font-weight: 700;
  font-size: 1.1rem;
  margin-right: 0.35rem;
}

.brand-tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-switch-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary-dark);
  background-color: var(--primary-soft);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  border: 1px solid rgba(27, 122, 116, 0.18);
  transition: all 0.2s ease;
}

.nav-switch-link:hover {
  background-color: var(--primary);
  color: #FFFFFF;
}

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--primary-dark);
  background-color: var(--primary-soft);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(27, 122, 116, 0.15);
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: var(--success);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary);
  background-color: transparent;
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-outline:hover {
  background-color: var(--primary);
  color: #FFFFFF;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  background: linear-gradient(135deg, #EAF4F3 0%, #F5F9F8 60%, #FFFFFF 100%);
  border-bottom: 1px solid var(--border-light);
  padding: 3.5rem 0 3rem;
  text-align: center;
  position: relative;
}

.hero-content {
  max-width: 780px;
}

.hero-badge {
  display: inline-block;
  padding: 0.35rem 1rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-dark);
  background-color: #FFFFFF;
  border-radius: 999px;
  margin-bottom: 1rem;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 1rem;
  line-height: 1.3;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.85;
}

.hero-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.meta-item svg {
  color: var(--primary);
}

/* ==========================================================================
   Main Layout: Sidebar + Content
   ========================================================================== */
.main-content {
  padding: 3rem 0 5rem;
}

.main-layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 2.5rem;
  align-items: start;
}

/* ==========================================================================
   Sticky Sidebar & Table of Contents
   ========================================================================== */
.sidebar {
  position: sticky;
  top: 6rem;
}

.sidebar-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.sidebar-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 1.15rem;
}

.sidebar-title svg {
  color: var(--primary);
}

/* Search Box */
.search-box {
  position: relative;
  margin-bottom: 1.25rem;
}

.search-box input {
  width: 100%;
  padding: 0.65rem 2.2rem 0.65rem 0.85rem;
  font-family: inherit;
  font-size: 0.86rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background-color: var(--bg-page);
  color: var(--text-main);
  outline: none;
  transition: all 0.2s ease;
}

.search-box input:focus {
  border-color: var(--primary);
  background-color: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(27, 122, 116, 0.1);
}

.search-icon {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* TOC Links */
.toc-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 480px;
  overflow-y: auto;
  padding-left: 0.3rem;
}

.toc-link {
  display: block;
  padding: 0.55rem 0.85rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  border-right: 3px solid transparent;
  transition: all 0.2s ease;
}

.toc-link:hover {
  color: var(--primary);
  background-color: var(--primary-soft);
}

.toc-link.active {
  color: var(--primary-dark);
  font-weight: 700;
  background-color: var(--primary-soft);
  border-right-color: var(--primary);
}

.sidebar-help {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--border-light);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.sidebar-help-btn {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.sidebar-help-btn:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* ==========================================================================
   Content Body & Policy Cards
   ========================================================================== */
.content-body {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.policy-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 2.2rem 2.2rem;
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 6.5rem;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.policy-card:hover {
  border-color: rgba(27, 122, 116, 0.3);
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.card-num {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--primary);
  background-color: var(--primary-soft);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  font-family: monospace;
}

.card-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--secondary);
}

.card-content p {
  color: var(--text-main);
  margin-bottom: 1.1rem;
  line-height: 1.85;
}

.card-content p:last-child {
  margin-bottom: 0;
}

/* Callout Box */
.callout-box {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background-color: var(--primary-soft);
  border-right: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-top: 1.25rem;
}

.callout-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.callout-box p {
  margin: 0;
  color: var(--primary-dark);
  font-weight: 500;
  font-size: 0.95rem;
}

/* Highlights */
.highlight-badge {
  background-color: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 1.25rem;
  display: inline-block;
  width: 100%;
}

/* Grid for Features / Info */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem;
  margin-top: 1.25rem;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background-color: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.feature-icon {
  font-size: 1.4rem;
  line-height: 1;
  background-color: #FFFFFF;
  padding: 0.4rem;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.feature-item h4 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 0.25rem;
}

.feature-item p {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* Styled Lists */
.styled-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.styled-list li {
  position: relative;
  padding-right: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--text-main);
  line-height: 1.8;
}

.styled-list li::before {
  content: "";
  position: absolute;
  right: 0;
  top: 0.65rem;
  width: 8px;
  height: 8px;
  background-color: var(--primary);
  border-radius: 50%;
}

.styled-list code {
  background-color: var(--primary-soft);
  color: var(--primary-dark);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.88rem;
  font-family: inherit;
  font-weight: 600;
}

/* Contact Box */
.contact-box {
  background-color: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
}

.contact-label {
  font-weight: 700;
  color: var(--secondary);
  min-width: 140px;
}

.contact-value {
  color: var(--primary-dark);
}

.contact-value[href] {
  text-decoration: none;
  font-weight: 700;
  color: var(--primary);
}

.contact-value[href]:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Back to top floating button
   ========================================================================== */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--primary);
  color: #FFFFFF;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.25s ease;
  z-index: 99;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background-color: var(--primary-dark);
  transform: translateY(-3px);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background-color: var(--secondary);
  color: #E2ECE9;
  padding: 2.5rem 0;
  margin-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.footer-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
}

.footer-brand h4 {
  font-size: 1.05rem;
  color: #FFFFFF;
  font-weight: 700;
}

.footer-brand p {
  font-size: 0.82rem;
  color: #94A3B8;
  margin: 0;
}

.footer-copy {
  font-size: 0.85rem;
  color: #94A3B8;
}

.footer-copy strong {
  color: #FFFFFF;
}

/* ==========================================================================
   Responsive & Print Media Queries
   ========================================================================== */
@media (max-width: 900px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    position: static;
  }
  
  .hero-title {
    font-size: 1.85rem;
  }
  
  .policy-card {
    padding: 1.6rem;
  }
}

@media (max-width: 600px) {
  .header-container {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  
  .hero-section {
    padding: 2.2rem 0;
  }
  
  .hero-title {
    font-size: 1.5rem;
  }
  
  .hero-meta {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-content {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
}

/* Print Stylesheet */
@media print {
  .site-header .header-actions,
  .sidebar,
  .back-to-top,
  .search-box {
    display: none !important;
  }
  
  body {
    background-color: #FFFFFF;
    color: #000000;
    font-size: 12pt;
  }
  
  .main-layout {
    display: block;
  }
  
  .policy-card {
    border: none;
    box-shadow: none;
    padding: 1rem 0;
    page-break-inside: avoid;
  }
  
  .hero-section {
    background: none;
    border: none;
    padding: 1rem 0;
  }
}
