/* Tools portal styles - distinct but consistent with Codetriq branding */
/* Uses existing Tailwind utilities from base.css; adds tool-specific UI */

.tools-page { min-height: 100vh; display: flex; flex-direction: column; background: #f8fafc; }
.tools-header { background: white; border-bottom: 1px solid #e2e8f0; }
.tools-nav { max-width: 1200px; margin: 0 auto; padding: 1rem 1.5rem; display: flex; align-items: center; justify-content: space-between; }
.tools-nav a { color: #475569; text-decoration: none; margin-left: 1.5rem; font-size: 0.875rem; }
.tools-nav a:hover { color: #2563eb; }
.tools-nav .logo { font-weight: 700; color: #1e293b; font-size: 1.125rem; text-decoration: none; }

.tools-main { flex: 1; max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem; width: 100%; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.tools-card { background: white; border: 1px solid #e2e8f0; border-radius: 0.75rem; padding: 1.5rem; transition: box-shadow 0.2s, transform 0.1s; }
.tools-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); transform: translateY(-1px); }
.tools-card h3 { font-size: 1.125rem; font-weight: 600; color: #1e293b; margin-bottom: 0.5rem; }
.tools-card p { font-size: 0.875rem; color: #64748b; line-height: 1.5; margin-bottom: 1rem; }
.tools-card .badge { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 0.25rem 0.5rem; border-radius: 9999px; background: #dbeafe; color: #1e40af; margin-bottom: 0.75rem; }
.tools-card a { display: inline-block; font-size: 0.875rem; font-weight: 500; color: #2563eb; text-decoration: none; }
.tools-card a:hover { text-decoration: underline; }

.tools-search { max-width: 400px; margin-bottom: 2rem; }
.tools-search input { width: 100%; padding: 0.75rem 1rem; border: 1px solid #cbd5e1; border-radius: 0.5rem; font-size: 0.9375rem; }
.tools-search input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

.tools-filter { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 2rem; }
.tools-filter button { padding: 0.5rem 1rem; border: 1px solid #e2e8f0; background: white; border-radius: 9999px; font-size: 0.875rem; font-weight: 500; color: #475569; cursor: pointer; transition: all 0.15s; }
.tools-filter button:hover { border-color: #cbd5e1; background: #f1f5f9; }
.tools-filter button.active { background: #2563eb; color: white; border-color: #2563eb; }

.tool-layout { display: grid; grid-template-columns: 1fr 340px; gap: 2rem; }
@media (max-width: 900px) { .tool-layout { grid-template-columns: 1fr; } }

.tool-input-area { background: white; border: 1px solid #e2e8f0; border-radius: 0.75rem; padding: 1.5rem; }
.tool-sidebar { background: white; border: 1px solid #e2e8f0; border-radius: 0.75rem; padding: 1.5rem; }
.tool-sidebar h4 { font-size: 0.875rem; font-weight: 600; color: #1e293b; margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 0.05em; }
.tool-sidebar label { display: block; font-size: 0.875rem; color: #475569; margin-bottom: 0.375rem; }
.tool-sidebar input[type="number"], .tool-sidebar input[type="text"], .tool-sidebar select { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid #cbd5e1; border-radius: 0.375rem; font-size: 0.875rem; margin-bottom: 1rem; }
.tool-sidebar input:focus, .tool-sidebar select:focus { outline: none; border-color: #2563eb; }
.tool-sidebar .checkbox-group { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
.tool-sidebar .checkbox-group input[type="checkbox"] { width: auto; margin: 0; }
.tool-sidebar .checkbox-group label { margin: 0; }
.tool-sidebar button.primary { width: 100%; padding: 0.75rem; background: #2563eb; color: white; border: none; border-radius: 0.5rem; font-weight: 500; font-size: 0.875rem; cursor: pointer; transition: background 0.15s; }
.tool-sidebar button.primary:hover { background: #1d4ed8; }
.tool-sidebar button.secondary { width: 100%; padding: 0.75rem; background: white; color: #475569; border: 1px solid #cbd5e1; border-radius: 0.5rem; font-weight: 500; font-size: 0.875rem; cursor: pointer; transition: background 0.15s; margin-top: 0.5rem; }
.tool-sidebar button.secondary:hover { background: #f8fafc; }

.dropzone { border: 2px dashed #cbd5e1; border-radius: 0.75rem; padding: 2rem; text-align: center; cursor: pointer; transition: border-color 0.2s, background 0.15s; position: relative; }
.dropzone:hover, .dropzone.dragover { border-color: #2563eb; background: #eff6ff; }
.dropzone p { color: #64748b; font-size: 0.9375rem; margin-bottom: 0.5rem; pointer-events: none; }
.dropzone .hint { color: #94a3b8; font-size: 0.8125rem; pointer-events: none; }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }

.preview-area { margin-top: 1.5rem; border-top: 1px solid #e2e8f0; padding-top: 1.5rem; }
.preview-area img { max-width: 100%; max-height: 400px; border-radius: 0.5rem; border: 1px solid #e2e8f0; }
.preview-area .info { display: flex; gap: 1rem; font-size: 0.8125rem; color: #64748b; margin-top: 0.75rem; }
.preview-area .info span { background: #f1f5f9; padding: 0.25rem 0.5rem; border-radius: 0.25rem; }

.before-after { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem; }
.before-after .panel { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 0.5rem; padding: 0.75rem; }
.before-after .panel img { width: 100%; border-radius: 0.25rem; }
.before-after .panel h5 { font-size: 0.75rem; font-weight: 600; color: #64748b; margin-bottom: 0.5rem; text-transform: uppercase; }

.color-swatch { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem; background: white; border: 1px solid #e2e8f0; border-radius: 0.5rem; margin-bottom: 0.5rem; }
.color-swatch .box { width: 2.5rem; height: 2.5rem; border-radius: 0.375rem; border: 1px solid #e2e8f0; }
.color-swatch .code { font-family: monospace; font-size: 0.8125rem; color: #475569; }
.color-swatch button { margin-left: auto; padding: 0.25rem 0.5rem; font-size: 0.75rem; background: #f1f5f9; border: 1px solid #cbd5e1; border-radius: 0.25rem; cursor: pointer; }

.error-banner { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; padding: 0.75rem 1rem; border-radius: 0.5rem; font-size: 0.875rem; margin: 1rem 0; }
.success-banner { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; padding: 0.75rem 1rem; border-radius: 0.5rem; font-size: 0.875rem; margin: 1rem 0; }

.privacy-note { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; padding: 0.75rem 1rem; border-radius: 0.5rem; font-size: 0.8125rem; margin-bottom: 1.5rem; }
.privacy-note strong { font-weight: 600; }

.tool-footer { border-top: 1px solid #e2e8f0; padding: 1.5rem; text-align: center; font-size: 0.8125rem; color: #64748b; }
.tool-footer a { color: #2563eb; text-decoration: none; }
.tool-footer a:hover { text-decoration: underline; }

/* Accessibility */
*:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
button, input, select { font-family: inherit; }

/* Ad slot placeholder (inert in Phase 1) */
.ad-slot { min-height: 90px; background: #f8fafc; border: 1px dashed #e2e8f0; border-radius: 0.5rem; display: flex; align-items: center; justify-content: center; color: #94a3b8; font-size: 0.8125rem; margin: 1.5rem 0; }

/* Secondary footer + newsletter */
.secondary-footer { background: #0f172a; color: #e2e8f0; padding: 2.5rem 1.5rem; }
.sf-inner { max-width: 64rem; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; justify-content: space-between; }
.sf-info h3 { font-size: 1.125rem; font-weight: 600; margin: 0 0 .35rem; color: #fff; }
.sf-info p { font-size: .875rem; color: #94a3b8; margin: 0; max-width: 26rem; }
.sf-form { display: flex; gap: .5rem; flex-wrap: wrap; }
.sf-form input[type="email"] { flex: 1; min-width: 14rem; padding: .65rem .9rem; border-radius: .5rem; border: 1px solid #334155; background: #1e293b; color: #f8fafc; font-size: .875rem; }
.sf-form input::placeholder { color: #64748b; }
.sf-form button { padding: .65rem 1.25rem; border: none; border-radius: .5rem; background: #2563eb; color: #fff; font-weight: 600; font-size: .875rem; cursor: pointer; }
.sf-form button:hover { background: #1d4ed8; }
.sf-form button:disabled { opacity: .7; cursor: default; }
.sf-msg { margin: 0; font-size: .9375rem; }
.sf-ok { color: #4ade80; font-weight: 600; }
.sf-err { color: #f87171; }

/* Mobile responsiveness */
@media (max-width: 640px) {
  .tools-nav { flex-wrap: wrap; gap: 0.5rem 1rem; padding: 0.875rem 1rem; }
  .tools-nav nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; width: 100%; }
  .tools-nav a { margin-left: 0; font-size: 0.8125rem; }
  .tools-main { padding: 1.25rem 1rem; }
  .before-after { grid-template-columns: 1fr; }
  .dropzone { padding: 1.5rem 1rem; }
  .preview-area .info { flex-wrap: wrap; }
  .sf-inner { flex-direction: column; align-items: stretch; }
  .sf-form { width: 100%; }
  .sf-form input[type="email"] { min-width: 0; }
}
@media (max-width: 340px) {
  .tools-grid { grid-template-columns: 1fr; }
}
