/*
 * Tools Wale 2.0 design layer
 * A single product skin for the existing PHP tools.
 */
:root {
  --tw2-bg: #f6f8fb;
  --tw2-surface: #ffffff;
  --tw2-surface-soft: #f8fafc;
  --tw2-border: #dbe4f0;
  --tw2-border-strong: #b8c5d6;
  --tw2-text: #102033;
  --tw2-muted: #617086;
  --tw2-primary: #2563eb;
  --tw2-primary-dark: #1d4ed8;
  --tw2-primary-soft: #eaf1ff;
  --tw2-success: #059669;
  --tw2-danger: #dc2626;
  --tw2-warning: #d97706;
  --tw2-radius: 12px;
  --tw2-radius-sm: 8px;
  --tw2-shadow: 0 14px 38px rgba(15, 23, 42, 0.08);
  --tw2-shadow-soft: 0 8px 22px rgba(15, 23, 42, 0.06);
  --tw2-ring: 0 0 0 4px rgba(37, 99, 235, 0.16);
}

html {
  background: var(--tw2-bg);
}

body {
  color: var(--tw2-text);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 30rem),
    linear-gradient(180deg, #ffffff 0%, var(--tw2-bg) 26rem);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.45), transparent 45rem);
}

#main-header {
  border-color: rgba(219, 228, 240, 0.9) !important;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.header-sticky {
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: rgba(219, 228, 240, 0.9) !important;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08) !important;
}

main,
section,
.min-h-screen {
  letter-spacing: 0;
}

.tw2-tool-bar {
  max-width: 80rem;
  margin: 1rem auto 1.5rem;
  padding: 0 1rem;
}

.tw2-tool-bar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid var(--tw2-border);
  border-radius: var(--tw2-radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--tw2-shadow-soft);
  padding: 0.75rem 0.9rem;
}

.tw2-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tw2-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--tw2-border);
  background: var(--tw2-surface-soft);
  color: var(--tw2-muted);
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.tw2-badge.is-primary {
  background: var(--tw2-primary-soft);
  border-color: rgba(37, 99, 235, 0.22);
  color: var(--tw2-primary-dark);
}

.tw2-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--tw2-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.tw2-status-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: var(--tw2-success);
  box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.12);
}

.tw2-dark-tool .tw2-tool-bar-inner {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.18);
}

.tw2-dark-tool .tw2-badge {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.78);
}

.tw2-dark-tool .tw2-badge.is-primary {
  background: rgba(37, 99, 235, 0.2);
  border-color: rgba(96, 165, 250, 0.32);
  color: #bfdbfe;
}

.tw2-dark-tool .tw2-status {
  color: rgba(255, 255, 255, 0.76);
}

.tw2-dark-tool .tw2-health-panel-inner {
  background: rgba(120, 53, 15, 0.35);
  border-color: rgba(251, 191, 36, 0.24);
  color: #fde68a;
}

input,
select,
textarea {
  border-color: var(--tw2-border) !important;
  border-radius: var(--tw2-radius-sm) !important;
}

input:focus,
select:focus,
textarea:focus {
  outline: none !important;
  border-color: var(--tw2-primary) !important;
  box-shadow: var(--tw2-ring) !important;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:disabled,
button[disabled] {
  cursor: not-allowed !important;
  opacity: 0.55;
  box-shadow: none !important;
}

[id*="upload-zone"]:hover,
[id*="dropzone"]:hover,
#dropzone:hover,
#upload-zone:hover,
.tw2-drag-over {
  border-color: var(--tw2-primary) !important;
}

#progress-bar,
[id*="progress-bar"],
.progress-bar {
  background: linear-gradient(90deg, var(--tw2-primary), #0f766e) !important;
}

#result-section,
[id*="result-section"] {
  border-color: rgba(5, 150, 105, 0.22) !important;
  background: linear-gradient(180deg, rgba(236, 253, 245, 0.94), rgba(255, 255, 255, 0.94)) !important;
}

.tool-card {
  border-radius: var(--tw2-radius) !important;
  border-color: var(--tw2-border) !important;
  box-shadow: var(--tw2-shadow-soft);
}

.tool-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: var(--tw2-shadow) !important;
}

.tw2-toast-stack {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 9999;
  display: grid;
  gap: 0.65rem;
  max-width: min(28rem, calc(100vw - 2rem));
}

.tw2-toast {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 0.7rem;
  border-radius: var(--tw2-radius);
  border: 1px solid var(--tw2-border);
  background: rgba(16, 32, 51, 0.96);
  color: #ffffff;
  box-shadow: var(--tw2-shadow);
  padding: 0.85rem 0.9rem;
  transform: translateY(0.75rem);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.tw2-toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.tw2-toast-icon {
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.tw2-toast-title {
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.2;
}

.tw2-toast-message {
  margin-top: 0.15rem;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.82rem;
  line-height: 1.35;
}

.tw2-toast-close {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
  line-height: 1;
}

.tw2-health-panel {
  max-width: 80rem;
  margin: 0 auto 1.5rem;
  padding: 0 1rem;
}

.tw2-health-panel-inner {
  border: 1px solid rgba(217, 119, 6, 0.24);
  border-radius: var(--tw2-radius);
  background: #fff7ed;
  color: #92400e;
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
  line-height: 1.45;
}

@media (max-width: 640px) {
  .tw2-tool-bar {
    margin-top: 0.5rem;
  }

  .tw2-tool-bar-inner {
    align-items: flex-start;
  }

  .tw2-toast-stack {
    right: 0.75rem;
    bottom: 0.75rem;
  }
}
