/* Root colours and glow style */
:root {
  --bg-main: #020617;
  --bg-card: rgba(15, 23, 42, 0.98);
  --accent: #38bdf8;
  --accent-soft: #22c55e;
  --accent-alt: #a855f7;
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --border-soft: rgba(148, 163, 184, 0.4);
  --shadow-glow: 0 0 25px rgba(56, 189, 248, 0.45);
}

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

html,
body {
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.25), transparent 55%),
    radial-gradient(circle at bottom right, rgba(168, 85, 247, 0.28), transparent 50%),
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.2), transparent 55%),
    #020617;
  color: var(--text-main);
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 24px;
}

/* Main layout */
.app-wrapper {
  max-width: 1100px;
  width: 100%;
  min-height: 90vh;
  border-radius: 24px;
  padding: 24px 26px 20px;
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.9), #020617);
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.6),
    0 18px 60px rgba(15, 23, 42, 0.9),
    0 0 90px rgba(56, 189, 248, 0.35);
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: relative;
  overflow: hidden;
}

/* Soft gradient glow accents */
.app-wrapper::before,
.app-wrapper::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(40px);
  opacity: 0.35;
  pointer-events: none;
}

.app-wrapper::before {
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.9), transparent 60%);
  top: -80px;
  right: -40px;
}

.app-wrapper::after {
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.9), transparent 65%);
  bottom: -90px;
  left: -60px;
}

/* Header */
.app-header {
  position: relative;
  z-index: 2;
}

.app-header h1 {
  font-size: 1.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
  background: linear-gradient(120deg, #e5e7eb, #a5f3fc, #bfdbfe);
  -webkit-background-clip: text;
  color: transparent;
}

.app-header p {
  font-size: 0.98rem;
  color: var(--text-muted);
}

/* Main content grid */
.app-main {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 20px;
}

.panel {
  background: linear-gradient(
      135deg,
      rgba(15, 23, 42, 0.96),
      rgba(15, 23, 42, 0.88)
    );
  border-radius: 20px;
  padding: 18px 18px 16px;
  border: 1px solid var(--border-soft);
  box-shadow:
    0 12px 45px rgba(15, 23, 42, 0.9),
    0 0 32px rgba(15, 23, 42, 0.9);
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: radial-gradient(
    circle at top left,
    rgba(56, 189, 248, 0.33),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.panel:hover::before {
  opacity: 1;
}

/* Input panel */
.field-label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--accent-soft);
  margin-bottom: 8px;
}

#inputText {
  width: 100%;
  min-height: 190px;
  resize: vertical;
  border-radius: 14px;
  border: 1px solid rgba(51, 65, 85, 0.9);
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.9), #020617);
  color: var(--text-main);
  padding: 12px 13px;
  font-size: 0.98rem;
  line-height: 1.6;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.85);
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease;
}

#inputText:focus {
  border-color: rgba(56, 189, 248, 0.9);
  box-shadow:
    inset 0 0 0 1px rgba(56, 189, 248, 0.5),
    0 0 32px rgba(56, 189, 248, 0.65);
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.96), #020617);
}

/* Options panel */
.options-panel h2 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.case-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.case-options label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  padding: 7px 9px;
  border-radius: 999px;
  border: 1px solid rgba(75, 85, 99, 0.9);
  background: radial-gradient(circle at top, rgba(17, 24, 39, 0.9), #020617);
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.12s ease;
}

.case-options label:hover {
  border-color: rgba(56, 189, 248, 0.75);
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.96), #020617);
  transform: translateY(-1px);
}

.case-options input[type="radio"] {
  accent-color: var(--accent);
}

/* Buttons */
#convertBtn {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.8);
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.6), rgba(14, 116, 144, 0.95));
  color: #0b1220;
  cursor: pointer;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.9),
    0 0 35px rgba(56, 189, 248, 0.7),
    0 18px 40px rgba(15, 23, 42, 0.9);
  transition:
    transform 0.13s ease,
    box-shadow 0.18s ease,
    background 0.2s ease;
}

#convertBtn:hover {
  transform: translateY(-1px) scale(1.01);
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.8), rgba(8, 47, 73, 0.98));
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.9),
    0 0 48px rgba(56, 189, 248, 0.9),
    0 24px 55px rgba(15, 23, 42, 0.95);
}

#convertBtn:active {
  transform: translateY(0) scale(0.99);
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.9),
    0 0 20px rgba(56, 189, 248, 0.6),
    0 12px 30px rgba(15, 23, 42, 0.95);
}

.ghost-btn {
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.98), #020617);
  color: var(--text-muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    color 0.18s ease,
    background 0.18s ease,
    transform 0.12s ease;
}

.ghost-btn:hover {
  border-color: rgba(56, 189, 248, 0.8);
  color: var(--accent);
  transform: translateY(-1px);
}

/* Output section */
.output-wrapper {
  margin-top: 16px;
}

.output-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

#outputText {
  flex: 1;
  border-radius: 999px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  padding: 8px 11px;
  background: radial-gradient(circle at top, rgba(17, 24, 39, 0.96), #020617);
  color: var(--accent);
  font-family: "JetBrains Mono", ui-monospace, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 0.92rem;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.9);
  transition:
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    background 0.22s ease;
}

#outputText.has-value {
  border-color: rgba(56, 189, 248, 0.9);
  box-shadow:
    inset 0 0 0 1px rgba(56, 189, 248, 0.5),
    0 0 25px rgba(56, 189, 248, 0.6);
}

.hint {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Toast notification */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(140%);
  padding: 9px 14px;
  border-radius: 999px;
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.98), #020617);
  border: 1px solid rgba(56, 189, 248, 0.8);
  color: var(--text-main);
  font-size: 0.83rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.9),
    0 0 40px rgba(56, 189, 248, 0.75),
    0 20px 40px rgba(15, 23, 42, 0.95);
  z-index: 50;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.hidden {
  opacity: 0;
}

.toast span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.toast span::before {
  content: "✔";
  font-size: 0.82rem;
  color: var(--accent-soft);
}

/* Footer */
.app-footer {
  position: relative;
  z-index: 2;
  margin-top: auto;
  padding-top: 4px;
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Responsive tweaks */
@media (max-width: 900px) {
  .app-main {
    grid-template-columns: minmax(0, 1fr);
  }

  body {
    padding: 12px;
  }

  .app-wrapper {
    padding: 18px 16px 16px;
  }
}

@media (max-width: 600px) {
  #inputText {
    min-height: 150px;
  }

  .output-row {
    flex-direction: column;
  }

  #convertBtn {
    width: 100%;
    justify-content: center;
  }

  .ghost-btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}
