/* static/css/components.css */

/* Code Blocks - Full rectangular background */
pre {
  background: var(--bg-code) !important;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin: 1.5rem 0;
  overflow: hidden;
  padding: 1.5rem;
  position: relative;
}

pre code {
  background: transparent !important;
  display: block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-primary);
}

/* Inline code */
.chapter-content code:not(pre code) {
  background: var(--bg-tertiary);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--accent-primary);
}

.code-block {
  background: var(--bg-code);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin: 1.5rem 0;
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
}

.code-lang {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-primary);
  font-weight: 700;
}

.code-file {
  font-size: 0.75rem;
  color: var(--text-muted);
}

pre {
  padding: 1.5rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
}

code {
  font-family: var(--font-mono);
}

/* Info Boxes */
.info-box {
  background: var(--bg-tertiary);
  border-left: 4px solid var(--accent-primary);
  padding: 1.5rem;
  margin: 2rem 0;
}

.info-box h4 {
  color: var(--accent-primary);
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.info-box p {
  margin-bottom: 0;
}

.info-box.tip {
  border-left-color: var(--accent-cyan);
}

.info-box.tip h4 {
  color: var(--accent-cyan);
}

.info-box.warning {
  border-left-color: var(--accent-secondary);
}

.info-box.warning h4 {
  color: var(--accent-secondary);
}

/* Scenario Cards */
.scenario-card {
  background: var(--bg-card);
  border-left: 4px solid var(--accent-secondary);
  padding: 2rem;
  margin: 2rem 0;
}

.scenario-card h4 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--accent-secondary);
  margin-bottom: 1.5rem;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.9rem;
}

th {
  background: var(--bg-tertiary);
  color: var(--accent-primary);
  text-align: left;
  padding: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
  border-bottom: 2px solid var(--accent-primary);
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

tr:hover td {
  background: var(--bg-tertiary);
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 2rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--accent-primary);
  transform: scaleY(0);
  transition: transform 0.3s;
}

.card:hover {
  border-color: var(--border-accent);
}

.card:hover::before {
  transform: scaleY(1);
}

.card h3 {
  margin-bottom: 1rem;
}

.card p {
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* Section Explanation */
.section-intro {
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, rgba(0, 212, 170, 0.05) 100%);
  border-left: 4px solid var(--accent-primary);
  padding: 1.5rem 2rem;
  margin: 2rem 0;
  border-radius: 0 8px 8px 0;
}

.section-intro h4 {
  color: var(--accent-primary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.section-intro p {
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.7;
}

/* Why Section - Design Rationale */
.why-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2rem;
  margin: 2rem 0;
  position: relative;
}

.why-section::before {
  content: '💡';
  position: absolute;
  top: -12px;
  left: 1.5rem;
  background: var(--bg-card);
  padding: 0 0.5rem;
  font-size: 1.2rem;
}

.why-section h4 {
  color: var(--accent-secondary);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.why-section p {
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* Implementation Guide */
.implementation-guide {
  background: var(--bg-tertiary);
  border-radius: 8px;
  padding: 1.5rem 2rem;
  margin: 2rem 0;
}

.implementation-guide h4 {
  color: var(--text-primary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.implementation-guide h4::before {
  content: '⚙️';
}

.implementation-guide ol {
  margin: 0;
  padding-left: 1.5rem;
}

.implementation-guide li {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

/* Chapter Overview Box */
.chapter-overview {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(0, 212, 170, 0.03) 100%);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  margin: 2rem 0;
}

.chapter-overview h3 {
  color: var(--accent-primary);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.chapter-overview ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.chapter-overview li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
  color: var(--text-secondary);
}

.chapter-overview li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent-primary);
  font-weight: bold;
}
.code-copy {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.25rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}

pre:hover .code-copy {
  opacity: 1;
}

.code-copy:hover {
  background: var(--accent-primary);
  color: var(--bg-primary);
}
