/* 
 * Opto Privacy Policy Website Styles
 * Following the Opto Brand Design System
 */

/* Import SF Pro font fallbacks */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* CSS Custom Properties for Theme Switching */
:root {
  /* Light Mode Colors */
  --bg-warm: #FEFCF7;
  --bg-card: #FFFFFF;
  --text-primary: #1A1D26;
  --text-secondary: #6B7280;
  --accent-blue: #007AFF;
  --accent-purple: #AF52DE;
  --border-color: #E5E7EB;
  --shadow-color: rgba(0, 0, 0, 0.05);
  
  /* Gradient */
  --gradient-opto: linear-gradient(135deg, #007AFF 0%, #AF52DE 100%);
  
  /* Dark mode will be handled by media query */
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-warm: #1A1D26;
    --bg-card: #2A2B36;
    --text-primary: #FEFCF7;
    --text-secondary: #9CA3AF;
    --border-color: #374151;
    --shadow-color: rgba(0, 0, 0, 0.3);
  }
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', system-ui, sans-serif;
  background-color: var(--bg-warm);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 16px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Container */
.container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px var(--shadow-color);
  transition: all 0.3s ease;
}

/* Logo Styling */
.logo-link {
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.logo-link:hover {
  opacity: 0.9;
}

.logo {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Rounded', 'Inter', system-ui, sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--gradient-opto);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  user-select: none;
}

.logo-o,
.logo-pto {
  display: inline-block;
}

/* Navigation */
.nav {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent-blue);
  background-color: var(--bg-warm);
}

/* Main Content */
.main {
  flex: 1;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.content-wrapper {
  background-color: var(--bg-card);
  border-radius: 16px;
  padding: 3rem;
  box-shadow: 0 4px 6px var(--shadow-color);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

/* Loading State */
.loading {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 1rem;
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--accent-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Privacy Policy Content Styles */
.privacy-content {
  display: block; /* Always visible now */
  animation: fadeIn 0.5s ease-in;
}

.privacy-content.loaded {
  display: block;
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Typography */
.privacy-content h1 {
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--gradient-opto);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.privacy-content h2 {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 2.5rem 0 1rem 0;
  line-height: 1.3;
}

.privacy-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 2rem 0 0.75rem 0;
}

.privacy-content p {
  margin-bottom: 1.25rem;
  color: var(--text-primary);
  line-height: 1.7;
}

.privacy-content strong {
  font-weight: 600;
  color: var(--text-primary);
}

.privacy-content em {
  font-style: italic;
  color: var(--text-secondary);
}

/* Links */
.privacy-content a {
  color: var(--accent-blue);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-bottom-color 0.2s ease;
}

.privacy-content a:hover {
  border-bottom-color: var(--accent-blue);
}

/* Lists */
.privacy-content ul,
.privacy-content ol {
  margin: 1rem 0 1.5rem 1.5rem;
  padding-left: 0;
}

.privacy-content li {
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  line-height: 1.6;
}

.privacy-content li::marker {
  color: var(--accent-blue);
}

/* Blockquotes */
.privacy-content blockquote {
  border-left: 4px solid var(--accent-blue);
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--text-secondary);
}

/* Code blocks */
.privacy-content code {
  background-color: var(--bg-warm);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
  font-size: 0.875rem;
  border: 1px solid var(--border-color);
}

.privacy-content pre {
  background-color: var(--bg-warm);
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border-color);
}

.privacy-content pre code {
  background: none;
  padding: 0;
  border: none;
}

/* Special styling for metadata */
.privacy-content p:first-of-type {
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 0.95rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
  margin-bottom: 2rem;
}

/* Footer */
.footer {
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 2rem;
  text-align: center;
  margin-top: auto;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-content p {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.footer-link {
  color: var(--accent-blue);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.footer-link:hover {
  opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header {
    padding: 1rem;
    flex-direction: column;
    gap: 1rem;
    position: relative;
  }
  
  .logo {
    font-size: 2rem;
  }
  
  .nav {
    gap: 1rem;
  }
  
  .main {
    padding: 1rem;
  }
  
  .content-wrapper {
    padding: 1.5rem;
    border-radius: 12px;
  }
  
  .privacy-content h1 {
    font-size: 2rem;
  }
  
  .privacy-content h2 {
    font-size: 1.5rem;
  }
  
  .privacy-content h3 {
    font-size: 1.125rem;
  }
  
  .footer {
    padding: 1.5rem 1rem;
  }
}

@media (max-width: 480px) {
  .logo {
    font-size: 1.75rem;
  }
  
  .content-wrapper {
    padding: 1rem;
  }
  
  .privacy-content h1 {
    font-size: 1.75rem;
  }
  
  .privacy-content h2 {
    font-size: 1.375rem;
  }
  
  .privacy-content ul,
  .privacy-content ol {
    margin-left: 1rem;
  }
}

/* Smooth transitions for theme changes */
* {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Print styles */
@media print {
  .header,
  .footer {
    display: none;
  }
  
  .main {
    padding: 0;
  }
  
  .content-wrapper {
    box-shadow: none;
    border: none;
    background: white;
  }
  
  .privacy-content h1,
  .logo {
    background: linear-gradient(135deg, #007AFF 0%, #AF52DE 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: #007AFF; /* Fallback for print */
  }
}