/* ═══════════════════════════════════════════════════════
   HERO.CSS — Hero Section, Codepad, Input, Solution Panel
═══════════════════════════════════════════════════════ */

/* ── OUTER CENTER WRAPPER ── */
.nl-center { width: 100%; }

/* ── CODEPAD SECTION ── */
#Codepad {
  background: linear-gradient(160deg, #1a1a2e 0%, #16213e 55%, #0f3460 100%);
  padding: 52px 24px 68px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Decorative blobs */
#Codepad::before {
  content: '';
  position: absolute;
  top: -80px; right: -60px;
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(219,63,89,0.18) 0%, transparent 65%);
  pointer-events: none;
  animation: blobFloat 8s ease-in-out infinite;
}
#Codepad::after {
  content: '';
  position: absolute;
  bottom: -100px; left: -60px;
  width: 340px; height: 340px;
  background: radial-gradient(circle, rgba(99,102,241,0.14) 0%, transparent 65%);
  pointer-events: none;
  animation: blobFloat 10s ease-in-out infinite reverse;
}
@keyframes blobFloat {
  0%,100% { transform: translate(0,0) scale(1); }
  50%      { transform: translate(20px,-20px) scale(1.05); }
}

/* ── TITLE ── */
.smc-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
  position: relative;
  z-index: 2;
}

.smc-subtitle {
  font-size: 16px;
  color: rgba(255,255,255,0.55);
  font-weight: 400;
  margin-bottom: 36px;
  position: relative;
  z-index: 2;
}

/* ── CODEPAD ALIGN WIDTH ── */
#codepad-align-width {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 3;
}

/* ── MOST USED ACTIONS BAR ── */
#most_used_actions {
  margin-bottom: 12px;
}

.codepad-form#MostUsedActions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

/* Quick action chips */
.padButton.new-pad-button {
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.16);
  color: rgba(255,255,255,0.88);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: var(--r-full);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast),
              color var(--t-fast), transform var(--t-fast);
  font-family: 'Rubik', sans-serif;
  white-space: nowrap;
  letter-spacing: 0.1px;
}

.padButton.new-pad-button:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(219,63,89,0.35);
}

/* See All button + dropdown */
#see_all_span {
  position: relative;
  display: inline-block;
}

.see-all-btn {
  display: flex;
  align-items: center;
  gap: 4px;
}

#most_used_dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border-radius: var(--r-lg);
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  border: 1px solid rgba(0,0,0,0.07);
  min-width: 220px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 500;
  animation: dropIn 0.15s ease;
}

@keyframes dropIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.padSelect {
  display: block;
  padding: 9px 18px;
  font-size: 13px;
  color: var(--text-700);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
  border-left: 3px solid transparent;
}

.padSelect:hover {
  background: var(--red-light);
  color: var(--red);
  border-left-color: var(--red);
}

/* ── FULL PAD TOGGLE ── */
#toggle-full-pad {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  font-weight: 500;
  justify-content: flex-start;
  padding: 10px 4px 4px;
}

/* Toggle switch */
.pad-toggle-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.toggle-track {
  position: relative;
  width: 44px;
  height: 24px;
  background: rgba(255,255,255,0.15);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.2);
  transition: background var(--t-normal);
  display: block;
}

.toggle-track.active { background: var(--red); border-color: var(--red); }

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--t-normal);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.toggle-track.active .toggle-thumb { transform: translateX(20px); }

/* ── MAIN INPUT AREA ── */
.codepad-input {
  margin-top: 8px;
}

#input-and-go { width: 100%; }

.input-and-button {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

/* Input wrapper */
.math-input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  background: #fff;
  border: 2.5px solid rgba(255,255,255,0.15);
  border-radius: var(--r-lg);
  padding: 0 12px 0 18px;
  min-height: 58px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
}

.math-input-wrapper:focus-within {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(219,63,89,0.15), 0 4px 24px rgba(0,0,0,0.18);
}

/* Input prefix (e.g. "simplify: ") */
.input-prefix {
  color: var(--red);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  font-family: 'Rubik', sans-serif;
}

/* Actual text input */
.math-main-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 18px;
  font-family: 'Roboto', 'Courier New', monospace;
  color: var(--text-900);
  font-weight: 400;
  min-width: 0;
  padding: 4px 0;
  caret-color: var(--red);
}

.math-main-input::placeholder {
  color: #b0b7c3;
  font-size: 15px;
  font-family: 'Rubik', sans-serif;
  font-weight: 400;
}

/* Input action icons */
.input-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.input-icon-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--r-md);
  color: #a0aec0;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}

.input-icon-btn svg { width: 17px; height: 17px; }

.input-icon-btn:hover {
  background: var(--red-light);
  color: var(--red);
}

/* Inline pad toggle (inside input bar) */
.pad-toggle-inline {
  width: 36px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(219,63,89,0.08);
  border: 1px solid rgba(219,63,89,0.2);
  border-radius: var(--r-md);
  color: var(--red);
  cursor: pointer;
  transition: background var(--t-fast);
}

.pad-toggle-inline svg { width: 18px; height: 18px; }
.pad-toggle-inline:hover { background: rgba(219,63,89,0.15); }

/* GO BUTTON */
.btn.btn-go {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--red);
  color: #fff;
  border: none;
  padding: 0 28px;
  min-height: 58px;
  border-radius: var(--r-lg);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(219,63,89,0.38);
  font-family: 'Rubik', sans-serif;
}

.btn.btn-go svg { width: 18px; height: 18px; }

.btn.btn-go:hover {
  background: var(--red-dark);
  box-shadow: 0 6px 20px rgba(219,63,89,0.50);
  transform: translateY(-1px);
}

.btn.btn-go:active { transform: translateY(0); }

/* ── SOLUTION PANEL ── */
.solution-panel {
  max-width: 800px;
  margin: 28px auto 0;
  background: #fff;
  border-radius: var(--r-xl);
  box-shadow: 0 8px 40px rgba(0,0,0,0.14);
  border: 1.5px solid rgba(219,63,89,0.2);
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

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

.solution-inner { padding: 28px 32px 24px; }

.solution-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.solution-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.solution-label svg { width: 16px; height: 16px; }

.solution-close {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: #64748b;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background var(--t-fast), color var(--t-fast);
}
.solution-close:hover { background: var(--red); color: #fff; }

.solution-problem {
  font-family: 'Roboto', monospace;
  font-size: 16px;
  color: var(--text-500);
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.solution-result {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-900);
  font-family: 'Roboto', monospace;
  margin-bottom: 20px;
  line-height: 1.4;
}

/* Steps */
.solution-steps { display: flex; flex-direction: column; gap: 0; }

.step-row {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid #f1f5f9;
  align-items: flex-start;
}
.step-row:last-child { border-bottom: none; }

.step-badge {
  width: 26px; height: 26px;
  background: var(--red);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.step-content { flex: 1; }

.step-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-700);
  margin-bottom: 4px;
}

.step-math {
  font-family: 'Roboto', monospace;
  font-size: 15px;
  color: var(--text-500);
  background: #f8faff;
  border: 1px solid #e8edf8;
  border-left: 3px solid var(--red);
  padding: 8px 14px;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  margin-top: 6px;
  line-height: 1.7;
}

/* Solution action buttons */
.solution-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.sol-action-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #f7f8fc;
  border: 1px solid var(--border);
  color: var(--text-500);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--r-full);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  font-family: 'Rubik', sans-serif;
}
.sol-action-btn svg { width: 14px; height: 14px; }
.sol-action-btn:hover {
  background: var(--red-light);
  color: var(--red);
  border-color: rgba(219,63,89,0.3);
}

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  #Codepad { padding: 36px 16px 52px; }
  .smc-title { font-size: 26px; }
  .smc-subtitle { font-size: 14px; margin-bottom: 24px; }

  .input-and-button { flex-direction: column; }
  .btn.btn-go { width: 100%; min-height: 50px; }
  .math-input-wrapper { min-height: 52px; padding: 0 10px 0 14px; }
  .math-main-input { font-size: 16px; }

  .padButton.new-pad-button { font-size: 12px; padding: 6px 13px; }

  .solution-inner { padding: 20px 18px 18px; }
  .solution-result { font-size: 20px; }
}
