/* Reset & Global */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(139, 92, 246, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 85% 60%, rgba(27, 217, 106, 0.04), transparent);
  background-attachment: fixed;
}

::selection {
  background: rgba(139, 92, 246, 0.35);
  color: #ffffff;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-highlight);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

/* Layout Containers */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.section {
  padding-top: 4.5rem;
  padding-bottom: 4.5rem;
  position: relative;
}

.section-header {
  margin-bottom: 2.5rem;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-light);
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  font-weight: 800;
  color: var(--text-highlight);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.section-desc {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 580px;
  margin-top: 0.5rem;
}

/* Base Panel */
.bento-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
  position: relative;
  display: flex;
  flex-direction: column;
}

.bento-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-card);
}

/* SVG Icon alignment */
.svg-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* App Mounting */
#app {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.fade-in {
  animation: fadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

/* ==========================================================================
   Discord & ChatGPT-Style Code Blocks & Markdown Components
   ========================================================================== */

/* ChatGPT Style Code Block */
.chatgpt-code-block,
.discord-code-block {
  background: #12131a;
  border: 1px solid #202336;
  border-radius: 10px;
  margin: 1.5rem 0;
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.chatgpt-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1rem;
  background: #181a24;
  border-bottom: 1px solid #202336;
  color: #8b949e;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.chatgpt-code-lang {
  color: #a5b4fc;
  text-transform: uppercase;
  font-weight: 700;
}

.chatgpt-copy-btn,
.discord-copy-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #c9d1d9;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  font-family: inherit;
}

.chatgpt-copy-btn:hover,
.discord-copy-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.chatgpt-copy-btn.copied,
.discord-copy-btn.copied {
  background: rgba(35, 165, 90, 0.2);
  border-color: rgba(35, 165, 90, 0.6);
  color: #23a55a;
}

.chatgpt-code-block pre,
.discord-code-block pre {
  padding: 1.15rem 1.25rem;
  margin: 0;
  background: #0e0f15;
  overflow-x: auto;
}

.chatgpt-code-block code,
.discord-code-block code {
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 0.875rem;
  color: #e6edf3;
  line-height: 1.65;
  background: transparent;
  padding: 0;
  border: none;
}

/* Syntax Token Colors */
.tok-comment { color: #8b949e; font-style: italic; }
.tok-string { color: #7ee787; }
.tok-number { color: #79c0ff; }
.tok-boolean { color: #ff7b72; font-weight: 600; }
.tok-keyword { color: #d2a8ff; font-weight: 600; }

/* Discord Inline Code with Click-to-Copy */
.discord-inline-code,
code:not(pre code) {
  background: #1e202e;
  color: #c9d1d9;
  padding: 2px 7px;
  border-radius: 5px;
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 0.875em;
  border: 1px solid #2d3148;
  cursor: pointer;
  display: inline-block;
  vertical-align: baseline;
  user-select: all;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.discord-inline-code:hover,
code:not(pre code):hover {
  background: #2a2e45;
  color: #ffffff;
  border-color: var(--modrinth-green);
  box-shadow: 0 0 8px rgba(27, 217, 106, 0.25);
  transform: translateY(-1px);
}

.discord-inline-code:active,
code:not(pre code):active {
  transform: scale(0.96);
}

.discord-inline-code.inline-code-copied,
code:not(pre code).inline-code-copied {
  background: rgba(35, 165, 90, 0.25) !important;
  color: #23a55a !important;
  border-color: #23a55a !important;
  box-shadow: 0 0 12px rgba(35, 165, 90, 0.4) !important;
  animation: pulsePill 0.3s ease;
}

@keyframes pulsePill {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* Discord Spoiler (Click to reveal) */
.discord-spoiler {
  background: #2b2d31;
  color: transparent;
  border-radius: 4px;
  padding: 1px 6px;
  cursor: pointer;
  user-select: none;
  filter: blur(5px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
}

.discord-spoiler.revealed {
  filter: none;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.08);
  user-select: text;
}

/* Keyboard Pill */
.kbd-pill,
kbd {
  background: #1a1c26;
  border: 1px solid #32374d;
  border-bottom: 2px solid #252838;
  border-radius: 5px;
  padding: 2px 7px;
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 600;
  color: #e2e8f0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  display: inline-block;
}

/* Highlight & Underline */
.markdown-mark,
mark {
  background: rgba(245, 158, 11, 0.2);
  color: #fde68a;
  padding: 1px 5px;
  border-radius: 3px;
  border-bottom: 1px solid rgba(245, 158, 11, 0.5);
}

.markdown-underline {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Discord Blockquotes */
.discord-quote {
  border-left: 4px solid #4e5058;
  padding: 0.4rem 0 0.4rem 1.1rem;
  margin: 1rem 0;
  color: #949ba4;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 0 6px 6px 0;
}

.discord-quote-multi {
  border-left-color: var(--primary-light);
  background: rgba(139, 92, 246, 0.04);
}

/* Lists & Task Lists */
.discord-list {
  padding-left: 1.5rem;
  color: #c9d1d9;
  margin-bottom: 1.25rem;
}

.discord-list li {
  margin-bottom: 0.45rem;
  line-height: 1.6;
}

.discord-list.task-list {
  list-style: none;
  padding-left: 0;
}

.task-list-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.45rem;
}

.task-checkbox {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
  cursor: pointer;
  border-radius: 4px;
}

.task-checked .task-content {
  text-decoration: line-through;
  opacity: 0.6;
}

/* Collapsible Details / Summary */
.markdown-details {
  background: #11131d;
  border: 1px solid #202436;
  border-radius: 8px;
  margin: 1.25rem 0;
  overflow: hidden;
}

.markdown-summary {
  padding: 0.75rem 1.15rem;
  cursor: pointer;
  font-weight: 700;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.02);
  user-select: none;
  transition: background 0.15s ease;
}

.markdown-summary:hover {
  background: rgba(255, 255, 255, 0.05);
}

.markdown-details-content {
  padding: 1.25rem;
  border-top: 1px solid #202436;
}

/* Horizontal Rule */
.markdown-hr {
  border: none;
  border-top: 1px solid #202436;
  margin: 2.25rem 0;
}
