/* ==========================================================================
   MONKEY TYPE PRO - TYPING ENGINE & TOOL UI
   Precision caret, fluid typography, results modal, and SEO layout
   ========================================================================== */

/* Main Tool Section */
.tool-section {
  padding: 3rem 0 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(70vh - 64px);
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Config & Mode Toolbar */
.toolbar-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.8rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  font-size: 0.85rem;
  color: var(--sub-color);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  justify-content: center;
}

.tool-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.tool-divider {
  width: 1px;
  height: 18px;
  background: var(--border-color);
}

.config-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.55rem;
  border-radius: var(--radius-sm);
  color: var(--sub-color);
  transition: var(--transition);
  cursor: pointer;
  user-select: none;
}

.config-btn:hover {
  color: var(--text-color);
  background: rgba(255, 255, 255, 0.05);
}

.config-btn.active {
  color: var(--main-color);
  font-weight: 700;
  background: var(--main-color-dim);
}

.config-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* Typing Area HUD */
.test-hud {
  width: 100%;
  max-width: 960px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1rem;
  margin-bottom: 1rem;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--main-color);
  opacity: 0;
  transition: opacity 0.25s ease;
  user-select: none;
}

.test-hud.active {
  opacity: 1;
}

.hud-stat-box {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.hud-label {
  font-size: 0.85rem;
  color: var(--sub-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-sans);
}

/* Words Container & Stream */
.typing-box {
  width: 100%;
  max-width: 960px;
  min-height: 160px;
  max-height: 160px;
  position: relative;
  overflow: hidden;
  outline: none;
  cursor: text;
  padding: 0.5rem 0;
  margin-bottom: 2rem;
  user-select: none;
}

.words-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 0.65rem;
  font-family: var(--font-mono);
  font-size: 1.6rem;
  line-height: 1.5;
  color: var(--sub-color);
  user-select: none;
  transition: transform 0.15s ease-out;
  will-change: transform;
}

.word {
  display: inline-flex;
  white-space: pre;
  word-break: keep-all;
  flex-shrink: 0;
}

.word.error {
  border-bottom: 2px solid var(--error-color);
}

.letter {
  transition: color 0.05s ease;
  position: relative;
}

.letter.correct {
  color: var(--text-color);
}

.letter.incorrect {
  color: var(--error-color);
}

.letter.extra {
  color: var(--error-extra-color);
  opacity: 0.9;
}

/* Caret / Cursor */
.caret {
  position: absolute;
  width: 2.5px;
  height: 1.5rem;
  background-color: var(--caret-color);
  border-radius: 2px;
  pointer-events: none;
  transition: left 0.08s ease-out, top 0.08s ease-out;
  box-shadow: 0 0 8px var(--caret-color);
  z-index: 10;
  display: block;
}

.caret.blink {
  animation: caretBlink 1s infinite ease-in-out;
}

@keyframes caretBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Hidden Input for Mobile and Keyboard capture */
#words-input {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  pointer-events: auto;
  z-index: -1;
  width: 1px;
  height: 1px;
  font-size: 16px !important;
  caret-color: transparent;
  border: none;
  background: transparent;
  outline: none;
}

/* Bottom Controls (Restart Button & Tooltip) */
.tool-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: var(--sub-color);
  user-select: none;
}

.btn-restart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  color: var(--sub-color);
  background: transparent;
  border: 1px solid transparent;
  transition: var(--transition);
  cursor: pointer;
}

.btn-restart:hover {
  color: var(--text-color);
  background: var(--bg-card);
  border-color: var(--border-color);
}

.btn-restart svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  transition: transform 0.3s ease;
}

.btn-restart:hover svg {
  transform: rotate(180deg);
}

.restart-hint {
  font-size: 0.8rem;
  color: var(--sub-color);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.key-badge {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-color);
}

/* ==========================================================================
   RESULTS CARD / MODAL
   ========================================================================== */
.results-card {
  width: 100%;
  max-width: 960px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.results-card.show {
  display: block;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
}

.result-main-group {
  display: flex;
  gap: 3rem;
  align-items: baseline;
}

.result-primary-stat {
  display: flex;
  flex-direction: column;
}

.result-primary-stat .val {
  font-family: var(--font-mono);
  font-size: 4rem;
  font-weight: 700;
  line-height: 1;
  color: var(--main-color);
}

.result-primary-stat .lbl {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--sub-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

.result-secondary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.stat-box .stat-val {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-color);
}

.stat-box .stat-lbl {
  font-size: 0.8rem;
  color: var(--sub-color);
  text-transform: uppercase;
  margin-top: 0.2rem;
}

/* Canvas Trajectory Chart */
.chart-container {
  width: 100%;
  height: 160px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 2rem;
  position: relative;
}

.chart-container canvas {
  width: 100%;
  height: 100%;
}

.results-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  align-items: center;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  transition: var(--transition);
}

.btn-action:hover {
  border-color: var(--main-color);
  color: var(--main-color);
  transform: translateY(-2px);
}

.btn-action.btn-primary {
  background: var(--main-color);
  color: var(--bg-color);
  border-color: var(--main-color);
}

.btn-action.btn-primary:hover {
  filter: brightness(1.1);
  color: var(--bg-color);
}

/* ==========================================================================
   HOMEPAGE SEO SECTIONS (BELOW THE FOLD)
   ========================================================================== */
.seo-section {
  padding: 5rem 0;
  border-top: 1px solid var(--border-color);
}

.section-head {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 3.5rem;
}

.section-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--main-color);
  background: var(--main-color-dim);
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  margin-bottom: 1rem;
}

.section-head h1,
.section-head h2 {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-color);
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  line-height: 1.25;
}

.section-head p {
  color: var(--sub-color);
  font-size: 1.05rem;
  line-height: 1.6;
}

/* Grid Cards (Features) */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 4rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: var(--transition);
}

.feature-card:hover {
  border-color: var(--main-color);
  transform: translateY(-4px);
  box-shadow: var(--shadow-sm);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--main-color-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--main-color);
  margin-bottom: 1.25rem;
}

.feature-icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.feature-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 0.65rem;
}

.feature-card p {
  color: var(--sub-color);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* Benchmarks Table */
.benchmark-table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 3rem 0;
  box-shadow: var(--shadow-sm);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.benchmark-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.benchmark-table th {
  background: var(--bg-secondary);
  padding: 1.1rem 1.5rem;
  color: var(--text-color);
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
}

.benchmark-table td {
  padding: 1.1rem 1.5rem;
  color: var(--sub-color);
  border-bottom: 1px solid var(--border-color);
}

.benchmark-table tr:last-child td {
  border-bottom: none;
}

.benchmark-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.benchmark-table td strong {
  color: var(--text-color);
}

.tier-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.tier-elite { background: rgba(226, 183, 20, 0.2); color: #e2b714; }
.tier-pro { background: rgba(80, 250, 123, 0.2); color: #50fa7b; }
.tier-avg { background: rgba(136, 192, 208, 0.2); color: #88c0d0; }
.tier-beg { background: rgba(255, 255, 255, 0.08); color: var(--text-color); }

/* FAQ Accordion */
.faq-accordion {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}

.faq-item:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.faq-question {
  width: 100%;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-color);
  cursor: pointer;
  text-align: left;
}

.faq-icon {
  width: 20px;
  height: 20px;
  fill: var(--sub-color);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
  fill: var(--main-color);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
  padding: 0 1.5rem;
}

.faq-item.active .faq-answer {
  max-height: 400px;
  transition: max-height 0.35s ease-in-out;
  padding-bottom: 1.5rem;
}

.faq-answer p {
  color: var(--sub-color);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ==========================================================================
   PERFORMANCE & STRUCTURE: High reliability rendering for all viewports
   ========================================================================== */
.seo-section {
  content-visibility: visible;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* ==========================================================================
   MULTI-SCREEN RESPONSIVE DESIGN (320px to 4K)
   ========================================================================== */

/* Large Tablets & Small Laptops (992px and below) */
@media (max-width: 992px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .toolbar-wrapper {
    gap: 1rem;
    padding: 0.4rem 0.75rem;
    margin-bottom: 2rem;
  }
}

/* Tablets & iPad Portrait (920px and below) */
@media (max-width: 920px), (max-width: 1024px) and (orientation: portrait) {
  .tool-section {
    padding: 1.75rem 0 2.5rem;
    min-height: auto;
  }

  .toolbar-wrapper {
    gap: 0.5rem 0.75rem;
    padding: 0.45rem 0.65rem;
    margin-bottom: 1.5rem;
  }

  .tool-divider {
    display: none;
  }

  .tool-group {
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .config-btn {
    padding: 0.35rem 0.55rem;
    font-size: 0.8rem;
    touch-action: manipulation;
  }

  .test-hud {
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
    padding: 0 0.5rem;
  }

  .typing-box {
    min-height: 135px;
    max-height: 135px;
    margin-bottom: 1.5rem;
  }

  .words-wrapper {
    font-size: 1.35rem;
    line-height: 1.45;
    gap: 0.55rem 0.5rem;
  }

  /* Results Card */
  .results-card {
    padding: 1.5rem 1.25rem;
  }

  .results-header {
    flex-direction: column;
    gap: 1.25rem;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
  }

  .result-main-group {
    flex-direction: row;
    justify-content: space-around;
    width: 100%;
    gap: 1.5rem;
  }

  .result-primary-stat .val {
    font-size: 3.25rem;
  }

  .result-secondary-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }

  .stat-box {
    padding: 0.85rem 1rem;
  }

  .stat-box .stat-val {
    font-size: 1.45rem;
  }

  .chart-container {
    height: 130px;
    margin-bottom: 1.5rem;
    padding: 0.75rem;
  }

  .results-actions {
    flex-direction: column;
    width: 100%;
    gap: 0.65rem;
  }

  .btn-action {
    width: 100%;
    justify-content: center;
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
  }

  /* SEO & Features */
  .seo-section {
    padding: 3.5rem 0;
  }

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

  .section-head h1,
  .section-head h2 {
    font-size: 1.85rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-bottom: 2.5rem;
  }

  .feature-card {
    padding: 1.5rem;
  }

  /* Benchmark Table Horizontal Scroll */
  .benchmark-table-wrapper {
    margin: 2rem 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .benchmark-table {
    min-width: 520px;
    width: 100%;
  }

  .benchmark-table th,
  .benchmark-table td {
    padding: 0.85rem 1rem;
    font-size: 0.88rem;
  }
}

/* Mobile Screens - Responsive Table Cards (No Horizontal Movement Needed) */
@media (max-width: 640px) {
  .benchmark-table-wrapper {
    margin: 1.5rem 0;
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
    width: 100%;
    max-width: 100%;
  }

  .benchmark-table {
    display: block;
    width: 100%;
    min-width: 0 !important;
  }

  .benchmark-table thead {
    display: none;
  }

  .benchmark-table tbody {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    width: 100%;
  }

  .benchmark-table tr {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.9rem 1.1rem;
    gap: 0.45rem;
    box-shadow: var(--shadow-sm);
    width: 100%;
    box-sizing: border-box;
  }

  .benchmark-table tr:hover td {
    background: transparent;
  }

  .benchmark-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.88rem;
    color: var(--text-color);
    text-align: right;
    width: 100%;
    box-sizing: border-box;
  }

  .benchmark-table td:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .benchmark-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--sub-color);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
    text-align: left;
    margin-right: 0.75rem;
  }

  .faq-accordion {
    gap: 0.75rem;
  }

  .faq-question {
    padding: 1rem 1.25rem;
    font-size: 1rem;
  }

  .faq-answer {
    padding: 0 1.25rem;
  }

  .faq-item.active .faq-answer {
    padding-bottom: 1.25rem;
  }
}

/* Mobile Phones (480px and below) */
@media (max-width: 480px) {
  .tool-section {
    padding: 1rem 0 2rem;
  }

  .toolbar-wrapper {
    width: 100%;
    padding: 0.4rem 0.5rem;
    gap: 0.4rem 0.45rem;
    margin-bottom: 1.25rem;
  }

  .tool-group {
    gap: 0.25rem;
  }

  .config-btn {
    padding: 0.32rem 0.45rem;
    font-size: 0.78rem;
  }

  .config-btn svg {
    width: 13px;
    height: 13px;
  }

  .test-hud {
    font-size: 1.2rem;
    padding: 0 0.25rem;
    margin-bottom: 0.6rem;
  }

  .typing-box {
    min-height: 115px;
    max-height: 115px;
    margin-bottom: 1.25rem;
    padding: 0.25rem 0;
  }

  .words-wrapper {
    font-size: 1.2rem;
    line-height: 1.4;
    gap: 0.4rem 0.45rem;
  }

  .result-main-group {
    gap: 1rem;
  }

  .result-primary-stat .val {
    font-size: 2.75rem;
  }

  .result-primary-stat .lbl {
    font-size: 0.82rem;
  }

  .stat-box {
    padding: 0.75rem 0.85rem;
  }

  .stat-box .stat-val {
    font-size: 1.25rem;
  }

  .section-head h1,
  .section-head h2 {
    font-size: 1.55rem;
  }

  .section-head p {
    font-size: 0.95rem;
  }

  .faq-question {
    padding: 0.85rem 1rem;
    font-size: 0.92rem;
  }

  .faq-answer p {
    font-size: 0.88rem;
  }
}

/* Extra Small Screens (360px and below, e.g. iPhone SE, Fold) */
@media (max-width: 360px) {
  .words-wrapper {
    font-size: 1.08rem;
    gap: 0.35rem 0.4rem;
  }

  .config-btn {
    padding: 0.3rem 0.38rem;
    font-size: 0.72rem;
  }

  .result-primary-stat .val {
    font-size: 2.35rem;
  }
}

/* ==========================================================================
   FULLSCREEN ARRIVAL HINT DIALOG
   ========================================================================== */
.fullscreen-arrival-hint {
  position: absolute;
  top: calc(100% + 10px);
  left: 1.5rem;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--main-color);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  font-size: 0.85rem;
  color: var(--text-color);
  animation: hintSlideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.hint-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hint-icon {
  width: 16px;
  height: 16px;
  fill: var(--main-color);
  flex-shrink: 0;
}

.hint-btns {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-hint-enter {
  background: var(--main-color);
  color: var(--bg-color);
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-hint-enter:hover {
  filter: brightness(1.15);
}

.btn-hint-close {
  background: transparent;
  color: var(--sub-color);
  font-size: 1.1rem;
  line-height: 1;
  border: none;
  cursor: pointer;
  padding: 0 0.2rem;
  transition: color 0.2s;
}

.btn-hint-close:hover {
  color: var(--text-color);
}

@media (max-width: 640px) {
  .fullscreen-arrival-hint {
    left: 0.75rem;
    right: 0.75rem;
    font-size: 0.8rem;
    gap: 0.5rem;
  }
}

/* ==========================================================================
   CUSTOM PRACTICE TEXT MODAL
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease-out;
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--sub-color);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close-btn:hover {
  color: var(--text-color);
}

.modal-body {
  padding: 1.5rem;
}

.modal-desc {
  font-size: 0.85rem;
  color: var(--sub-color);
  margin-bottom: 0.75rem;
}

.modal-body textarea {
  width: 100%;
  height: 160px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  color: var(--text-color);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}

.modal-body textarea:focus {
  border-color: var(--main-color);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   VERIFIED CERTIFICATE ACTION BUTTON
   ========================================================================== */
.btn-certificate {
  background: rgba(80, 250, 123, 0.12) !important;
  color: var(--main-color) !important;
  border-color: var(--main-color) !important;
}

.btn-certificate:hover {
  background: var(--main-color) !important;
  color: var(--bg-color) !important;
  transform: translateY(-2px);
}

/* ==========================================================================
   EDITORIAL GUIDES PREVIEW GRID (Internal SEO & AdSense Links)
   ========================================================================== */
.guides-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
  margin-top: 2rem;
}

.guide-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  transition: var(--transition);
  height: 100%;
}

.guide-card:hover {
  transform: translateY(-4px);
  border-color: var(--main-color);
  box-shadow: var(--shadow-md);
}

.guide-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--main-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.guide-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-color);
  line-height: 1.35;
  margin-bottom: 0.75rem;
}

.guide-card p {
  font-size: 0.92rem;
  color: var(--sub-color);
  line-height: 1.55;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.guide-link-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--main-color);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.guide-card-all {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--main-color-dim) 100%);
  border-color: rgba(189, 147, 249, 0.3);
}

@media (max-width: 992px) {
  .guides-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .guides-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}


