 
/* Modern Math Blog Theme - Introduction to Rings */

:root {
  /* Warm color palette for better eye comfort */
  --primary-color: #e17055;
  --secondary-color: #fdcb6e;
  --accent-color: #00b894;
  --background-color: #f9f3e5;
  --text-color: #2d3436;
  --light-gray: #f5efe0;
  --medium-gray: #e6d9c0;
  --dark-gray: #7d7668;
  --header-font: 'Playfair Display', Georgia, serif;
  --body-font: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  --math-font: 'STIX Two Math', serif;
  --border-radius: 12px;
  --box-shadow: 0 8px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --transition-speed: 0.3s;
}

/* Dark mode support - warmer dark theme for better reading */
@media (prefers-color-scheme: dark) {
  :root {
    --background-color: #2d2926;
    --text-color: #f0e6d2;
    --light-gray: #3a3631;
    --medium-gray: #4a443c;
    --dark-gray: #a39e93;
    --primary-color: #ff9f80;
    --secondary-color: #ffd391;
    --accent-color: #55efc4;
  }
  
  img[src^="main"] {
    filter: brightness(0.9) sepia(0.2);
  }
}

/* Base styles */
body {
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: var(--body-font);
  line-height: 1.7;
  margin: 0;
  padding: 0;
  transition: background-color var(--transition-speed) ease;
  overflow-x: hidden;
  max-width: 100%;
  padding: 0 1rem;
  font-size: 17px;
  text-align: justify;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

@media (min-width: 768px) {
  body {
    margin: 2rem auto;
    max-width: 800px;
    padding: 0 2rem;
  }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--header-font);
  line-height: 1.2;
  margin-top: 1.5em;
  margin-bottom: 0.8em;
  color: var(--primary-color);
  font-weight: 700;
  text-align: left;
}

h1, .titleHead {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 1.2rem;
  position: relative;
  padding-bottom: 0.7rem;
  letter-spacing: -0.025em;
  color: var(--primary-color);
}

h1::after, .titleHead::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 2px;
}

h2, .likesectionHead {
  font-size: 2rem;
  color: var(--primary-color);
  letter-spacing: -0.025em;
  border-bottom: 2px solid var(--medium-gray);
  padding-bottom: 0.5rem;
}

h3, .sectionHead {
  font-size: 1.75rem;
  border-left: 4px solid var(--accent-color);
  padding-left: 1rem;
  margin-top: 2rem;
  letter-spacing: -0.025em;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  background-color: var(--light-gray);
  padding: 0.7rem 1rem;
  border-radius: var(--border-radius);
}

h3:hover, .sectionHead:hover {
  color: var(--accent-color);
  transform: translateX(5px);
}

/* Stylish collapse button instead of arrow */
h3::after, .sectionHead::after {
  content: "";
  margin-left: auto;
  width: 30px;
  height: 30px;
  background-color: var(--accent-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform var(--transition-speed) ease, background-color var(--transition-speed) ease;
}

h3::after, .sectionHead::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px;
}

h3.collapsed::after, .sectionHead.collapsed::after {
  transform: rotate(-180deg);
  background-color: var(--primary-color);
}

h4, .subsectionHead {
  font-size: 1.5rem;
  color: var(--text-color);
  letter-spacing: -0.025em;
  border-bottom: 1px dashed var(--medium-gray);
  padding-bottom: 0.3rem;
}

p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  line-height: 1.8;
  text-align: justify;
}

/* Links */
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-speed) ease, transform var(--transition-speed) ease;
  position: relative;
  overflow: hidden;
  font-weight: 500;
  padding: 0.1rem 0.2rem;
}

a:hover {
  color: var(--accent-color);
  text-decoration: none;
}

a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--accent-color);
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.3s ease;
}

a:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

/* Table of Contents */
.tableofcontents {
  background-color: var(--light-gray);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin: 2rem 0;
  box-shadow: var(--box-shadow);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  border: 1px solid var(--medium-gray);
}

.tableofcontents::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
  animation: gradient-shift 8s ease infinite;
  background-size: 200% 200%;
}

.toc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  cursor: pointer;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--medium-gray);
}

.toc-header h3 {
  margin: 0;
  border: none;
  padding: 0;
  background-color: transparent;
  font-size: 1.5rem;
  color: var(--primary-color);
}

.toc-header .toc-toggle {
  width: 30px;
  height: 30px;
  background-color: var(--accent-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: transform var(--transition-speed) ease, background-color var(--transition-speed) ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px;
}

.toc-header.collapsed .toc-toggle {
  transform: rotate(-180deg);
  background-color: var(--primary-color);
}

.toc-content {
  max-height: 1000px;
  overflow: hidden;
  transition: max-height var(--transition-speed) ease;
}

.toc-content.collapsed {
  max-height: 0;
}

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.tableofcontents a {
  display: inline-block;
  transition: transform var(--transition-speed) ease;
  padding: 0.3rem 0;
  color: var(--text-color);
}

.tableofcontents a:hover {
  transform: translateX(5px);
  color: var(--primary-color);
}

.sectionToc {
  font-weight: 600;
  display: block;
  margin-top: 0.75rem;
  color: var(--primary-color);
}

.subsectionToc {
  margin-left: 1.5rem;
  display: block;
  color: var(--dark-gray);
  font-size: 0.95rem;
  border-left: 2px solid var(--medium-gray);
  padding-left: 0.8rem;
  margin-top: 0.3rem;
}

/* Math elements */
.mathjax-block {
  overflow-x: auto;
  margin: 1.5rem 0;
  padding: 1.5rem;
  background-color: var(--light-gray);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  transition: transform var(--transition-speed) ease;
  border-left: 4px solid var(--primary-color);
}

.mathjax-block:hover {
  transform: translateY(-5px);
}

.mathjax-inline {
  font-family: var(--math-font);
  padding: 0 0.2rem;
  color: var(--primary-color);
  font-weight: 500;
}

/* Problem and Solution sections */
#problem-statement, #problem-statement1, #problem-statement2, #problem-statement3,
#problem-statement4, #problem-statement5, #problem-statement6, #problem-statement7,
#problem-statement8, #problem-statement9 {
  background-color: rgba(225, 112, 85, 0.1);
  border-radius: var(--border-radius);
  padding: 1.8rem;
  margin: 1.8rem 0;
  border-left: 4px solid var(--primary-color);
  position: relative;
  box-shadow: var(--box-shadow);
}

#solution, #solution1, #solution2, #solution3, #solution4,
#solution5, #solution6, #solution7, #solution8, #solution9 {
  background-color: rgba(0, 184, 148, 0.1);
  border-radius: var(--border-radius);
  padding: 1.8rem;
  margin: 1.8rem 0;
  border-left: 4px solid var(--accent-color);
  position: relative;
  box-shadow: var(--box-shadow);
}

/* Collapsible sections */
.section-content {
  max-height: 2000px;
  overflow: hidden;
  transition: max-height 0.5s ease, opacity 0.5s ease;
  opacity: 1;
  padding-left: 1rem;
  border-left: 2px solid var(--medium-gray);
  margin-left: 0.5rem;
}

.section-content.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
}

/* Header and title */
.maketitle {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2.5rem 0;
  position: relative;
  overflow: hidden;
  background-color: var(--light-gray);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

.maketitle::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(225, 112, 85, 0.15) 0%, transparent 70%);
  z-index: -1;
  animation: pulse 8s infinite alternate;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(1.2); opacity: 0.2; }
}

.titleHead {
  animation: fadeInDown 1s ease-out;
  color: var(--primary-color);
  font-weight: 800;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.author, .date {
  color: var(--dark-gray);
  margin-top: 0.8rem;
  animation: fadeInUp 1s ease-out;
  font-size: 1.1rem;
}

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

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

/* Custom animations for page elements */
.sectionHead, .subsectionHead {
  animation: slideInLeft 0.5s ease-out;
}

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

p, .mathjax-block {
  animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Responsive design */
@media (max-width: 768px) {
  h1, .titleHead { font-size: 2rem; }
  h2, .likesectionHead { font-size: 1.75rem; }
  h3, .sectionHead { font-size: 1.5rem; }
  h4, .subsectionHead { font-size: 1.25rem; }
  p { font-size: 1rem; }
  .tableofcontents { padding: 1rem; }
  .mathjax-block { padding: 1rem; }
  body { font-size: 16px; }
}

/* Print styles */
@media print {
  body {
    font-size: 12pt;
    max-width: none;
    margin: 0;
    padding: 0;
    background-color: white;
    color: black;
  }
  
  .mathjax-block:hover {
    transform: none;
  }
  
  a::after {
    display: none;
  }
  
  .tableofcontents::before {
    display: none;
  }
  
  .maketitle::before {
    display: none;
  }
}

/* Additional styles from original CSS that might be needed */
.cmr-17 { font-size: 170%; }
.cmr-12 { font-size: 120%; }

/* Preserve some original styles for compatibility */
img.math { vertical-align: middle; }
div.par-math-display, div.math-display { text-align: center; }
.Canvas { position: relative; }
.indent { text-indent: 2em; }
.noindent { text-indent: 0; }

/* Enhance tables */
table.tabular {
  border-collapse: collapse;
  width: 100%;
  margin: 1.8rem 0;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  border: 1px solid var(--medium-gray);
}

table.tabular td, table.tabular th {
  padding: 1rem;
  border: 1px solid var(--medium-gray);
  text-align: left;
}

table.tabular th {
  background-color: var(--primary-color);
  color: white;
  font-weight: 600;
}

table.tabular tr:nth-child(even) {
  background-color: var(--light-gray);
}

/* Enhance code blocks */
pre.verbatim {
  font-family: 'Fira Code', monospace;
  background-color: var(--light-gray);
  padding: 1.2rem;
  border-radius: var(--border-radius);
  overflow-x: auto;
  box-shadow: var(--box-shadow);
  margin: 1.8rem 0;
  border-left: 4px solid var(--accent-color);
  font-size: 0.95rem;
}

code.verb {
  font-family: 'Fira Code', monospace;
  background-color: var(--light-gray);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  color: var(--accent-color);
  font-size: 0.9rem;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--light-gray);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--dark-gray);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* Button styling */
.btn {
  display: inline-block;
  padding: 0.7rem 1.2rem;
  background: var(--primary-color);
  color: white;
  border-radius: var(--border-radius);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  border: none;
  box-shadow: var(--box-shadow);
  text-align: center;
}

.btn:hover {
  background: var(--accent-color);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.875rem;
}

/* Floating back to top button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition-speed) ease, transform var(--transition-speed) ease;
  box-shadow: var(--box-shadow);
  z-index: 100;
  font-size: 1.5rem;
}

.back-to-top.visible {
  opacity: 1;
}

.back-to-top:hover {
  transform: translateY(-5px);
  background: var(--accent-color);
}

