/* CSS variables for theme consistency - matching main website */
:root {
  --background: 240 5% 5%; /* Dark theme default */
  --foreground: 0 0% 98%;
  --card: 240 5% 8%;
  --card-foreground: 0 0% 98%;
  --popover: 240 5% 5%;
  --popover-foreground: 0 0% 98%;
  --primary: 202 100% 49%; /* DigiScalability blue */
  --primary-foreground: 0 0% 98%;
  --secondary: 240 5% 10%;
  --secondary-foreground: 0 0% 98%;
  --muted: 240 5% 10%;
  --muted-foreground: 0 0% 60%;
  --accent: 75 75% 55%; /* DigiScalability green accent */
  --accent-foreground: 75 75% 5%;
  --destructive: 0 62.8% 30.6%;
  --destructive-foreground: 0 0% 98%;
  --border: 240 5% 12%;
  --input: 240 5% 12%;
  --ring: 202 100% 59%;
  --radius: 0.5rem;
}

/* Light theme */
.light {
  --background: 0 0% 100%;
  --foreground: 240 5% 5%;
  --card: 0 0% 98%;
  --card-foreground: 240 5% 5%;
  --popover: 0 0% 100%;
  --popover-foreground: 240 5% 5%;
  --primary: 202 100% 49%;
  --primary-foreground: 0 0% 98%;
  --secondary: 240 5% 95%;
  --secondary-foreground: 240 5% 5%;
  --muted: 240 5% 90%;
  --muted-foreground: 240 5% 40%;
  --accent: 75 75% 55%;
  --accent-foreground: 75 75% 5%;
  --destructive: 0 62.8% 30.6%;
  --destructive-foreground: 0 0% 98%;
  --border: 240 5% 90%;
  --input: 240 5% 90%;
  --ring: 202 100% 59%;
}

/* Dark theme */
.dark {
  --background: 240 5% 5%;
  --foreground: 0 0% 98%;
  --card: 240 5% 8%;
  --card-foreground: 0 0% 98%;
  --popover: 240 5% 5%;
  --popover-foreground: 0 0% 98%;
  --primary: 202 100% 49%;
  --primary-foreground: 0 0% 98%;
  --secondary: 240 5% 10%;
  --secondary-foreground: 0 0% 98%;
  --muted: 240 5% 10%;
  --muted-foreground: 0 0% 60%;
  --accent: 75 75% 55%;
  --accent-foreground: 75 75% 5%;
  --destructive: 0 62.8% 30.6%;
  --destructive-foreground: 0 0% 98%;
  --border: 240 5% 12%;
  --input: 240 5% 12%;
  --ring: 202 100% 59%;
}

/* Neon theme */
.neon {
  --background: 240 5% 8%;
  --foreground: 120 100% 97%;
  --card: 240 5% 12%;
  --card-foreground: 120 100% 97%;
  --popover: 240 5% 8%;
  --popover-foreground: 120 100% 97%;
  --primary: 120 100% 50%; /* neon green */
  --primary-foreground: 240 5% 8%;
  --secondary: 200 100% 60%; /* electric blue */
  --secondary-foreground: 120 100% 97%;
  --muted: 240 5% 20%;
  --muted-foreground: 120 100% 80%;
  --accent: 200 100% 60%; /* electric blue */
  --accent-foreground: 120 100% 97%;
  --destructive: 0 100% 50%;
  --destructive-foreground: 120 100% 97%;
  --border: 120 100% 50%;
  --input: 120 100% 50%;
  --ring: 120 100% 50%;
}

html, body {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1.6;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

/* Header styling for consistency */
.legal-header {
  background: hsl(var(--card));
  border-bottom: 1px solid hsl(var(--border));
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
}

.legal-header .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.legal-header .logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: hsl(var(--primary));
  text-decoration: none;
  transition: color 0.2s;
}

.legal-header .logo:hover {
  color: hsl(var(--primary) / 0.8);
}

.legal-header .back-link {
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border: 1px solid hsl(var(--border));
  border-radius: 0.375rem;
  transition: all 0.2s;
}

.legal-header .back-link:hover {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
  border-color: hsl(var(--border) / 0.8);
}

main.privacy-policy {
  max-width: 800px;
  margin: 2rem auto;
  padding: 3rem 2rem;
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border-radius: calc(var(--radius) * 2);
  box-shadow:
    0 10px 15px -3px hsl(var(--foreground) / 0.03),
    0 4px 6px -4px hsl(var(--foreground) / 0.03),
    0 0 0 1px hsl(var(--border));
  border: 1px solid hsl(var(--border));
  position: relative;
  overflow: hidden;
}

/* Subtle gradient overlay for visual interest */
main.privacy-policy::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, hsl(var(--primary)), hsl(var(--accent)));
  opacity: 0.8;
}

main.privacy-policy h1 {
  color: hsl(var(--primary));
  font-family: 'Space Grotesk', 'Poppins', 'Inter', -apple-system, sans-serif;
  font-weight: 700;
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

main.privacy-policy h2 {
  color: hsl(var(--primary));
  font-family: 'Space Grotesk', 'Poppins', 'Inter', -apple-system, sans-serif;
  font-weight: 600;
  font-size: 1.375rem;
  margin-top: 3rem;
  margin-bottom: 1rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  position: relative;
}

main.privacy-policy h3 {
  color: hsl(var(--foreground));
  font-family: 'Space Grotesk', 'Inter', -apple-system, sans-serif;
  font-weight: 600;
  font-size: 1.125rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

main.privacy-policy p, main.privacy-policy ul, main.privacy-policy li {
  font-size: 1rem;
  line-height: 1.75;
  color: hsl(var(--card-foreground));
  margin-bottom: 1rem;
}

main.privacy-policy ul {
  margin: 1.25rem 0 1.25rem 1.5rem;
  padding-left: 0.5rem;
}

main.privacy-policy li {
  margin-bottom: 0.75rem;
  position: relative;
}

main.privacy-policy li::marker {
  color: hsl(var(--primary));
}

main.privacy-policy a {
  color: hsl(var(--primary));
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: hsl(var(--primary) / 0.5);
  transition: all 0.2s;
}

main.privacy-policy a:hover {
  color: hsl(var(--primary) / 0.8);
  text-decoration-color: hsl(var(--primary) / 0.8);
}

main.privacy-policy strong {
  font-weight: 600;
  color: hsl(var(--foreground));
}

main.privacy-policy hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, hsl(var(--border)), transparent);
  margin: 2rem 0;
}

/* Enhanced table styling */
main.privacy-policy table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.875rem;
  background: hsl(var(--muted) / 0.3);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid hsl(var(--border));
}

main.privacy-policy table th,
main.privacy-policy table td {
  padding: 0.875rem;
  text-align: left;
  border-bottom: 1px solid hsl(var(--border) / 0.5);
}

main.privacy-policy table th {
  background: hsl(var(--muted) / 0.8);
  font-weight: 600;
  color: hsl(var(--foreground));
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

main.privacy-policy table tr:last-child td {
  border-bottom: none;
}

main.privacy-policy table tr:hover {
  background: hsl(var(--muted) / 0.5);
}

/* Button styling for consistency */
main.privacy-policy button {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

main.privacy-policy button:hover {
  background: hsl(var(--primary) / 0.9);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px hsl(var(--primary) / 0.2);
}

main.privacy-policy button:active {
  transform: translateY(0);
}

/* Special styling for highlighted sections */
.cookie-preferences {
  background: hsl(var(--muted) / 0.4);
  padding: 2rem;
  border-radius: var(--radius);
  margin: 2rem 0;
  text-align: center;
  border: 1px solid hsl(var(--border));
  position: relative;
}

.cookie-preferences::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, hsl(var(--primary)), hsl(var(--accent)));
  opacity: 0.6;
  border-radius: var(--radius) var(--radius) 0 0;
}

/* Footer styling for consistency */
.legal-footer {
  background: hsl(var(--card));
  border-top: 1px solid hsl(var(--border));
  padding: 2rem 0;
  margin-top: 4rem;
  text-align: center;
}

.legal-footer .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.legal-footer p {
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  margin: 0;
}

.legal-footer a {
  color: hsl(var(--primary));
  text-decoration: none;
  transition: color 0.2s;
}

.legal-footer a:hover {
  color: hsl(var(--primary) / 0.8);
}

/* Responsive design */
@media (max-width: 768px) {
  main.privacy-policy {
    margin: 1rem;
    padding: 2rem 1.5rem;
  }

  main.privacy-policy h1 {
    font-size: 2rem;
  }

  main.privacy-policy h2 {
    font-size: 1.25rem;
  }

  main.privacy-policy h3 {
    font-size: 1.0625rem;
  }

  main.privacy-policy table {
    font-size: 0.8125rem;
  }

  main.privacy-policy table th,
  main.privacy-policy table td {
    padding: 0.625rem 0.5rem;
  }

  .legal-header .container {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

@media (max-width: 600px) {
  main.privacy-policy {
    margin: 0.5rem;
    padding: 1.5rem 1rem;
  }

  main.privacy-policy h1 {
    font-size: 1.75rem;
  }

  main.privacy-policy h2 {
    font-size: 1.125rem;
  }

  .cookie-preferences {
    padding: 1.5rem 1rem;
  }
}
