/* ==========================================================================
   TagMetre / KarMetre - Ultra-Premium Modern Privacy Policy Stylesheet
   Design Inspiration: Linear, Stripe, Apple & Vercel Design Systems
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Dark Palette (Default) */
  --bg-main: #06080e;
  --bg-subtle: #0b0f19;
  --bg-card: rgba(15, 23, 42, 0.65);
  --bg-card-hover: rgba(30, 41, 59, 0.7);
  --bg-elevated: #111827;
  
  --border-dim: rgba(255, 255, 255, 0.07);
  --border-bright: rgba(255, 255, 255, 0.15);
  --border-glow: rgba(99, 102, 241, 0.35);
  
  --text-heading: #f8fafc;
  --text-body: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  /* Brand Accent Colors */
  --primary-500: #6366f1;
  --primary-600: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.22);
  --accent-cyan: #06b6d4;
  --accent-cyan-glow: rgba(6, 182, 212, 0.2);
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.15);
  --accent-amber: #f59e0b;
  --accent-amber-glow: rgba(245, 158, 11, 0.15);
  --accent-rose: #f43f5e;
  
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);
  
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 9999px;
  
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-main: #f8fafc;
  --bg-subtle: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(241, 245, 249, 0.9);
  --bg-elevated: #ffffff;
  
  --border-dim: rgba(0, 0, 0, 0.08);
  --border-bright: rgba(0, 0, 0, 0.16);
  --border-glow: rgba(79, 70, 229, 0.3);
  
  --text-heading: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  
  --primary-500: #4f46e5;
  --primary-600: #4338ca;
  --primary-glow: rgba(79, 70, 229, 0.12);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.12);
}

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

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* Ambient Background Radial Glows */
body::before {
  content: '';
  position: fixed;
  top: -200px;
  left: 15%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, rgba(6, 182, 212, 0.04) 45%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: -200px;
  right: 10%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.09) 0%, transparent 65%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: var(--border-bright);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-500);
}

/* Glassmorphism Utility */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
}

.glass-panel:hover {
  border-color: var(--border-bright);
}

/* Navigation Bar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 8, 14, 0.75);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border-dim);
  padding: 1rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

[data-theme="light"] .navbar {
  background: rgba(248, 250, 252, 0.85);
}

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

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary-500), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 800;
  font-size: 1.4rem;
  box-shadow: 0 0 20px var(--primary-glow);
  position: relative;
  overflow: hidden;
}

.brand-logo::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  100% { left: 100%; }
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-name {
  color: var(--text-heading);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.brand-tag {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-emerald-glow);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-pill);
  font-size: 0.825rem;
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

.btn-action {
  background: var(--bg-subtle);
  border: 1px solid var(--border-dim);
  color: var(--text-heading);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-action:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  transform: translateY(-1px);
  color: var(--primary-500);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  color: #ffffff !important;
  border: none;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
  transform: translateY(-2px);
}

/* Page Layout */
.main-wrapper {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 2.5rem;
  position: relative;
  z-index: 1;
  flex: 1;
}

@media (max-width: 992px) {
  .main-wrapper {
    grid-template-columns: 1fr;
    padding: 1.5rem 1rem;
  }
}

/* Sidebar Styling */
.sidebar-sticky {
  position: sticky;
  top: 100px;
  height: fit-content;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sidebar-card {
  padding: 1.25rem;
}

.search-field {
  position: relative;
  margin-bottom: 0.5rem;
}

.search-field input {
  width: 100%;
  padding: 0.7rem 0.8rem 0.7rem 2.4rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  color: var(--text-heading);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  transition: all var(--transition-fast);
}

.search-field input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 12px var(--primary-glow);
}

.search-field svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 16px;
  height: 16px;
}

.nav-group-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin: 1rem 0 0.5rem 0.5rem;
}

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

.toc-item a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition: all var(--transition-fast);
}

.toc-item a:hover {
  background: var(--bg-subtle);
  color: var(--text-heading);
}

.toc-item a.active {
  background: var(--primary-glow);
  color: var(--primary-500);
  border-left-color: var(--primary-500);
  font-weight: 700;
}

.toc-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  opacity: 0.7;
}

/* Content Area */
.content-area {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Hero Section */
.hero-header {
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.8) 0%, rgba(15, 23, 42, 0.4) 100%);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

[data-theme="light"] .hero-header {
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
}

.hero-header::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  pointer-events: none;
}

.hero-title-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary-glow);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--primary-500);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 0.825rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text-heading);
  margin-bottom: 1rem;
}

.hero-title span {
  background: linear-gradient(135deg, #a5b4fc 0%, var(--primary-500) 50%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 750px;
  line-height: 1.7;
  margin-bottom: 2rem;
}

/* Feature Stat Grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-dim);
}

.stat-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-dim);
  padding: 1rem;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 500;
}

/* Section Cards */
.policy-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 2.25rem;
  box-shadow: var(--shadow-md);
  scroll-margin-top: 110px;
  transition: border-color var(--transition-normal);
}

.policy-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
}

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

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--primary-glow);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--primary-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.card-title-group h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-heading);
}

.card-title-group p {
  font-size: 0.875rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}

.card-body p {
  color: var(--text-body);
  margin-bottom: 1rem;
  font-size: 0.975rem;
  line-height: 1.7;
}

.card-body ul, .card-body ol {
  margin-left: 1.5rem;
  margin-bottom: 1.25rem;
  color: var(--text-body);
}

.card-body li {
  margin-bottom: 0.6rem;
  font-size: 0.95rem;
}

.card-body li strong {
  color: var(--text-heading);
}

/* Custom Highlight Boxes */
.callout-box {
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin: 1.5rem 0;
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  position: relative;
  overflow: hidden;
}

.callout-info {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.callout-warning {
  background: var(--accent-amber-glow);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.callout-success {
  background: var(--accent-emerald-glow);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.callout-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
}

.callout-content h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 0.4rem;
}

.callout-content p {
  margin-bottom: 0 !important;
  font-size: 0.925rem !important;
  color: var(--text-body);
}

/* Permissions Grid */
.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.perm-item {
  background: var(--bg-subtle);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all var(--transition-fast);
}

.perm-item:hover {
  border-color: var(--border-bright);
  transform: translateY(-2px);
}

.perm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.perm-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-heading);
}

.perm-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: var(--primary-glow);
  color: var(--primary-500);
  border: 1px solid rgba(99, 102, 241, 0.2);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-xs);
}

.perm-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Data Table Styling */
.table-container {
  overflow-x: auto;
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  background: var(--bg-subtle);
}

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

.custom-table th {
  background: rgba(17, 24, 39, 0.9);
  color: var(--text-heading);
  font-weight: 700;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-dim);
}

[data-theme="light"] .custom-table th {
  background: #e2e8f0;
}

.custom-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-dim);
  color: var(--text-body);
}

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

.custom-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Contact & Action Card */
.action-box {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(6, 182, 212, 0.05) 100%);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

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

/* Footer */
.footer-bar {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-dim);
  padding: 3rem 2rem;
  margin-top: 5rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

.footer-content {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

.footer-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

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

.footer-copy {
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* Print Mode */
@media print {
  body::before, body::after, .navbar, .sidebar-sticky, .btn-action, .search-field {
    display: none !important;
  }
  .main-wrapper {
    grid-template-columns: 1fr;
    max-width: 100%;
    padding: 0;
  }
  .policy-card, .hero-header {
    background: #ffffff !important;
    color: #000000 !important;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }
  .card-title-group h2, .hero-title {
    color: #000000 !important;
  }
  .card-body p, .card-body li {
    color: #333333 !important;
  }
}
