/* style reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* main color var */
:root {
  --bg-primary: #ff9a9e;
  --bg-secondary: #fecfef;
  --text-primary: #333;
  --text-secondary: #34495e;
  --text-tertiary: #495057;
  --accent-primary: #ff6b9d;
  --accent-secondary: #c44569;
  --accent-tertiary: #c44569;
  --accent-quaternary: #ff6b9d;
  --accent-quinary: #9b59b6;
  --content-bg: rgba(255, 255, 255, 0.95);
  --card-bg-start: rgba(255, 255, 255, 0.8);
  --card-bg-end: rgba(248, 249, 250, 0.8);
  --card-border: rgba(196, 69, 105, 0.1);
  --toggle-bg: rgba(255, 255, 255, 0.2);
  --toggle-border: rgba(255, 255, 255, 0.3);
  --toggle-hover: rgba(255, 255, 255, 0.3);
  --shadow-light: rgba(0, 0, 0, 0.1);
  --shadow-medium: rgba(0, 0, 0, 0.05);
  --strong-bg: linear-gradient(135deg, rgba(255, 107, 157, 0.1) 0%, rgba(196, 69, 105, 0.1) 50%, rgba(155, 89, 182, 0.1) 100%);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-secondary) 100%);
  min-height: 100vh;
  padding: 20px;
  transition: all 0.3s ease;
}

/* theme toggle */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: var(--toggle-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  border: 2px solid var(--toggle-border);
  transition: all 0.3s ease;
  z-index: 1000;
}

.theme-toggle:hover {
  background: var(--toggle-hover);
  transform: scale(1.1);
}

.theme-icon {
  font-size: 1.5rem;
  transition: transform 0.3s ease;
  user-select: none;
}

.theme-toggle:hover .theme-icon {
  transform: rotate(20deg);
}

/* dark theme var */
body.dark-theme {
  --bg-primary: #2c3e50;
  --bg-secondary: #34495e;
  --text-primary: #e0e0e0;
  --text-secondary: #ddd;
  --text-tertiary: #bbb;
  --accent-primary: #74b9ff;
  --accent-secondary: #a29bfe;
  --accent-tertiary: #74b9ff;
  --accent-quaternary: #74b9ff;
  --accent-quinary: #a29bfe;
  --content-bg: rgba(40, 44, 52, 0.95);
  --card-bg-start: rgba(60, 70, 80, 0.8);
  --card-bg-end: rgba(45, 55, 65, 0.8);
  --card-border: rgba(116, 185, 255, 0.1);
  --toggle-bg: rgba(0, 0, 0, 0.3);
  --toggle-border: rgba(255, 255, 255, 0.2);
  --toggle-hover: rgba(0, 0, 0, 0.5);
  --shadow-light: rgba(0, 0, 0, 0.3);
  --shadow-medium: rgba(0, 0, 0, 0.2);
  --strong-bg: linear-gradient(135deg, rgba(116, 185, 255, 0.2) 0%, rgba(162, 155, 254, 0.2) 100%);
}

/* catppuccin theme var */
body.catppuccin-theme {
  --bg-primary: #1e1e2e;
  --bg-secondary: #313244;
  --text-primary: #cdd6f4;
  --text-secondary: #cdd6f4;
  --text-tertiary: #a6adc8;
  --accent-primary: #f38ba8;
  --accent-secondary: #cba6f7;
  --accent-tertiary: #f38ba8;
  --accent-quaternary: #f38ba8;
  --accent-quinary: #cba6f7;
  --content-bg: rgba(49, 50, 68, 0.95);
  --card-bg-start: rgba(69, 71, 90, 0.8);
  --card-bg-end: rgba(88, 91, 112, 0.8);
  --card-border: rgba(243, 139, 168, 0.2);
  --toggle-bg: rgba(203, 166, 247, 0.2);
  --toggle-border: rgba(203, 166, 247, 0.3);
  --toggle-hover: rgba(203, 166, 247, 0.3);
  --shadow-light: rgba(0, 0, 0, 0.4);
  --shadow-medium: rgba(0, 0, 0, 0.3);
  --strong-bg: linear-gradient(135deg, rgba(243, 139, 168, 0.2) 0%, rgba(203, 166, 247, 0.2) 100%);
}

/* update text colors for dark themes */
body.dark-theme #content p {
  color: #ccc;
}

body.catppuccin-theme #content p {
  color: #bac2de;
}

/* main content container */
#content {
  max-width: 900px;
  margin: 0 auto;
  background: var(--content-bg);
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 20px 40px var(--shadow-light);
  backdrop-filter: blur(10px);
  animation: fadeIn 0.8s ease;
  transition: all 0.3s ease;
}

/* typography */
#content h1 {
  color: var(--text-secondary);
  margin-bottom: 25px;
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
  animation: slideInDown 0.8s ease;
  transition: all 0.3s ease;
}

#content h2 {
  color: var(--text-secondary);
  margin: 35px 0 20px 0;
  font-size: 1.8rem;
  font-weight: 600;
  padding-bottom: 10px;
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%) 1;
  position: relative;
  transition: all 0.3s ease;
}

#content h3 {
  color: var(--text-tertiary);
  margin: 30px 0 15px 0;
  font-size: 1.4rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

#content p {
  margin-bottom: 18px;
  text-align: justify;
  font-size: 1.1rem;
  line-height: 1.8;
  animation: slideInUp 0.8s ease;
  transition: all 0.3s ease;
}

/* lists */
#content ul, #content ol {
  margin: 20px 0;
  padding-left: 30px;
}

#content li {
  margin-bottom: 12px;
  font-size: 1.05rem;
  line-height: 1.7;
  animation: slideInLeft 0.8s ease;
}

#content li::marker {
  color: var(--accent-tertiary);
  font-weight: bold;
}

#content ul li {
  position: relative;
  list-style: none;
  padding-left: 25px;
}

#content ul li::before {
  content: '✦';
  position: absolute;
  left: 0;
  color: var(--accent-tertiary);
  font-weight: bold;
}

#content ol li::marker {
  color: var(--accent-tertiary);
  font-weight: bold;
}

/* strong text */
#content strong {
  color: var(--text-secondary);
  font-weight: 700;
  background: var(--strong-bg);
  padding: 2px 4px;
  border-radius: 4px;
  transition: all 0.3s ease;
}

/* chapter separators */
#content > div {
  margin-bottom: 50px;
  padding: 30px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--card-bg-start) 0%, var(--card-bg-end) 100%);
  box-shadow: 0 5px 15px var(--shadow-medium);
  border: 1px solid var(--card-border);
  animation: slideInUp 0.8s ease;
  transition: all 0.3s ease;
}

#content > div:not(:last-child) {
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, transparent 0%, var(--accent-primary) 50%, transparent 100%) 1;
}

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

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* responsive */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }
  
  #content {
    padding: 25px;
    border-radius: 15px;
  }
  
  #content h1 {
    font-size: 2rem;
  }
  
  #content h2 {
    font-size: 1.5rem;
  }
  
  #content p {
    font-size: 1rem;
  }
  
  #content > div {
    padding: 20px;
    margin-bottom: 30px;
  }
}

@media (max-width: 480px) {
  #content {
    padding: 20px;
  }
  
  #content h1 {
    font-size: 1.8rem;
  }
  
  #content h2 {
    font-size: 1.3rem;
  }
  
  #content > div {
    padding: 15px;
  }
}