/* ==========================================================================
   Atelier Design System - Tool Page Layout
   CANONICAL SHARED STYLES - All tools must use these.
   Based on email-template-builder (the golden template).
   ========================================================================== */

/* ---------- Reset & Base ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: #0a0a0a;
  color: #e5e7eb;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Navigation ---------- */
.nav,
.main-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background-color: #141414;
  border-bottom: 1px solid #374151;
  z-index: 1000;
}

.nav-content {
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.nav-brand,
.nav-brand a,
a.nav-brand {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff !important;
  text-decoration: none !important;
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-hamburger-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: #d1d5db;
  border-radius: 2px;
  transition: background 150ms ease;
}

.nav-hamburger:hover .nav-hamburger-bar {
  background: #ffffff;
}

.nav-links a {
  font-size: 15px;
  font-weight: 400;
  color: #d1d5db;
  text-decoration: none;
  transition: color 150ms ease;
}

.nav-links a:hover {
  color: #ffffff;
}

/* ---------- Hero Header ---------- */
.hero {
  margin-top: 60px;
  padding: 48px 24px;
  text-align: center;
  background-color: #141414;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-content {
  max-width: 720px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 36px;
  font-weight: 700;
  line-height: 44px;
  color: #ffffff;
  margin-bottom: 16px;
}

.hero-tagline {
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: #e5e7eb;
}

.hero-trust {
  font-size: 13px;
  font-weight: 400;
  color: #10b981;
  margin-top: 8px;
}

/* ---------- Error Bar ---------- */
.error-bar {
  max-width: 720px;
  margin: 0 auto 16px;
  padding: 12px 16px;
  background-color: #7f1d1d;
  border: 1px solid #dc2626;
  border-radius: 6px;
  color: #fca5a5;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.error-close {
  background: none;
  border: none;
  color: #fca5a5;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 6px;
}

.error-close:hover {
  color: #ffffff;
}

/* ---------- Tool Main ---------- */
.tool-main {
  flex: 1;
  padding: 32px 24px 120px;
}

.tool-container {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

/* ---------- Input Section ---------- */
.input-section {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---------- Section Headings ---------- */
.section-heading {
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 4px;
}

.section-hint {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 4px;
}

.settings-title {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ---------- Form Elements ---------- */
label {
  font-size: 14px;
  font-weight: 500;
  color: #d1d5db;
}

.text-input,
.text-area,
.select-input,
input[type="text"],
input[type="email"],
input[type="url"],
input[type="number"],
input[type="tel"],
textarea,
select {
  width: 100%;
  padding: 12px 16px;
  background-color: #1a1a1a;
  border: 1px solid #374151;
  border-radius: 8px;
  color: #e5e7eb;
  font-family: inherit;
  font-size: 15px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.text-input:focus,
.text-area:focus,
.select-input:focus,
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.text-input::placeholder,
.text-area::placeholder,
input::placeholder,
textarea::placeholder {
  color: #6b7280;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

/* ---------- Buttons ---------- */
.button-primary,
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  background-color: #3b82f6;
  border: none;
  border-radius: 8px;
  color: #ffffff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.button-primary:hover:not(:disabled),
.btn-primary:hover:not(:disabled) {
  background-color: #2563eb;
}

.button-primary:disabled,
.btn-primary:disabled {
  background-color: #374151;
  color: #6b7280;
  cursor: not-allowed;
}

.button-secondary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background-color: #1a1a1a;
  border: 1px solid #374151;
  border-radius: 8px;
  color: #e5e7eb;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms ease;
}

.button-secondary:hover,
.btn-secondary:hover {
  background-color: #374151;
}

.button-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  background-color: #10b981;
  border: none;
  border-radius: 8px;
  color: #ffffff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.button-download:hover {
  background-color: #059669;
}

/* ---------- File Upload Zone ---------- */
.file-upload-zone {
  background: #0a0a0a;
  border: 2px dashed #374151;
  border-radius: 12px;
  padding: 48px 32px;
  text-align: center;
  cursor: pointer;
  transition: all 200ms ease;
}

.file-upload-zone:hover,
.file-upload-zone:focus {
  border-color: #3b82f6;
  background: #0f172a;
}

.file-upload-zone.drag-over {
  border-color: #3b82f6;
  background: #1e3a8a;
}

.upload-icon {
  font-size: 32px;
  font-weight: 700;
  color: #3b82f6;
  margin-bottom: 16px;
}

.upload-primary {
  font-size: 16px;
  font-weight: 500;
  color: #e5e7eb;
  margin-bottom: 8px;
}

.upload-secondary {
  font-size: 14px;
  color: #6b7280;
}

/* ---------- Output Section ---------- */
.output-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.output-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
}

/* ---------- Pro Badge ---------- */
.pro-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #0a0a0a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ---------- Pro CTA Bar ---------- */
.pro-cta-bar,
.cta-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #1a1a1a;
  border-top: 1px solid #374151;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 999;
}

.cta-text {
  font-size: 14px;
  color: #d1d5db;
}

.cta-text strong {
  color: #ffffff;
}

.cta-button,
.button-pro {
  padding: 10px 20px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  border: none;
  border-radius: 6px;
  color: #0a0a0a;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.cta-button:hover,
.button-pro:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

.cta-close {
  background: none;
  border: none;
  color: #6b7280;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  margin-left: 8px;
}

/* ---------- Bug Report Button ---------- */
.bug-report-btn {
  position: fixed;
  bottom: 80px;
  right: 24px;
  background-color: #262626;
  border: 1px solid #374151;
  border-radius: 20px;
  padding: 8px 16px;
  color: #9ca3af;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all 150ms ease;
  z-index: 998;
}

.bug-report-btn:hover {
  background-color: #374151;
  color: #e5e7eb;
}

/* ---------- Footer ---------- */
.main-footer,
footer {
  background-color: #141414;
  border-top: 1px solid #374151;
  padding: 32px 24px;
  text-align: center;
}

.footer-content {
  max-width: 720px;
  margin: 0 auto;
}

.footer-copyright {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 12px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
}

.footer-links a {
  font-size: 14px;
  color: #9ca3af;
  text-decoration: none;
  transition: color 150ms ease;
}

.footer-links a:hover {
  color: #ffffff;
}

/* ---------- Utility Classes ---------- */
.section-hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ---------- Checkbox Styling ---------- */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: #e5e7eb;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #3b82f6;
}

/* ---------- Mode Tabs ---------- */
.mode-tabs {
  display: flex;
  background-color: #1a1a1a;
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
}

.mode-tab {
  flex: 1;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #9ca3af;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms ease;
}

.mode-tab:hover {
  color: #e5e7eb;
}

.mode-tab.active {
  background-color: #3b82f6;
  color: #ffffff;
}

/* ---------- Results/Output Table ---------- */
.results-table {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background-color: #374151;
  border-radius: 8px;
  overflow: hidden;
}

.result-row {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background-color: #1a1a1a;
  gap: 16px;
}

.result-row.result-header {
  background-color: #262626;
  font-weight: 500;
  color: #9ca3af;
  font-size: 13px;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .nav-content {
    padding: 0 16px;
  }

  .nav-hamburger {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: #0f0f0f;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 999;
  }

  .nav-links--open {
    display: flex;
  }

  .nav-links a {
    display: block;
    padding: 14px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 15px;
  }

  .hero {
    padding: 32px 16px;
  }

  .hero h1 {
    font-size: 28px;
    line-height: 36px;
  }

  .tool-main {
    padding: 24px 16px 140px;
  }

  .tool-container {
    gap: 32px;
  }

  .pro-cta-bar,
  .cta-bar {
    flex-direction: column;
    padding: 16px;
    gap: 12px;
  }

  .bug-report-btn {
    bottom: 140px;
    right: 16px;
  }

  .file-upload-zone {
    padding: 32px 16px;
  }

  .mode-tabs {
    flex-direction: column;
  }
}
