/* ═══════════════════════════════════════════════════════════════════════════════
   BTC Profit Target Calculator - Neo-Brutalist Styles
   ═══════════════════════════════════════════════════════════════════════════════ */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800;900&display=swap");

/* ─── RESET & BASE ───────────────────────────────────────────────────────────── */

html {
  width: 100%;
  overflow-x: hidden;
}

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

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
  margin: 0 auto;
  padding: 40px 16px;
  background: #f0e6d3;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  width: 100%;
  overflow-x: hidden;
}

/* ─── LAYOUT ─────────────────────────────────────────────────────────────────── */

.container {
  background: #ffffff;
  border: 4px solid #000;
  border-radius: 0;
  padding: 40px;
  box-shadow: 8px 8px 0 #000;
  max-width: 600px;
  width: 100%;
  margin: 20px auto;
}

h1 {
  text-align: center;
  margin-bottom: 35px;
  color: #000;
  font-weight: 800;
  font-size: 28px;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ─── INPUTS ─────────────────────────────────────────────────────────────────── */

.input-group {
  margin-bottom: 25px;
}

label {
  font-weight: 700;
  display: block;
  margin-bottom: 8px;
  color: #000;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

input {
  width: 100%;
  padding: 14px 16px;
  margin-top: 6px;
  font-size: 16px;
  border: 3px solid #000;
  border-radius: 0;
  transition: all 0.15s ease;
  background: #fff;
  color: #000;
  font-weight: 600;
  box-shadow: 4px 4px 0 #000;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
}

input:focus {
  outline: none;
  background: #fff;
  box-shadow: 2px 2px 0 #000;
  transform: translate(2px, 2px);
}

input:focus-visible {
  outline: 3px solid #3b82f6;
  outline-offset: 2px;
}

input::placeholder {
  color: #666;
  opacity: 1;
  font-weight: 400;
}

.help-text {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: #000;
  font-weight: 600;
  background: #fef08a;
  padding: 6px 10px;
  border: 2px solid #000;
}

.or-divider {
  text-align: center;
  color: #000;
  font-weight: 700;
  margin: 20px 0;
  position: relative;
  font-size: 14px;
  text-transform: uppercase;
  background: #a5f3fc;
  padding: 8px;
  border: 3px solid #000;
}

.or-divider::before,
.or-divider::after {
  display: none;
}

/* ─── BUTTONS ────────────────────────────────────────────────────────────────── */

button {
  width: 100%;
  margin-top: 30px;
  padding: 16px;
  font-size: 18px;
  font-weight: 700;
  background: #fef08a;
  color: #000;
  border: 4px solid #000;
  cursor: pointer;
  border-radius: 0;
  transition: all 0.15s ease;
  box-shadow: 6px 6px 0 #000;
  text-transform: uppercase;
  letter-spacing: 1px;
  will-change: transform;
  -webkit-tap-highlight-color: transparent;
}

button:hover {
  transform: translate(3px, 3px);
  box-shadow: 3px 3px 0 #000;
}

button:active {
  transform: translate(5px, 5px);
  box-shadow: 1px 1px 0 #000;
}

button:focus-visible {
  outline: 3px solid #3b82f6;
  outline-offset: 2px;
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 3px solid #000;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-left: 8px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ─── RESULT ─────────────────────────────────────────────────────────────────── */

.result {
  margin-top: 35px;
  padding: 25px;
  background: #d1fae5;
  border: 4px solid #000;
  border-radius: 0;
  font-size: 16px;
  line-height: 1.7;
  box-shadow: 6px 6px 0 #000;
  animation: popIn 0.3s ease;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.highlight {
  font-size: 24px;
  font-weight: 800;
  color: #000;
  margin-bottom: 20px;
  display: block;
  text-align: center;
  padding: 15px;
  background: #fca5a5;
  border: 4px solid #000;
  border-radius: 0;
  box-shadow: 4px 4px 0 #000;
  text-transform: uppercase;
}

.result b {
  color: #000;
  font-weight: 700;
}

.result br {
  margin-bottom: 8px;
  display: block;
}

.error-output {
  margin-top: 20px;
  padding: 15px;
  background: #fca5a5;
  border: 4px solid #000;
  color: #000;
  font-weight: 700;
}

.footer {
  margin-top: 20px;
  text-align: center;
  font-size: 12px;
  color: #666;
  font-weight: 400;
  padding: 10px;
}

/* ─── LIVE PRICE SECTION ─────────────────────────────────────────────────────── */

.live-price-section {
  background: #e0e7ff;
  border: 3px solid #000;
  box-shadow: 4px 4px 0 #000;
  padding: 16px;
  margin-bottom: 25px;
  border-radius: 0;
}

.live-price-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.live-indicator {
  width: 10px;
  height: 10px;
  background: #22c55e;
  border: 2px solid #000;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

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

.live-label {
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.refresh-btn {
  margin-left: auto;
  background: #fef08a;
  border: 2px solid #000;
  padding: 3px 7px;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
  box-shadow: 1px 1px 0 #000;
  transition: all 0.15s ease;
  width: auto;
  margin-top: 0;
}

.refresh-btn:hover {
  transform: translate(1px, 1px);
  box-shadow: 0px 0px 0 #000;
}

.live-price-value {
  font-size: 28px;
  font-weight: 800;
  color: #000;
  margin: 8px 0;
}

.last-updated {
  font-size: 11px;
  color: #666;
  font-weight: 600;
}

/* ─── PRICE ERROR ─────────────────────────────────────────────────────────────── */

.price-error {
  background: #fca5a5;
  border: 3px solid #000;
  box-shadow: 4px 4px 0 #000;
  padding: 12px;
  margin-bottom: 25px;
  display: none;
  align-items: center;
  gap: 8px;
  border-radius: 0;
}

.price-error .retry-btn {
  margin-left: auto;
  background: #fef08a;
  border: 2px solid #000;
  padding: 6px 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
  box-shadow: 2px 2px 0 #000;
}

/* ─── PRICE COMPARISON ────────────────────────────────────────────────────────── */

.price-comparison {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 3px dashed #000;
}

.comparison-header {
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 15px;
  text-align: center;
  background: #a5f3fc;
  padding: 8px;
  border: 2px solid #000;
}

.comparison-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comparison-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #fff;
  border: 2px solid #000;
}

.comparison-label {
  font-weight: 600;
  font-size: 13px;
}

.comparison-value {
  font-weight: 800;
  font-size: 14px;
}

.highlight-row {
  background: #d1fae5;
}

.highlight-row.warning {
  background: #fca5a5;
}

.comparison-indicator {
  margin-top: 15px;
  padding: 12px;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  border: 3px solid #000;
  box-shadow: 4px 4px 0 #000;
}

.comparison-indicator.success {
  background: #d1fae5;
}

.comparison-indicator.warning {
  background: #fca5a5;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   THEMES
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ─── THEME PICKER BUTTONS ───────────────────────────────────────────────────── */

.theme-picker {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

.theme-btn {
  width: auto;
  margin-top: 0;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  border: 3px solid #000;
  cursor: pointer;
  border-radius: 0;
  transition: all 0.15s ease;
  box-shadow: 4px 4px 0 #000;
  text-transform: uppercase;
  letter-spacing: 1px;
  will-change: transform;
  -webkit-tap-highlight-color: transparent;
  background: #fff;
  color: #000;
}

.theme-btn:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #000;
}

.theme-btn:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 #000;
}

.theme-btn:focus-visible {
  outline: 3px solid #3b82f6;
  outline-offset: 2px;
}

.theme-btn.active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 #000;
}

.theme-btn-default { background: #f0e6d3; }
.theme-btn-dark    { background: #1a1a1a; color: #ccff00; }
.theme-btn-pink   { background: #f48fb1; }
.theme-btn-terminal { background: #0a0a0a; color: #00ff00; border-color: #00ff00; }

/* ─── THEME TOGGLE STYLES ─────────────────────────────────────────────────────── */

.theme-toggle-wrapper {
  margin-bottom: 15px;
  text-align: center;
}

.theme-toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: #fef08a;
  color: #000;
  border: 3px solid #000;
  cursor: pointer;
  border-radius: 0;
  transition: all 0.15s ease;
  box-shadow: 4px 4px 0 #000;
  -webkit-tap-highlight-color: transparent;
}

.theme-toggle-btn:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #000;
}

.theme-toggle-btn:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 #000;
}

.theme-toggle-btn:focus-visible {
  outline: 3px solid #3b82f6;
  outline-offset: 2px;
}

.theme-toggle-icon {
  font-size: 16px;
  transition: transform 0.2s ease;
}

.theme-toggle-icon.open {
  transform: rotate(180deg);
}

.theme-picker-panel {
  visibility: hidden;
  margin-bottom: 0;
  padding: 0;
  background: #ffffff;
  border: 4px solid #000;
  box-shadow: 8px 8px 0 #000;
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease, padding 0.25s ease, margin 0.25s ease;
}

.theme-picker-panel.open {
  visibility: visible;
  margin-bottom: 15px;
  padding: 20px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.theme-picker-panel.closing {
  animation: slideToTop 0.25s ease forwards;
}

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

.theme-picker-panel.closing:hover {
  pointer-events: none;
}

/* ─── THEME SWATCH GRID ───────────────────────────────────────────────────────── */

.theme-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.theme-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px;
  background: #ffffff;
  border: 3px solid #000;
  cursor: pointer;
  border-radius: 0;
  transition: all 0.15s ease;
  box-shadow: 4px 4px 0 #000;
  -webkit-tap-highlight-color: transparent;
}

.theme-swatch:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #000;
}

.theme-swatch:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 #000;
}

.theme-swatch:focus-visible {
  outline: 3px solid #3b82f6;
  outline-offset: 2px;
}

.theme-swatch.active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 #000;
}

.swatch-colors {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
}

.swatch-color {
  width: 18px;
  height: 18px;
  border: 2px solid #000;
}

.swatch-name {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #000;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ═══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
  .container {
    padding: 25px 20px;
    box-shadow: 6px 6px 0 #000;
    margin: 12px auto;
  }

  h1 {
    font-size: 22px;
    margin-bottom: 25px;
  }

  .highlight {
    font-size: 18px;
    padding: 12px;
  }

  button {
    box-shadow: 4px 4px 0 #000;
  }

  button:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #000;
  }

  .theme-picker-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  body {
    padding: 20px 12px;
  }

  .container {
    padding: 16px 14px;
    margin: 8px auto;
  }

  h1 {
    font-size: 18px;
  }

  label {
    font-size: 12px;
  }

  input {
    padding: 12px;
    box-shadow: 3px 3px 0 #000;
  }

  input:focus {
    box-shadow: 1px 1px 0 #000;
    transform: translate(2px, 2px);
  }

  button {
    padding: 14px;
    box-shadow: 3px 3px 0 #000;
  }

  button:hover {
    transform: translate(1px, 1px);
    box-shadow: 2px 2px 0 #000;
  }

  .highlight {
    font-size: 16px;
    padding: 10px;
    box-shadow: 3px 3px 0 #000;
  }

  .result {
    box-shadow: 3px 3px 0 #000;
  }

  .theme-picker-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .theme-swatch {
    padding: 6px;
  }

  .swatch-color {
    width: 14px;
    height: 14px;
  }

  .swatch-name {
    font-size: 9px;
  }
}

@media (max-width: 360px) {
  body {
    padding: 16px 8px;
  }

  .container {
    padding: 14px 12px;
    margin: 4px auto;
    box-shadow: 4px 4px 0 #000;
  }

  h1 {
    font-size: 16px;
    margin-bottom: 20px;
  }

  label {
    font-size: 11px;
  }

  input {
    padding: 10px;
    font-size: 16px;
  }

  button {
    padding: 12px;
    font-size: 16px;
  }

  .highlight {
    font-size: 14px;
  }

  .theme-picker-grid {
    gap: 8px;
  }
}
