:root {
  --bg-color: #050816;
  --bg-elevated: #0f172a;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.12);
  --accent-strong: #1d4ed8;
  --danger: #ef4444;
  --warning: #f59e0b;
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --border-subtle: #1f2933;
  --radius-lg: 16px;
  --radius-md: 10px;
  --shadow-soft: 0 18px 30px rgba(15, 23, 42, 0.7);
  --shadow-card: 0 12px 20px rgba(15, 23, 42, 0.7);
  --transition-fast: 0.18s ease-out;
  --transition-med: 0.25s ease-out;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  color: var(--text-main);
  background: radial-gradient(circle at top, #0f172a 0, #020617 55%, #000 100%);
  min-height: 100%;
}

/* Navbar */

.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 5vw;
  background: rgba(2, 6, 23, 0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.navbar-brand a {
  color: #f9fafb;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.06em;
  text-decoration: none;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.95rem;
}

.navbar-links a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  transition: background var(--transition-fast), color var(--transition-fast),
    transform var(--transition-fast);
}

.navbar-links a:hover {
  background: rgba(148, 163, 184, 0.15);
  color: #e5e7eb;
  transform: translateY(-1px);
}

.navbar-links a.active {
  background: var(--accent-soft);
  color: #eff6ff;
}

/* Buttons */

.btn {
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  border: none;
  outline: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: transform var(--transition-fast),
    box-shadow var(--transition-fast), background var(--transition-fast),
    color var(--transition-fast), border-color var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #f9fafb;
  box-shadow: 0 16px 35px rgba(37, 99, 235, 0.45);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 45px rgba(37, 99, 235, 0.6);
}

.btn-secondary {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(30, 64, 175, 0.55);
  border-color: rgba(129, 140, 248, 0.8);
}

.btn-outline {
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: transparent;
  color: var(--text-main) !important;
}

.btn-outline:hover {
  background: rgba(51, 65, 85, 0.8);
  border-color: rgba(148, 163, 184, 0.9);
}

.btn-danger {
  background: var(--danger);
  color: #fee2e2;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-warning {
  background: var(--warning);
  color: #111827;
}

.btn-warning:hover {
  background: #d97706;
}

.btn.full-width {
  width: 100%;
}

/* Hero */

.hero {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.2fr);
  padding: 3.2rem 8vw 3.5rem;
  align-items: flex-start;
}

.hero-content h1 {
  font-size: clamp(2.4rem, 3.2vw, 3.1rem);
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
}

.hero-content p {
  color: var(--text-muted);
  max-width: 32rem;
  line-height: 1.6;
}

.hero-note {
  margin-top: 1.2rem;
  font-size: 0.9rem;
  color: #9ca3af;
}

/* Ad sections */

.ad-section {
  margin-top: 1.8rem;
}

.ad-section-inline {
  margin-top: 1.4rem;
}

.ad-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #6b7280;
  margin-bottom: 0.35rem;
}

.ad-banner {
  background: rgba(15, 23, 42, 0.9);
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(148, 163, 184, 0.5);
  padding: 0.9rem 1rem;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-banner.small {
  min-height: 50px;
}

.ad-placeholder-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Tool card / upload UI */

.hero-card-grid {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: 1fr;
}

.tool-card {
  background: radial-gradient(circle at top left, #1f2937 0, #020617 60%);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.5rem 1.4rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-med), box-shadow var(--transition-med),
    border-color var(--transition-med);
}

.tool-card:hover {
  transform: translateY(-2px);
  border-color: rgba(129, 140, 248, 0.75);
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.9);
}

.tool-card h2 {
  margin: 0 0 0.3rem;
  font-size: 1.3rem;
}

.tool-subtitle {
  margin: 0;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.tool-section {
  margin-bottom: 0.9rem;
}

.tool-label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
  color: #d1d5db;
}

.tool-select {
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  padding: 0.5rem 0.85rem;
  font-size: 0.9rem;
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
  outline: none;
  appearance: none;
}

.tool-select:focus {
  border-color: rgba(129, 140, 248, 0.9);
  box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.75);
}

/* Drag & drop */

.drop-zone {
  margin-top: 0.4rem;
  border-radius: var(--radius-lg);
  border: 1.5px dashed rgba(148, 163, 184, 0.7);
  background: rgba(15, 23, 42, 0.9);
  padding: 1.1rem 1.1rem 0.9rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition-fast),
    background var(--transition-fast), transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.drop-zone-title {
  margin: 0;
  font-size: 0.95rem;
}

.drop-zone-subtitle {
  margin: 0.15rem 0 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.drop-zone-input {
  display: none;
}

.selected-file-name {
  margin: 0.3rem 0 0.1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  word-break: break-all;
}

.drop-zone.drag-over {
  border-color: rgba(96, 165, 250, 1);
  background: rgba(15, 23, 42, 1);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.4);
}

.tool-start-btn {
  margin-top: 0.9rem;
}

/* Progress */

.progress-wrapper {
  margin-top: 1rem;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.progress-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 1);
  border: 1px solid rgba(31, 41, 55, 0.9);
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  transition: width 0.2s ease-out;
}

.conversion-status-text {
  margin: 0.45rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Download */

.download-section {
  margin-top: 1rem;
}

.hidden {
  display: none;
}

/* Generic page layout */

.page-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 3rem 5vw 3.5rem;
}

.page-header h1 {
  margin: 0 0 0.5rem;
  font-size: 2rem;
}

.page-header p {
  margin: 0;
  color: var(--text-muted);
}

/* Content sections */

.content-section {
  margin-top: 2rem;
  background: rgba(15, 23, 42, 0.9);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 1.5rem 1.5rem 1.3rem;
  box-shadow: var(--shadow-card);
}

.content-section h2 {
  margin-top: 0;
  font-size: 1.25rem;
  margin-bottom: 0.4rem;
}

.content-section p {
  color: var(--text-muted);
  line-height: 1.7;
}

.feature-list {
  margin: 0.6rem 0 0;
  padding-left: 1.3rem;
  color: var(--text-muted);
}

.feature-list li {
  margin-bottom: 0.35rem;
}

/* Auth */

.auth-wrapper {
  min-height: calc(60vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 5vw 1rem;
}

.auth-card {
  background: linear-gradient(145deg, #020617 0, #111827 60%, #020617 100%);
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 2rem;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-soft);
}

.auth-card h1 {
  margin: 0 0 0.4rem;
  font-size: 1.6rem;
}

.auth-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.auth-form {
  margin-top: 1.4rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 1rem;
}

.form-group label {
  font-size: 0.85rem;
  color: #d1d5db;
}

.form-group input {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  padding: 0.55rem 0.9rem;
  font-size: 0.9rem;
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
  outline: none;
  transition: border-color var(--transition-fast),
    box-shadow var(--transition-fast), background var(--transition-fast);
}

.form-group input:focus {
  border-color: rgba(129, 140, 248, 0.9);
  box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.75);
  background: rgba(15, 23, 42, 1);
}

.form-error {
  margin-top: 0.7rem;
  font-size: 0.85rem;
  color: #fecaca;
  min-height: 1.1rem;
}

.form-info {
  margin-top: 0.7rem;
  font-size: 0.85rem;
  color: #a5b4fc;
  min-height: 1.1rem;
}

.auth-hint {
  margin-top: 1.1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Status dashboard */

.status-controls {
  margin-top: 1.8rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.status-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.status-grid {
  margin-top: 1.6rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.1rem;
}

.status-card {
  background: rgba(15, 23, 42, 0.92);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.3);
  padding: 1.1rem 1.2rem 1rem;
  box-shadow: var(--shadow-card);
}

.status-card.wide {
  grid-column: span 2;
}

.status-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.status-metric {
  margin: 0.2rem 0 0;
  font-weight: 600;
  font-size: 1.05rem;
  color: #e5e7eb;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.status-pill-unknown {
  background: rgba(148, 163, 184, 0.2);
  color: #e5e7eb;
}

.status-pill-ok {
  background: rgba(34, 197, 94, 0.18);
  color: #bbf7d0;
}

.status-pill-warn {
  background: rgba(234, 179, 8, 0.18);
  color: #fef9c3;
}

.status-pill-down {
  background: rgba(248, 113, 113, 0.2);
  color: #fee2e2;
}

.status-actions {
  margin-top: 2.2rem;
  background: rgba(15, 23, 42, 0.9);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.32);
  padding: 1.5rem 1.5rem 1.3rem;
}

.status-actions h2 {
  margin-top: 0;
  font-size: 1.25rem;
}

.status-note {
  margin-top: 0.3rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.status-action-buttons {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

/* Footer */

.footer {
  padding: 1.2rem 5vw 1.4rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(15, 23, 42, 0.9);
  background: radial-gradient(circle at top, #020617 0, #000 100%);
}

/* Responsive */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    padding: 2.5rem 6vw 3rem;
  }

  .hero-card-grid {
    order: 2;
  }
}

@media (max-width: 720px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .navbar-links {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .auth-card {
    padding: 1.5rem 1.4rem;
  }

  .page-container {
    padding: 2.5rem 4vw 3rem;
  }
}

/* Layout for main area */
.main-layout {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.tool-shell {
  margin-bottom: 1.5rem;
}

.page-title {
  font-size: 1.8rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.25rem;
}

.page-subtitle {
  text-align: center;
  color: #555;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.tool-workspace {
  margin-top: 1.75rem;
}

/* generic hidden class (also used by download section) */
.hidden {
  display: none !important;
}

/* === Tool tiles redesigned like big cards === */

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
}

.tool-card {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 1.1rem 1.25rem;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #eeeeee;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  position: relative;
}

.tool-card:hover {
  border-color: #0a84ff;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  transform: translateY(-3px);
}

.tool-card-inner {
  flex: 1;
  min-width: 0;
}

.tool-tile-title {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.1rem;
}

.tool-tile-sub {
  display: block;
  font-size: 0.85rem;
  color: #555555;
}

.tool-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.tool-icon svg {
  width: 22px;
  height: 22px;
  fill: #ffffff;
}

.tool-arrow {
  margin-left: auto;
  font-size: 1.4rem;
  line-height: 1;
  color: #888888;
  font-weight: 500;
}

.tool-card:hover .tool-arrow {
  color: #0a84ff;
}

/* Icon background colors */
.bg-blue { background: #1976d2; }
.bg-purple { background: #673ab7; }
.bg-yellow { background: #fbc02d; }
.bg-teal { background: #009688; }
.bg-pink { background: #ec407a; }
.bg-red { background: #e53935; }
.bg-green { background: #2e7d32; }
.bg-orange { background: #fb8c00; }

/* Hide dropdown + label visually; still used by JS */
.tool-section-dropdown .tool-select,
.tool-section-dropdown .tool-label {
  display: none;
}
