/* ==========================================================================
   Mercanix / Hira App - Privacy Policy & Legal Portal Stylesheet
   Modern, Clean, Responsive, and Google Play Store Compliant
   ========================================================================== */

:root {
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: #e0f2fe;
  --accent: #10b981;
  --accent-light: #d1fae5;
  --accent-dark: #047857;
  
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-alt: #f1f5f9;
  --bg-nav: rgba(255, 255, 255, 0.92);
  --border-color: #e2e8f0;
  --border-focus: #38bdf8;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #94a3b8;
  
  --badge-bg: #ecfdf5;
  --badge-text: #065f46;
  --badge-border: #a7f3d0;
  
  --alert-info-bg: #eff6ff;
  --alert-info-border: #bfdbfe;
  --alert-info-text: #1e40af;
  
  --alert-warn-bg: #fffbeb;
  --alert-warn-border: #fde68a;
  --alert-warn-text: #92400e;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

[data-theme="dark"] {
  --bg-page: #0b0f19;
  --bg-card: #131b2e;
  --bg-card-alt: #1e293b;
  --bg-nav: rgba(19, 27, 46, 0.92);
  --border-color: #27354f;
  --border-focus: #38bdf8;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  
  --badge-bg: rgba(16, 185, 129, 0.15);
  --badge-text: #34d399;
  --badge-border: rgba(16, 185, 129, 0.3);
  
  --alert-info-bg: rgba(30, 58, 138, 0.25);
  --alert-info-border: rgba(59, 130, 246, 0.35);
  --alert-info-text: #93c5fd;
  
  --alert-warn-bg: rgba(146, 64, 14, 0.25);
  --alert-warn-border: rgba(245, 158, 11, 0.35);
  --alert-warn-text: #fde68a;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

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

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  transition: background-color 0.25s ease, color 0.25s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Reading Progress Bar */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  width: 0%;
  z-index: 999;
  transition: width 0.1s ease-out;
}

/* Header & Navigation */
header.site-header {
  position: sticky;
  top: 0;
  background: var(--bg-nav);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
  padding: 0.85rem 1.5rem;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0284c7, #10b981);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 1.15rem;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

.brand-info h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.2;
}

.brand-info span {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  list-style: none;
}

.nav-link {
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-full);
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: var(--primary);
  background: var(--bg-card-alt);
}

.nav-link.active {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 600;
}

[data-theme="dark"] .nav-link.active {
  background: rgba(2, 132, 199, 0.2);
  color: #38bdf8;
}

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

.btn-icon {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.45rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 1rem;
  width: 36px;
  height: 36px;
}

.btn-icon:hover {
  color: var(--text-main);
  border-color: var(--border-focus);
}

/* Hero Section */
.hero-banner {
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-page) 100%);
  border-bottom: 1px solid var(--border-color);
  padding: 3rem 1.5rem 2.5rem;
}

.hero-container {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}

.compliance-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  color: var(--badge-text);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.compliance-badge svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.hero-title {
  font-size: 2.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto 1.5rem;
}

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

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

.meta-item strong {
  color: var(--text-main);
}

/* Quick Search Bar */
.search-wrapper {
  max-width: 540px;
  margin: 1.5rem auto 0;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.92rem;
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

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

/* Main Container & Layout */
.main-wrapper {
  max-width: 1200px;
  margin: 2.5rem auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2.5rem;
  align-items: start;
}

/* Sticky Sidebar Table of Contents */
aside.toc-sidebar {
  position: sticky;
  top: 5.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  max-height: calc(100vh - 7rem);
  overflow-y: auto;
}

.toc-header {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.toc-link {
  display: block;
  padding: 0.45rem 0.65rem;
  font-size: 0.87rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  line-height: 1.35;
}

.toc-link:hover {
  color: var(--primary);
  background: var(--bg-card-alt);
}

.toc-link.active {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 600;
  border-left: 3px solid var(--primary);
}

[data-theme="dark"] .toc-link.active {
  background: rgba(2, 132, 199, 0.15);
}

/* Content Area */
article.policy-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem 3rem;
  box-shadow: var(--shadow-sm);
}

/* Content Sections */
.policy-section {
  padding-bottom: 2.5rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border-color);
}

.policy-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.section-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  margin-bottom: 0.4rem;
}

.policy-section h2 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.policy-section h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 1.5rem 0 0.6rem;
}

.policy-section p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 0.98rem;
}

.policy-section ul, .policy-section ol {
  margin: 0 0 1.25rem 1.35rem;
  color: var(--text-muted);
}

.policy-section li {
  margin-bottom: 0.5rem;
  font-size: 0.96rem;
}

.policy-section strong {
  color: var(--text-main);
}

/* Callout Alert Boxes */
.alert-box {
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  display: flex;
  gap: 0.85rem;
  font-size: 0.92rem;
  line-height: 1.5;
}

.alert-box.info {
  background: var(--alert-info-bg);
  border: 1px solid var(--alert-info-border);
  color: var(--alert-info-text);
}

.alert-box.warning {
  background: var(--alert-warn-bg);
  border: 1px solid var(--alert-warn-border);
  color: var(--alert-warn-text);
}

.alert-box svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 0.15rem;
  fill: currentColor;
}

/* Tables for Data Disclosure */
.data-table-container {
  overflow-x: auto;
  margin: 1.25rem 0 1.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

table.data-table th {
  background: var(--bg-card-alt);
  color: var(--text-main);
  font-weight: 600;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

table.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
  vertical-align: top;
}

table.data-table tr:last-child td {
  border-bottom: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-accent {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}

.btn-accent:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  background: var(--bg-card-alt);
  border-color: var(--border-focus);
}

/* Card Grids */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}

.feature-card {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem;
}

.feature-card h4 {
  font-size: 1rem;
  color: var(--text-main);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.feature-card p {
  font-size: 0.87rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* Interactive Deletion Form */
.deletion-form-card {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin: 1.5rem 0;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 0.75rem 0.95rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.form-hint {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: 0.35rem;
}

/* Footer */
footer.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 3rem 1.5rem 2rem;
  margin-top: 4rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.88rem;
  max-width: 380px;
  margin-top: 0.5rem;
}

.footer-links {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.footer-col h5 {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.footer-col a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  transition: color 0.15s ease;
}

.footer-col a:hover {
  color: var(--primary);
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Responsive Media Queries */
@media (max-width: 960px) {
  .main-wrapper {
    grid-template-columns: 1fr;
  }
  
  aside.toc-sidebar {
    display: none;
  }
  
  article.policy-content {
    padding: 1.75rem 1.5rem;
  }
  
  .hero-title {
    font-size: 1.85rem;
  }
}

@media (max-width: 640px) {
  .header-container {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .nav-menu {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.25rem;
  }
  
  .footer-top {
    flex-direction: column;
  }
}

/* Print Stylesheet (Optimized for Play Store review PDF generation) */
@media print {
  header.site-header,
  #progress-bar,
  .search-wrapper,
  aside.toc-sidebar,
  .btn,
  .theme-toggle,
  footer.site-footer {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
    font-size: 11pt;
  }
  
  .main-wrapper {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
  }
  
  article.policy-content {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
  
  .hero-banner {
    border: none !important;
    background: transparent !important;
    padding: 1rem 0 !important;
  }
}
