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

:root {
  --bg: #050712;
  --glass-bg: rgba(10, 14, 35, 0.78);
  --glass-border: rgba(255, 255, 255, 0.08);
  --accent: #5ee5a8;
  --accent-soft: rgba(94, 229, 168, 0.18);
  --text-main: #f7f8ff;
  --text-muted: #9095b2;
  --danger: #ff6b81;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 999px;
  --shadow-soft: 0 24px 80px rgba(0, 0, 0, 0.55);
  --shadow-card: 0 18px 50px rgba(0, 0, 0, 0.50);
  --blur: 26px;
  --transition-fast: 160ms ease-out;
  --transition-med: 220ms ease-out;
}

html, body {
  height: 100%;
}

body {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #151836, #050712 52%);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

.app-root {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.background-gradient {
  position: fixed;
  inset: -20%;
  background:
    radial-gradient(circle at top left, rgba(94, 229, 168, 0.20), transparent 55%),
    radial-gradient(circle at bottom right, rgba(103, 140, 255, 0.18), transparent 55%);
  opacity: 0.88;
  z-index: -2;
}

.glass-shell {
  width: 100%;
  max-width: 1120px;
  margin: auto;
  border-radius: 32px;
  border: 1px solid var(--glass-border);
  background: linear-gradient(145deg, rgba(9, 12, 30, 0.96), rgba(8, 16, 37, 0.94));
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(var(--blur));
  display: flex;
  flex-direction: column;
  padding: 20px 22px 18px;
  animation: shellFadeIn 480ms ease-out forwards;
}

@keyframes shellFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 6px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 18px;
  background: radial-gradient(circle at 20% 0%, #5ee5a8, #2b9b71 68%, #0c3324);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.06em;
  color: #020309;
  box-shadow: 0 0 0 1px rgba(2, 3, 9, 0.5), 0 14px 40px rgba(0, 0, 0, 0.75);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-title {
  font-weight: 600;
  letter-spacing: 0.04em;
  font-size: 16px;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.privacy-chip {
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(94, 229, 168, 0.4);
  background: radial-gradient(circle at top left, rgba(94, 229, 168, 0.14), transparent 70%);
  color: #d9ffe9;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.app-main {
  padding: 14px 4px 8px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hero h1 {
  font-size: clamp(22px, 2.2vw, 26px);
  font-weight: 600;
  margin-bottom: 6px;
}

.hero p {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 540px;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 4px;
}

.tool-card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 14px 14px 16px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.02), rgba(5, 10, 25, 0.86));
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transform-origin: center;
  transition:
    transform var(--transition-med),
    box-shadow var(--transition-med),
    border-color var(--transition-med),
    background var(--transition-med),
    translate var(--transition-med);
  overflow: hidden;
}

.tool-card::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at top left, rgba(94, 229, 168, 0.14), transparent 60%);
  opacity: 0;
  transition: opacity var(--transition-med);
  pointer-events: none;
}

.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.8);
  border-color: rgba(94, 229, 168, 0.4);
}

.tool-card:hover::before {
  opacity: 1;
}

.tool-card:active {
  transform: translateY(-1px) scale(0.995);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.75);
}

.tool-header h2 {
  font-size: 15px;
  margin-bottom: 4px;
}

.tool-header p {
  font-size: 12px;
  color: var(--text-muted);
}

.tool-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.file-drop {
  position: relative;
  display: block;
}

.file-drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-drop-inner {
  border-radius: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.05), rgba(8, 12, 30, 0.92));
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition:
    border-color var(--transition-fast),
    background var(--transition-fast),
    transform var(--transition-fast);
}

.file-drop-icon {
  font-size: 18px;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.6));
}

.file-drop-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.file-drop-text strong {
  font-size: 13px;
}

.file-drop-text span {
  font-size: 11px;
  color: var(--text-muted);
}

.file-drop:hover .file-drop-inner {
  border-color: rgba(94, 229, 168, 0.75);
  background: radial-gradient(circle at top left, rgba(94, 229, 168, 0.16), rgba(8, 12, 30, 0.92));
  transform: translateY(-1px);
}

.file-drop:active .file-drop-inner {
  transform: translateY(0);
}

.primary-btn {
  border: none;
  outline: none;
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  align-self: flex-start;
  background: radial-gradient(circle at 0% 0%, #5ee5a8, #36b37a 52%, #0f5135);
  color: #02110a;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    filter var(--transition-fast),
    opacity var(--transition-fast);
}

.primary-btn:disabled {
  opacity: 0.45;
  cursor: default;
  box-shadow: none;
}

.primary-btn:not(:disabled):hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.9);
}

.primary-btn:not(:disabled):active {
  transform: translateY(0);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.85);
}

.hint {
  font-size: 11px;
  color: var(--text-muted);
}

.field-label {
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}

.field-caption {
  font-size: 11px;
  color: var(--text-muted);
}

.field-caption code {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 10px;
  background: rgba(0, 0, 0, 0.35);
  padding: 2px 5px;
  border-radius: 999px;
}

.text-input {
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(3, 6, 18, 0.8);
  color: var(--text-main);
  font-size: 13px;
  padding: 7px 11px;
  margin-top: 2px;
  outline: none;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast),
    transform var(--transition-fast);
}

.text-input:focus {
  border-color: rgba(94, 229, 168, 0.8);
  box-shadow: 0 0 0 1px rgba(94, 229, 168, 0.4);
  background: rgba(3, 6, 18, 0.94);
  transform: translateY(-0.5px);
}

.history {
  margin-top: 6px;
  padding: 12px 14px 10px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: linear-gradient(145deg, rgba(9, 12, 30, 0.98), rgba(9, 14, 33, 0.94));
}

.history-header h2 {
  font-size: 13px;
  margin-bottom: 4px;
}

.history-header p {
  font-size: 11px;
  color: var(--text-muted);
}

.history-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 180px;
  overflow: auto;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(8, 13, 30, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.history-op {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 10px;
  color: #defeea;
}

.history-time {
  color: var(--text-muted);
  font-size: 10px;
}

.app-footer {
  margin-top: 8px;
  padding: 4px 6px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 10px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.toast {
  position: fixed;
  bottom: 18px;
  right: 20px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(6, 206, 129, 0.96);
  color: #020807;
  font-size: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  pointer-events: none;
  transition:
    opacity var(--transition-med),
    transform var(--transition-med);
  z-index: 30;
}

.toast.error {
  background: rgba(255, 107, 129, 0.96);
  color: #1f0204;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.busy-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, rgba(5, 8, 20, 0.9), rgba(1, 3, 10, 0.96));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 25;
  backdrop-filter: blur(18px);
}

.busy-card {
  padding: 18px 22px;
  border-radius: 20px;
  background: rgba(4, 8, 20, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.busy-card p {
  font-size: 13px;
  color: var(--text-muted);
}

.spinner {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 2px solid rgba(94, 229, 168, 0.25);
  border-top-color: rgba(94, 229, 168, 0.95);
  animation: spin 720ms linear infinite;
}

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

@media (max-width: 960px) {
  .glass-shell {
    padding: 14px 14px 12px;
  }

  .tools-grid {
    grid-template-columns: 1fr;
  }

  .app-root {
    padding: 12px;
  }

  .toast {
    left: 16px;
    right: 16px;
    text-align: center;
  }
}
