@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700;900&display=swap');

:root {
  --bg: #04030a;
  --surface: #0d081c;
  --surface-strong: #110826;
  --panel-border: #2c0d56;
  --panel-border-soft: rgba(255, 255, 255, 0.08);
  --text-primary: #f7f7ff;
  --text-muted: rgba(247, 247, 255, 0.72);
  --accent: #d958ff;
  --accent-strong: #ad2df1;
  --gradient: linear-gradient(135deg, #a42cf7, #ff4db2);
  --button-bg: rgba(18, 7, 43, 0.75);
  --button-outline: rgba(255, 255, 255, 0.1);
  --panel-shadow: 0 20px 45px rgba(4, 2, 15, 0.65);
  --hero-glow: rgba(164, 44, 247, 0.35);
  --tooltip-bg: #f8f9ff;
  --tooltip-text: #04030a;
  font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  color: var(--text-primary);
  background-color: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 10% 10%, rgba(255, 78, 207, 0.35), transparent 35%),
    radial-gradient(circle at 80% 0%, rgba(164, 44, 247, 0.25), transparent 40%),
    var(--bg);
  color: var(--text-primary);
}

.row,
.grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.col {
  flex: 1 1 50%;
  min-width: 0;
}

.converters-row {
  flex-direction: column;
  gap: 1rem;
}

.converters-row .main-col {
  flex: 1 1 100%;
}

.main-col {
  flex: 0 0 64%;
}

.side-col {
  flex: 0 0 30%;
  align-self: flex-start;
}

.converters-panel,
.converter-result-panel {
  min-width: 0;
  margin-bottom: 1rem;
}

.converter-result-panel.is-hidden {
  display: none;
}

.page {
  min-height: 100vh;
  padding: 2rem 1rem 3rem;
    max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  color: var(--text-primary);
  background: linear-gradient(180deg, rgba(10, 4, 22, 0.8), rgba(6, 3, 16, 0.9)), var(--bg);
}

.hero.minimal {
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(164, 44, 247, 0.35), rgba(9, 7, 26, 0.95));
  border-radius: 20px;
  border: 1px solid var(--panel-border);
  box-shadow: var(--panel-shadow);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  isolation: isolate;
}

.hero.minimal::before {
  content: '';
  position: absolute;
  inset: -25%;
  background: radial-gradient(circle at 50% 0%, rgba(255, 78, 207, 0.35), transparent 55%);
  filter: blur(35px);
  opacity: 0.5;
  z-index: 0;
}

.hero.minimal::after {
  content: '';
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle at 0% 100%, rgba(164, 44, 247, 0.4), transparent 60%);
  opacity: 0.35;
  z-index: 0;
}

.hero-flex {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-branding {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  padding: 4px;
  background: rgba(7, 5, 26, 0.75);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-pill {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  color: transparent;
  text-shadow: 0 0 24px rgba(207, 67, 255, 0.5);
  font-family: 'Space Grotesk', 'JetBrains Mono', sans-serif;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}

.hero-subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.9;
}

.hero-spotlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
  position: relative;
  z-index: 1;
}

.hero-spotlight-grid article {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 25px rgba(4, 2, 15, 0.5);
  min-height: 96px;
}

.hero-spotlight-grid article h4 {
  margin: 0;
  font-size: 0.95rem;
  color: #fff;
}

.hero-spotlight-grid article p {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.65);
}

.spotlight-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
}

.spotlight-icon.glow {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent 60%);
  box-shadow: 0 0 18px rgba(255, 119, 191, 0.6);
  color: #ffd9ff;
}

.hero-meta {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.7rem;
  line-height: 1.1;
}

.hero-meta span {
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.pill-pill {
  background: var(--accent-strong);
  color: #fff;
  box-shadow: 0 0 25px rgba(217, 88, 255, 0.35);
  border-color: transparent;
}

.panel {
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid var(--panel-border);
  box-shadow: var(--panel-shadow);
  background: var(--surface);
}

.panel header h2 {
  margin: 0;
  font-size: 1.1rem;
  color: #fff;
}

.panel header p {
  margin: 0.2rem 0 0.6rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.panel form {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.field-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(247, 247, 255, 0.8);
}

.form-help-text {
  margin: 0;
  font-size: 0.75rem;
  color: rgba(247, 247, 255, 0.6);
}

.form-help-text.error {
  color: #ff9a9a;
}

.converter-controls {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

select,
textarea,
.file-input,
.settings-panel input {
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  background: rgba(12, 6, 25, 0.8);
  color: var(--text-primary);
  padding: 0.65rem 0.8rem;
  font-size: 0.9rem;
  font-family: inherit;
}

textarea {
  resize: none;
}

select:focus,
textarea:focus,
.settings-panel input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(217, 88, 255, 0.35);
}

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

.btn {
  padding: 0.65rem 1.15rem;
  border-radius: 8px;
  border: 1px solid var(--button-outline);
  background: var(--button-bg);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
  flex: 0 0 auto;
  min-width: 120px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.35);
}

.btn.primary {
  background: var(--gradient);
  border-color: transparent;
  box-shadow: 0 8px 25px rgba(209, 89, 255, 0.35);
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.result-row {
  display: flex;
  gap: 0.75rem;
  flex-direction: column;
}

.result-panel textarea {
  width: 100%;
  min-height: 170px;
  background: rgba(8, 5, 17, 0.95);
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  padding: 0.65rem 0.7rem;
  font-family: inherit;
  color: #f5f7ff;
}

#outputDisplay,
#converter-output-display {
  min-height: 170px;
  max-height: 500px;
  overflow: auto;
  background: rgba(8, 5, 17, 0.95);
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  padding: 0.65rem 0.7rem;
  font-family: 'JetBrains Mono', 'Fira Code', 'SFMono-Regular', Menlo, Consolas, monospace;
  color: #f5f7ff;
  white-space: pre-wrap;
  word-break: break-word;
  display: block;
  font-size: 0.82rem;
  line-height: 1.45;
}

#outputDisplay code,
#converter-output-display code {
  display: block;
  font-size: inherit;
  line-height: inherit;
  font-family: inherit;
  word-break: break-word;
  white-space: pre-wrap;
}

.result-panel .hljs {
  background: transparent;
  box-shadow: none;
}

.hljs {
  background: transparent !important;
}

.settings-panel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-panel.compact {
  gap: 0.3rem;
}

.settings-panel.full-width {
  width: 100%;
}

.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 0.45rem;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.settings-panel .checkbox-row {
  font-size: 0.75rem;
  color: rgba(247, 247, 255, 0.7);
}

.checkbox-row input {
  width: auto;
}

.flash {
  margin: 0.35rem 0 0;
  padding: 0.35rem 0.5rem;
  font-size: 0.78rem;
  border-radius: 5px;
  border: 1px solid transparent;
}

.flash.success {
  background: rgba(217, 88, 255, 0.15);
  border-color: rgba(217, 88, 255, 0.4);
  color: #e4ddff;
}

.flash.error {
  background: rgba(255, 148, 148, 0.2);
  border-color: rgba(255, 148, 148, 0.45);
  color: #ffc9c9;
}

.copy-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(9, 5, 21, 0.9);
  color: var(--text-primary);
  padding: 0.45rem 0.85rem;
  font-size: 0.75rem;
}

.clipboard-target {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.download-btn {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #0f7d1a;
  color: #fff;
  transition: background 0.2s ease, transform 0.2s ease;
}

.download-btn:hover {
  background: #16a31e;
}

.copy-tooltip {
  position: absolute;
  top: -1.6rem;
  right: 0;
  background: #050505;
  color: #fff;
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
  font-size: 0.68rem;
  white-space: nowrap;
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transform: translateY(2px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 2;
}

.copy-tooltip::after {
  content: '';
  position: absolute;
  bottom: -4px;
  right: 0.45rem;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid #050505;
}

.copy-tooltip.is-visible {
  opacity: 1;
  transform: translateY(-2px);
}

.tab-bar {
  display: flex;
  gap: 0.5rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.25rem;
  margin-bottom: 1rem;
}

.tab-button {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  cursor: pointer;
  transition: border 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.tab-button.is-active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
  border-style: solid;
  border-width: 1px;
}

.tab-panels {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tab-panel {
  display: none;
}

.tab-panel--active {
  display: block;
}

.panel-subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: rgba(247, 247, 255, 0.65);
}

.panel-actions {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.panel-actions.result-actions {
  margin-left: auto;
}

.conversion-description {
  margin: 0.35rem 0 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.info-panel.minimal {
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  color: rgba(247, 247, 255, 0.7);
  display: flex;
  justify-content: space-between;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--surface);
}

.site-footer {
  text-align: center;
  padding: 1rem 0;
  color: rgba(247, 247, 255, 0.6);
  font-size: 0.75rem;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.result-panel {
  transition: opacity 0.2s ease, transform 0.2s ease;
  padding: 1.25rem 1.5rem;
  background: var(--surface-strong);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--panel-shadow);
  margin-bottom: 1rem;
}

.result-panel.is-hidden {
  display: none;
}

.hidden {
  display: none;
}

.result-panel header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.converter-result-panel header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

@media (min-width: 900px) {
  .result-row {
    flex-direction: row;
  }
}

@media (max-width: 768px) {
  .hero-flex {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-meta {
    justify-content: flex-start;
    letter-spacing: 0.08em;
  }

  .row,
  .grid,
  .result-row {
    flex-direction: column;
  }

  .col,
  .main-col,
  .side-col {
    flex: 1 1 100%;
  }

  .hero.minimal {
    padding: 1.25rem;
  }

  .settings-panel {
    order: 1;
  }

  .info-panel.minimal {
    order: 2;
    justify-content: center;
  }

  .page {
    padding: 1.5rem 1rem 2rem;
  }
}
