/**
 * ColPath Legal Pages Theme Styles
 * Supports light mode (default) and dark mode
 */

/* ============================================
   ROOT VARIABLES - Light Theme (Default)
   ============================================ */
:root {
  /* Background colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-accent: #e8f4f8;
  --bg-warning: #fff3cd;
  --bg-success: #d4edda;
  --bg-info: #ecf0f1;

  /* Text colors */
  --text-primary: #333333;
  --text-secondary: #555555;
  --text-tertiary: #7f8c8d;
  --text-heading: #2c3e50;
  --text-subheading: #34495e;

  /* Accent colors */
  --accent-primary: #3498db;
  --accent-success: #28a745;
  --accent-warning: #ffc107;
  --accent-info: #17a2b8;

  /* Border colors */
  --border-light: #dee2e6;
  --border-medium: #ddd;
  --border-accent: #3498db;

  /* Link colors */
  --link-color: #3498db;
  --link-hover: #2980b9;

  /* Shadow */
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);

  /* Transition */
  --transition: all 0.3s ease;
}

/* ============================================
   DARK THEME VARIABLES
   ============================================ */
[data-theme="dark"] {
  /* Background colors */
  --bg-primary: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --bg-accent: #1e3a4a;
  --bg-warning: #4a3f1e;
  --bg-success: #1e4a2d;
  --bg-info: #2a2a2a;

  /* Text colors */
  --text-primary: #e0e0e0;
  --text-secondary: #b0b0b0;
  --text-tertiary: #888888;
  --text-heading: #f0f0f0;
  --text-subheading: #d0d0d0;

  /* Accent colors (slightly brighter for dark mode) */
  --accent-primary: #5dade2;
  --accent-success: #52c77d;
  --accent-warning: #ffd966;
  --accent-info: #48c9e0;

  /* Border colors */
  --border-light: #404040;
  --border-medium: #4a4a4a;
  --border-accent: #5dade2;

  /* Link colors */
  --link-color: #5dade2;
  --link-hover: #85c1e9;

  /* Shadow (lighter for dark mode) */
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
}

/* ============================================
   BASE STYLES
   ============================================ */
body {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 20px 80px 20px; /* Extra bottom padding for theme toggle */
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  transition: var(--transition);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1 {
  color: var(--text-heading);
  border-bottom: 3px solid var(--accent-primary);
  padding-bottom: 10px;
  transition: var(--transition);
}

h2 {
  color: var(--text-subheading);
  margin-top: 30px;
  transition: var(--transition);
}

h3 {
  color: var(--text-secondary);
  margin-top: 20px;
  transition: var(--transition);
}

p, li {
  color: var(--text-primary);
  transition: var(--transition);
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

ul, ol {
  line-height: 1.8;
}

code {
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  color: var(--text-primary);
  transition: var(--transition);
}

/* ============================================
   INFO BOXES
   ============================================ */
.last-updated,
.intro-box,
.mission-box {
  background: var(--bg-info);
  padding: 10px 15px;
  border-radius: 5px;
  margin-bottom: 20px;
  border-left: 4px solid var(--accent-info);
  transition: var(--transition);
}

.intro-box,
.mission-box {
  padding: 20px;
}

.contact-box {
  background: var(--bg-accent);
  padding: 15px;
  border-left: 4px solid var(--accent-primary);
  margin: 20px 0;
  transition: var(--transition);
}

.contact-box h2,
.contact-box h3 {
  color: var(--text-heading);
  margin-top: 10px;
}

.tip-box,
.important-notice {
  background: var(--bg-warning);
  padding: 15px;
  border-left: 4px solid var(--accent-warning);
  margin: 20px 0;
  transition: var(--transition);
}

.agreement-box,
.team-box {
  background: var(--bg-success);
  padding: 15px;
  border-left: 4px solid var(--accent-success);
  margin: 20px 0;
  transition: var(--transition);
}

.value-item {
  background: var(--bg-secondary);
  padding: 15px;
  margin: 15px 0;
  border-left: 4px solid var(--accent-success);
  box-shadow: var(--shadow-sm);
  border-radius: 4px;
  transition: var(--transition);
}

/* ============================================
   FAQ ITEMS
   ============================================ */
.faq-item {
  background: var(--bg-secondary);
  padding: 15px;
  margin: 15px 0;
  border-radius: 5px;
  border-left: 3px solid var(--accent-primary);
  transition: var(--transition);
}

.faq-question {
  font-weight: bold;
  color: var(--text-heading);
  margin-bottom: 10px;
}

.faq-answer {
  color: var(--text-secondary);
}

/* ============================================
   FEATURE CARDS & GRIDS
   ============================================ */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.feature-card {
  background: var(--bg-secondary);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  text-align: center;
  transition: var(--transition);
}

.feature-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.feature-card h3 {
  color: var(--accent-primary);
  margin-top: 10px;
}

.feature-icon {
  font-size: 48px;
  margin-bottom: 10px;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-box {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 30px;
  border-radius: 10px;
  margin: 20px 0;
  text-align: center;
}

.hero-box h2 {
  color: white;
  margin-top: 0;
}

/* Dark mode: slightly different gradient */
[data-theme="dark"] .hero-box {
  background: linear-gradient(135deg, #4a5bb8 0%, #5a3670 100%);
}

/* ============================================
   STATISTICS & BADGES
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.stat-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
}

[data-theme="dark"] .stat-card {
  background: linear-gradient(135deg, #4a5bb8 0%, #5a3670 100%);
}

.stat-number {
  font-size: 36px;
  font-weight: bold;
  margin: 10px 0;
}

.stat-label {
  font-size: 14px;
  opacity: 0.9;
}

.tech-badge {
  display: inline-block;
  background: var(--accent-primary);
  color: white;
  padding: 5px 12px;
  border-radius: 15px;
  margin: 5px;
  font-size: 14px;
  transition: var(--transition);
}

.tech-badge:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-sm);
}

/* ============================================
   TIMELINE
   ============================================ */
.timeline {
  position: relative;
  padding-left: 30px;
  border-left: 3px solid var(--accent-primary);
  margin: 20px 0;
}

.timeline-item {
  margin-bottom: 20px;
  padding-left: 20px;
  position: relative;
}

.timeline-item:before {
  content: '';
  position: absolute;
  left: -38px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--accent-primary);
  border: 3px solid var(--bg-primary);
  transition: var(--transition);
}

/* ============================================
   TABLES
   ============================================ */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  background: var(--bg-primary);
  transition: var(--transition);
}

thead tr {
  background: var(--accent-primary);
  color: white;
}

th, td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

tbody tr {
  background: var(--bg-secondary);
  transition: var(--transition);
}

tbody tr:nth-child(even) {
  background: var(--bg-primary);
}

tbody tr:hover {
  background: var(--bg-accent);
}

/* ============================================
   HORIZONTAL RULE
   ============================================ */
hr {
  margin: 40px 0;
  border: none;
  border-top: 1px solid var(--border-medium);
  transition: var(--transition);
}

/* ============================================
   FOOTER
   ============================================ */
footer,
p[style*="text-align: center"] {
  color: var(--text-tertiary);
  transition: var(--transition);
}

/* ============================================
   THEME TOGGLE BUTTON
   ============================================ */
.theme-toggle-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  z-index: 1000;
}

.theme-toggle-btn:hover {
  transform: scale(1.1) rotate(180deg);
  box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

.theme-toggle-btn:active {
  transform: scale(0.95);
}

.theme-icon {
  display: block;
  user-select: none;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .theme-toggle-btn {
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    font-size: 20px;
  }

  body {
    padding-bottom: 100px;
  }
}

/* ============================================
   SMOOTH TRANSITIONS
   ============================================ */
* {
  transition-property: background-color, color, border-color, box-shadow;
  transition-duration: 0.3s;
  transition-timing-function: ease;
}

/* Disable transitions during theme change for instant switch */
.theme-transitioning * {
  transition: none !important;
}
