/* ============================= */
/*        Root & Theme           */
/* ============================= */
:root {
  --bg-gradient: linear-gradient(135deg, #0f172a, #1e293b, #020617);
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.18);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent: linear-gradient(90deg, #38bdf8, #818cf8, #c084fc);
  --accent-solid: #818cf8;
  --shadow: 0 25px 50px rgba(0, 0, 0, 0.45);
}

/* ============================= */
/*        Global Reset           */
/* ============================= */
* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

/* ============================= */
/*        Body & Layout          */
/* ============================= */
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-gradient);
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto;
  color: var(--text-main);
  padding: 24px;
}

/* ============================= */
/*        Header Text            */
/* ============================= */
h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  text-align: center;
}

.muted {
  color: var(--text-muted);
  font-size: 0.95rem;
  text-align: center;
}

/* ============================= */
/*        Card (Glass UI)        */
/* ============================= */
.card {
  width: 100%;
  max-width: 520px;
  background: var(--glass-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-top: 18px;
  animation: fadeIn 0.6s ease-out;
}

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

/* ============================= */
/*        File Upload Box        */
/* ============================= */
.file-label {
  display: block;
}

.file-label input[type="file"] {
  display: none;
}

.file-drop {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px;
  border-radius: 16px;
  border: 1.5px dashed rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.25s ease;
}

.file-drop:hover {
  border-color: #c084fc;
  box-shadow: 0 0 0 3px rgba(192, 132, 252, 0.2);
  transform: translateY(-2px);
}

.file-drop svg {
  color: #c084fc;
}

.file-drop strong {
  font-size: 1rem;
}

/* ============================= */
/*        Actions / Button       */
/* ============================= */
.actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
}

button {
  flex: 1;
  padding: 12px 18px;
  border-radius: 14px;
  border: none;
  background: var(--accent);
  color: #020617;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(129, 140, 248, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(129, 140, 248, 0.45);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ============================= */
/*        Spinner                */
/* ============================= */
.spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #c084fc;
  animation: spin 0.9s linear infinite;
}

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

.hidden {
  display: none;
}

/* ============================= */
/*        Results Section        */
/* ============================= */
#result h3 {
  margin-top: 8px;
  font-size: 1.2rem;
  font-weight: 600;
}

.row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.col {
  flex: 1;
  min-width: 220px;
}

p {
  margin: 6px 0;
  font-size: 0.9rem;
}

img {
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ============================= */
/*        Code / JSON View       */
/* ============================= */
pre {
  background: #020617;
  color: #e5e7eb;
  padding: 14px;
  border-radius: 12px;
  font-size: 0.85rem;
  overflow-x: auto;
}

/* ============================= */
/*        Links                  */
/* ============================= */
a {
  color: #c084fc;
  font-weight: 600;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ============================= */
/*        Responsive             */
/* ============================= */
@media (max-width: 640px) {
  h1 {
    font-size: 1.6rem;
  }

  .row {
    flex-direction: column;
  }

  .card {
    padding: 20px;
  }
}
