/* ==========================================================================
   WebTools — Dark Mode Theme & Print Stylesheet
   ========================================================================== */

:root {
  --wt-bg: #090d16;
  --wt-bg-elevated: #111827;
  --wt-bg-card: rgba(17, 24, 39, 0.78);
  --wt-border: rgba(148, 163, 184, 0.14);
  --wt-border-hover: rgba(99, 102, 241, 0.55);
  --wt-accent: #6366f1;
  --wt-accent-soft: rgba(99, 102, 241, 0.15);
  --wt-accent-2: #06b6d4;
  --wt-text-main: #f1f5f9;
  --wt-text-muted: #94a3b8;
  --bs-body-bg: #090d16;
  --bs-body-color: #f1f5f9;
  --bs-border-color: rgba(148, 163, 184, 0.16);
}

html,
body {
  min-height: 100%;
  background-color: var(--wt-bg);
  color: var(--wt-text-main);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.font-mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Subtle Ambient Background Glow */
.wt-bg-glow {
  background-image:
    radial-gradient(650px circle at 12% 8%, rgba(99, 102, 241, 0.14), transparent 55%),
    radial-gradient(550px circle at 88% 15%, rgba(6, 182, 212, 0.1), transparent 55%);
  background-attachment: fixed;
}

/* Navbar */
.wt-navbar {
  background: rgba(9, 13, 22, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--wt-border);
}

.wt-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #091530 url('../lootbew-icon.jpg') center / cover no-repeat;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

.wt-brand-icon > i {
  display: none;
}

/* Gradient Text */
.wt-gradient-text {
  background: linear-gradient(135deg, #ffffff 20%, #a5b4fc 65%, #67e8f9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Visitor Counter Widget */
.wt-visitor-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.9);
  border: 1px solid var(--wt-border);
  font-size: 0.85rem;
  color: var(--wt-text-muted);
}

.wt-visitor-card {
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.92), rgba(30, 41, 59, 0.55));
  border: 1px solid var(--wt-border);
  border-radius: 1rem;
  padding: 1.1rem 1.4rem;
  display: inline-flex;
  align-items: center;
  gap: 1.15rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.wt-live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: wt-pulse 2s infinite;
  display: inline-block;
  flex-shrink: 0;
}

@keyframes wt-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.65);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.wt-counter-digits {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #ffffff;
  line-height: 1.1;
}

/* Tool Cards */
.wt-tool-card {
  background: var(--wt-bg-card);
  border: 1px solid var(--wt-border);
  border-radius: 1rem;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  backdrop-filter: blur(10px);
  overflow: hidden;
  position: relative;
}

.wt-tool-card:hover {
  transform: translateY(-5px);
  border-color: var(--wt-border-hover);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4), 0 0 24px rgba(99, 102, 241, 0.14);
}

.wt-tool-card.wt-card-featured {
  border-color: rgba(99, 102, 241, 0.38);
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.11) 0%, rgba(17, 24, 39, 0.85) 55%);
}

.wt-tool-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.wt-icon-indigo {
  background: rgba(99, 102, 241, 0.16);
  color: #a5b4fc;
}

.wt-icon-cyan {
  background: rgba(6, 182, 212, 0.16);
  color: #67e8f9;
}

.wt-icon-emerald {
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
}

.wt-icon-amber {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
}

.wt-icon-rose {
  background: rgba(244, 63, 94, 0.16);
  color: #fda4af;
}

.wt-icon-violet {
  background: rgba(139, 92, 246, 0.16);
  color: #c4b5fd;
}

/* Search Input */
.wt-search-group .form-control,
.wt-search-group .input-group-text {
  background-color: rgba(17, 24, 39, 0.85);
  border-color: var(--wt-border);
  color: var(--wt-text-main);
}

.wt-search-group .form-control:focus {
  border-color: var(--wt-accent);
  box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.2);
}

/* Buttons */
.btn-wt-primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-weight: 500;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-wt-primary:hover {
  color: #ffffff;
  filter: brightness(1.08);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
}

.btn-wt-primary:active {
  transform: translateY(1px);
}

/* ==========================================================================
   Invoice Generator Specific Styles
   ========================================================================== */

.wt-panel {
  background: var(--wt-bg-card);
  border: 1px solid var(--wt-border);
  border-radius: 1rem;
  backdrop-filter: blur(10px);
}

.wt-panel .form-control,
.wt-panel .form-select {
  background-color: #0b1120;
  border-color: rgba(148, 163, 184, 0.2);
  color: #f8fafc;
}

.wt-panel .form-control:focus,
.wt-panel .form-select:focus {
  background-color: #0f172a;
  border-color: var(--wt-accent);
  box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.22);
}

.wt-panel .form-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: #cbd5e1;
  margin-bottom: 0.35rem;
}

/* Printable Invoice Sheet (Light paper aesthetic for accurate print preview) */
.invoice-sheet {
  background-color: #ffffff;
  color: #0f172a;
  border-radius: 0.85rem;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.45);
  padding: 2.5rem;
  min-height: 680px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  --bs-secondary-color: #64748b;
  --bs-body-color: #0f172a;
  --bs-border-color: #e2e8f0;
}

.invoice-sheet .text-muted {
  color: #64748b !important;
}

.invoice-sheet .invoice-accent-bar {
  height: 6px;
  width: 64px;
  border-radius: 999px;
  background: linear-gradient(90deg, #4f46e5, #06b6d4);
  margin-bottom: 1rem;
}

.invoice-sheet .invoice-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #1e293b;
  line-height: 1;
}

.invoice-sheet .invoice-meta-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  font-weight: 600;
}

.invoice-sheet .invoice-table {
  --bs-table-bg: transparent;
  --bs-table-color: #0f172a;
  --bs-table-border-color: #e2e8f0;
  margin-bottom: 0;
}

.invoice-sheet .invoice-table thead th {
  background-color: #f8fafc;
  color: #475569;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  border-bottom: 2px solid #cbd5e1;
  padding: 0.75rem;
}

.invoice-sheet .invoice-table tbody td {
  padding: 0.85rem 0.75rem;
  vertical-align: middle;
  border-bottom: 1px solid #e2e8f0;
  color: #1e293b;
}

.invoice-summary-box {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  padding: 1rem 1.25rem;
}

.invoice-total-row {
  border-top: 2px solid #cbd5e1;
  padding-top: 0.75rem;
  margin-top: 0.65rem;
  font-size: 1.18rem;
  font-weight: 800;
  color: #0f172a;
}

/* Editable Items List in Form Panel */
.wt-item-chip {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 0.65rem;
  padding: 0.65rem 0.85rem;
  transition: border-color 0.15s ease;
}

.wt-item-chip:hover {
  border-color: rgba(148, 163, 184, 0.35);
}

/* Brand Icon Accent Variants */
.wt-brand-cyan {
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.35);
}

.wt-brand-emerald {
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
}

.wt-brand-amber {
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
}

.wt-brand-rose {
  box-shadow: 0 4px 16px rgba(244, 63, 94, 0.35);
}

.wt-brand-violet {
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.35);
}

/* ==========================================================================
   JSON Formatter Specific Styles
   ========================================================================== */

.wt-code-editor {
  min-height: 420px;
  font-size: 0.86rem;
  line-height: 1.55;
  resize: vertical;
  tab-size: 2;
}

.wt-json-output {
  background-color: #0b1120;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 0.5rem;
  padding: 0.85rem 1rem;
  min-height: 420px;
  max-height: 620px;
  overflow: auto;
  font-size: 0.86rem;
  line-height: 1.55;
}

.wt-json-output pre {
  white-space: pre;
  overflow: visible;
  color: #e2e8f0;
}

.json-key {
  color: #7dd3fc;
}

.json-string {
  color: #86efac;
}

.json-number {
  color: #fcd34d;
}

.json-boolean {
  color: #c4b5fd;
  font-weight: 600;
}

.json-null {
  color: #fda4af;
  font-style: italic;
}

/* XML Syntax Highlighting */
.xml-tag {
  color: #7dd3fc;
}

.xml-attr-name {
  color: #c4b5fd;
}

.xml-attr-val {
  color: #86efac;
}

.xml-decl {
  color: #fcd34d;
}

.xml-cdata {
  color: #fda4af;
}

.xml-comment {
  color: #64748b;
  font-style: italic;
}

.xml-punct {
  color: #94a3b8;
}

.wt-error-snippet {
  background-color: rgba(9, 13, 22, 0.78);
  border: 1px solid rgba(248, 113, 113, 0.25);
  border-radius: 0.45rem;
  padding: 0.65rem 0.85rem;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  color: #fecaca;
  overflow-x: auto;
  white-space: pre;
}

/* ==========================================================================
   QR Code Studio Specific Styles
   ========================================================================== */

.wt-qr-tabs .nav-link {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--wt-border);
  color: var(--wt-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.65rem;
  padding: 0.45rem 0.9rem;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.wt-qr-tabs .nav-link:hover {
  color: #ffffff;
  border-color: var(--wt-border-hover);
}

.wt-qr-tabs .nav-link.active {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border-color: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.wt-qr-stage {
  background-color: #0b1120;
  background-image: radial-gradient(rgba(148, 163, 184, 0.14) 1px, transparent 1px);
  background-size: 16px 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 0.85rem;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
}

.wt-qr-stage canvas {
  width: 100%;
  max-width: 300px;
  height: auto;
  border-radius: 0.65rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

/* ==========================================================================
   Password Generator Specific Styles
   ========================================================================== */

.wt-password-display {
  background-color: #0b1120;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 0.75rem;
  padding: 1.1rem 1.25rem;
  min-height: 70px;
  display: flex;
  align-items: center;
  word-break: break-all;
  font-size: clamp(1.05rem, 2.2vw, 1.4rem);
  line-height: 1.45;
  letter-spacing: 0.03em;
}

.pw-char-alpha {
  color: #f8fafc;
}

.pw-char-num {
  color: #7dd3fc;
}

.pw-char-sym {
  color: #fcd34d;
}

.wt-strength-track {
  height: 7px;
  background-color: rgba(148, 163, 184, 0.16);
  border-radius: 999px;
}

/* ==========================================================================
   Color & Contrast Lab Specific Styles
   ========================================================================== */

.wt-color-hero {
  border-radius: 0.85rem;
  padding: 1.25rem;
  min-height: 112px;
  display: flex;
  align-items: flex-end;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.wt-dot-swatch {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  padding: 0;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.wt-dot-swatch:hover {
  transform: scale(1.14);
  border-color: #ffffff;
}

.wt-hue-slider::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ef4444, #f59e0b, #22c55e, #06b6d4, #6366f1, #ec4899, #ef4444);
}

.wt-hue-slider::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ef4444, #f59e0b, #22c55e, #06b6d4, #6366f1, #ec4899, #ef4444);
}

.wt-contrast-score-box,
.wt-wcag-tile {
  background-color: rgba(11, 17, 32, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 0.75rem;
}

.wt-contrast-preview {
  border-radius: 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.wt-swatch-card {
  background-color: rgba(11, 17, 32, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 0.8rem;
  overflow: hidden;
}

.wt-swatch-preview {
  min-height: 92px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.wt-swatch-preview:hover {
  filter: brightness(1.06);
}

.wt-scale-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
  gap: 0.5rem;
}

.wt-scale-tile {
  border-radius: 0.65rem;
  padding: 0.75rem 0.45rem;
  min-height: 76px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.wt-scale-tile:hover {
  transform: translateY(-3px);
}

/* ==========================================================================
   Unit Converter Specific Styles
   ========================================================================== */

.wt-unit-tile {
  background-color: rgba(11, 17, 32, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, background-color 0.15s ease;
}

.wt-unit-tile:hover {
  border-color: var(--wt-border-hover);
  transform: translateY(-2px);
}

.wt-unit-tile-active {
  border-color: rgba(139, 92, 246, 0.55);
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.12), rgba(11, 17, 32, 0.9));
}

/* Footer */
.wt-footer {
  border-top: 1px solid var(--wt-border);
  background: rgba(9, 13, 22, 0.65);
}

/* ==========================================================================
   Print Styles — Print ONLY the clean invoice sheet
   ========================================================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 14mm;
  }

  html,
  body {
    background: #ffffff !important;
    color: #0f172a !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }

  main {
    padding: 0 !important;
    margin: 0 !important;
  }

  .no-print {
    display: none !important;
  }

  .print-container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .print-container > .row {
    --bs-gutter-x: 0 !important;
    --bs-gutter-y: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .print-col {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .invoice-sheet {
    width: 100% !important;
    box-sizing: border-box !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 0.75rem !important;
    min-height: auto !important;
  }

  .invoice-sheet .table-responsive {
    overflow: visible !important;
  }

  .invoice-sheet .invoice-table thead th,
  .invoice-summary-box,
  .invoice-sheet .invoice-accent-bar {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
