/* Apple-Inspired Clean Design - Shared Styles */
/* Color Palette: White, Blue (#007AFF), Light Gray (#F5F5F7), Dark Gray (#1D1D1F) */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: #1d1d1f;
  background: #f5f5f7;
  padding: 0;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  background: #ffffff;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

/* Header */
header {
  background: linear-gradient(135deg, #007AFF 0%, #0051D5 100%);
  color: white;
  padding: 60px 40px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

header h1 {
  font-size: 3em;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

header p {
  font-size: 1.3em;
  font-weight: 400;
  opacity: 0.95;
  letter-spacing: 0.2px;
}

/* Content */
.content {
  padding: 60px 40px;
}

.section {
  margin-bottom: 70px;
}

.section h2 {
  color: #1d1d1f;
  font-size: 2.5em;
  font-weight: 600;
  margin-bottom: 24px;
  letter-spacing: -0.5px;
}

.section h3 {
  color: #1d1d1f;
  font-size: 1.75em;
  font-weight: 600;
  margin-top: 40px;
  margin-bottom: 16px;
  letter-spacing: -0.3px;
}

.section h4 {
  color: #1d1d1f;
  font-size: 1.3em;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 12px;
}

.section p {
  color: #515154;
  font-size: 1.05em;
  line-height: 1.7;
  margin-bottom: 16px;
}

/* Table of Contents */
.toc {
  background: #f5f5f7;
  padding: 32px;
  border-radius: 12px;
  margin-bottom: 48px;
  border: 1px solid #e5e5e7;
}

.toc h3 {
  color: #1d1d1f;
  font-size: 1.5em;
  font-weight: 600;
  margin-bottom: 20px;
  margin-top: 0;
}

.toc ul {
  list-style: none;
  margin-left: 0;
}

.toc li {
  margin: 12px 0;
}

.toc a {
  color: #007AFF;
  text-decoration: none;
  font-size: 1.05em;
  font-weight: 500;
  transition: color 0.2s ease;
}

.toc a:hover {
  color: #0051D5;
  text-decoration: underline;
}

/* Code Blocks */
.code-block {
  background: #1d1d1f;
  color: #f5f5f7;
  padding: 24px;
  border-radius: 12px;
  overflow-x: auto;
  margin: 24px 0;
  font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  border: 1px solid #2d2d2f;
}

.code-block .keyword {
  color: #FF7AB2;
  font-weight: 500;
}

.code-block .class-name {
  color: #6BDFFF;
  font-weight: 500;
}

.code-block .method {
  color: #DABAFF;
  font-weight: 500;
}

.code-block .comment {
  color: #7F8C98;
  font-style: italic;
}

.code-block .string {
  color: #FD8F3F;
}

/* Info Boxes */
.tip-box,
.info-box,
.benefit-box {
  background: #E3F2FD;
  border-left: 4px solid #007AFF;
  padding: 20px 24px;
  border-radius: 8px;
  margin: 24px 0;
}

.tip-box strong,
.info-box strong,
.benefit-box strong {
  color: #0051D5;
  display: block;
  margin-bottom: 8px;
  font-size: 1.1em;
}

.warning-box {
  background: #FFF3E0;
  border-left: 4px solid #FF9500;
  padding: 20px 24px;
  border-radius: 8px;
  margin: 24px 0;
}

.warning-box strong {
  color: #CC7A00;
  display: block;
  margin-bottom: 8px;
  font-size: 1.1em;
}

.note {
  background: #F0F0F2;
  border-left: 4px solid #86868B;
  padding: 20px 24px;
  margin: 24px 0;
  border-radius: 8px;
}

.note strong {
  color: #1d1d1f;
  display: block;
  margin-bottom: 8px;
}

/* Cards */
.principle-card {
  background: #ffffff;
  border: 1px solid #e5e5e7;
  padding: 28px;
  margin: 24px 0;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.principle-card h4 {
  color: #007AFF;
  font-size: 1.4em;
  font-weight: 600;
  margin-bottom: 16px;
  margin-top: 0;
}

/* Tables */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.comparison-table th,
.comparison-table td {
  border: 1px solid #e5e5e7;
  padding: 16px 20px;
  text-align: left;
}

.comparison-table th {
  background: #007AFF;
  color: white;
  font-weight: 600;
  font-size: 1.05em;
}

.comparison-table tr:nth-child(even) {
  background: #f5f5f7;
}

.comparison-table tr:hover {
  background: #e8f4fd;
}

/* Badges */
.level-badge,
.comparison-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.85em;
  font-weight: 600;
  margin-right: 8px;
}

.level-badge {
  background: #007AFF;
  color: white;
}

.comparison-badge {
  background: #f5f5f7;
  color: #1d1d1f;
  border: 1px solid #e5e5e7;
}

/* Diagrams */
.diagram {
  background: #f5f5f7;
  border: 1px solid #e5e5e7;
  padding: 32px;
  margin: 32px 0;
  border-radius: 12px;
  text-align: center;
}

.diagram-box {
  display: inline-block;
  background: white;
  border: 2px solid #007AFF;
  padding: 16px 28px;
  margin: 12px;
  border-radius: 8px;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 122, 255, 0.1);
}

.arrow {
  display: inline-block;
  margin: 0 12px;
  font-size: 24px;
  color: #007AFF;
}

/* Lists */
ul,
ol {
  margin-left: 24px;
  margin-top: 12px;
  margin-bottom: 12px;
  color: #515154;
}

li {
  margin: 10px 0;
  line-height: 1.6;
}

/* Highlight */
.highlight {
  background: #E3F2FD;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
  color: #007AFF;
}

/* Related Pages Section */
.related-pages {
  background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ea 100%);
  padding: 48px 40px;
  margin-top: 60px;
  border-top: 1px solid #e5e5e7;
}

.related-pages h3 {
  color: #1d1d1f;
  font-size: 1.75em;
  font-weight: 600;
  margin-bottom: 24px;
  text-align: center;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
}

.related-card {
  background: white;
  border: 1px solid #e5e5e7;
  border-radius: 12px;
  padding: 24px;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.related-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 122, 255, 0.15);
  border-color: #007AFF;
}

.related-card h4 {
  color: #007AFF;
  font-size: 1.2em;
  font-weight: 600;
  margin-bottom: 8px;
  margin-top: 0;
}

.related-card p {
  color: #515154;
  font-size: 0.95em;
  margin: 0;
  line-height: 1.5;
}

/* Footer */
footer {
  background: #1d1d1f;
  color: #f5f5f7;
  padding: 32px 40px;
  text-align: center;
}

footer p {
  margin: 8px 0;
  color: #86868B;
}

footer a {
  color: #007AFF;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

footer a:hover {
  color: #0051D5;
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
  header {
    padding: 40px 24px;
  }

  header h1 {
    font-size: 2em;
  }

  header p {
    font-size: 1.1em;
  }

  .content {
    padding: 40px 24px;
  }

  .section h2 {
    font-size: 2em;
  }

  .section h3 {
    font-size: 1.5em;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .code-block {
    font-size: 13px;
    padding: 16px;
  }
}
