/* tools-shared.css — Shared styles for all tool pages */

/* Reset & Base */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; color: #1a1a2e; background: #ffffff; line-height: 1.6; }
:root {
    --primary: #1e1b4b;
    --secondary: #0ea5e9;
    --accent: #06b6d4;
    --accent-light: #22d3ee;
    --bg-light: #f9fafb;
    --border: #e5e7eb;
    --tool-color: var(--accent); /* Override per tool */
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

/* Header */
header { position: sticky; top: 0; background: rgba(255,255,255,0.95); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); z-index: 1000; padding: 1rem 0; }
.header-content { display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.25rem; font-weight: 700; color: var(--primary); text-decoration: none; }
nav a { color: #1a1a2e; text-decoration: none; font-size: 0.9rem; margin-left: 2.5rem; transition: color 0.3s; }
nav a:hover { color: var(--accent); }
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.hamburger span { display: block; width: 24px; height: 2px; background: var(--primary); margin: 5px 0; transition: all 0.3s; }
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }
@media (max-width: 768px) {
    .hamburger { display: block; }
    nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: white; border-bottom: 1px solid var(--border); padding: 1rem 1.5rem; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
    nav.open { display: flex; flex-direction: column; }
    nav a { margin: 0; padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
    nav a:last-child { border-bottom: none; }
}

/* Hero */
.hero { padding: 2.8rem 0 2rem; color: white; text-align: center; }
.hero h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); font-weight: 700; margin-bottom: 0.75rem; }
.hero p { opacity: 0.8; font-size: 1.1rem; }
.hero .badge { display: inline-block; padding: 0.35rem 1rem; border-radius: 2rem; font-size: 0.85rem; font-weight: 500; margin-bottom: 1rem; }

/* Card / Wizard */
.main-wrap { padding: 3rem 1.5rem 5rem; }
.card { max-width: 700px; margin: 0 auto; background: white; border-radius: 1rem; border: 1px solid var(--border); box-shadow: 0 4px 24px rgba(0,0,0,0.06); overflow: hidden; transition: max-width 0.3s; }
.card.wide { max-width: 960px; }
.progress-bar { height: 4px; background: var(--bg-light); }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--tool-color)); transition: width 0.4s; }

/* Steps */
.step { padding: 2.5rem; display: none; animation: fadeIn 0.3s ease; }
.step.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.step h2 { font-size: 1.35rem; font-weight: 700; color: var(--primary); margin-bottom: 0.5rem; }
.step .subtitle { color: #7a7a8e; font-size: 0.95rem; margin-bottom: 2rem; }

/* Form Controls */
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; font-size: 0.9rem; font-weight: 600; color: var(--primary); margin-bottom: 0.5rem; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 0.85rem 1rem; border: 2px solid var(--border); border-radius: 0.5rem;
    font-family: inherit; font-size: 0.95rem; transition: border-color 0.2s; outline: none; background: white;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--tool-color); }
.form-group textarea { min-height: 100px; resize: vertical; }
.form-group .optional { color: #7a7a8e; font-weight: 400; font-size: 0.85rem; }
.form-group .hint { color: #7a7a8e; font-size: 0.85rem; margin-top: 0.35rem; }

/* Checkbox Items */
.checkbox-grid, .option-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 500px) { .checkbox-grid, .option-grid { grid-template-columns: 1fr; } }
.chk-item { display: flex; align-items: center; padding: 0.85rem 1rem; border: 2px solid var(--border); border-radius: 0.75rem; cursor: pointer; transition: all 0.2s; }
.chk-item:hover { border-color: var(--tool-color); }
.chk-item.checked { border-color: var(--tool-color); background: color-mix(in srgb, var(--tool-color) 6%, white); }
.chk-item .chk { width: 20px; height: 20px; border: 2px solid var(--border); border-radius: 4px; margin-right: 0.75rem; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.chk-item.checked .chk { background: var(--tool-color); border-color: var(--tool-color); }
.chk-item.checked .chk::after { content: "✓"; color: white; font-size: 0.75rem; font-weight: 700; }
.chk-item label { cursor: pointer; font-size: 0.9rem; color: var(--primary); font-weight: 500; }

/* Radio Option Cards */
.option-card { display: flex; align-items: center; padding: 0.85rem 1rem; border: 2px solid var(--border); border-radius: 0.75rem; cursor: pointer; transition: all 0.2s; }
.option-card:hover { border-color: var(--tool-color); }
.option-card.selected { border-color: var(--tool-color); background: color-mix(in srgb, var(--tool-color) 6%, white); }
.option-card .radio { width: 20px; height: 20px; border: 2px solid var(--border); border-radius: 50%; margin-right: 0.75rem; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.option-card.selected .radio { border-color: var(--tool-color); }
.option-card.selected .radio::after { content: ""; width: 10px; height: 10px; background: var(--tool-color); border-radius: 50%; }
.option-card label { cursor: pointer; font-size: 0.9rem; color: var(--primary); font-weight: 500; }

/* AI Competitor Discovery Cards */
.ai-comp-card { display: flex; align-items: flex-start; gap: 0.75rem; padding: 1rem 1.25rem; border: 2px solid var(--border); border-radius: 0.75rem; margin-bottom: 0.75rem; cursor: pointer; transition: all 0.2s; }
.ai-comp-card:hover { border-color: var(--tool-color); }
.ai-comp-card.selected { border-color: var(--tool-color); background: color-mix(in srgb, var(--tool-color) 6%, white); }
.ai-comp-card .chk { width: 22px; height: 22px; border: 2px solid var(--border); border-radius: 4px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: all 0.2s; margin-top: 2px; }
.ai-comp-card.selected .chk { background: var(--tool-color); border-color: var(--tool-color); }
.ai-comp-card.selected .chk::after { content: "✓"; color: white; font-size: 0.75rem; font-weight: 700; }
.ai-comp-info { flex: 1; }
.ai-comp-info .comp-title { font-weight: 600; color: var(--primary); font-size: 0.95rem; }
.ai-comp-info .comp-url-text { font-size: 0.8rem; color: var(--tool-color); margin-top: 0.1rem; }
.ai-comp-info .comp-desc { font-size: 0.85rem; color: #7a7a8e; margin-top: 0.25rem; line-height: 1.4; }

/* Competitor Manual Entry */
.competitor-entry { background: var(--bg-light); border-radius: 0.75rem; padding: 1.25rem; margin-bottom: 1rem; border: 1px solid var(--border); }
.competitor-entry h3 { font-size: 0.9rem; color: var(--primary); margin-bottom: 0.75rem; }
.competitor-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 500px) { .competitor-row { grid-template-columns: 1fr; } }
.competitor-entry input { width: 100%; padding: 0.7rem 0.85rem; border: 2px solid var(--border); border-radius: 0.5rem; font-family: inherit; font-size: 0.9rem; outline: none; background: white; transition: border-color 0.2s; }
.competitor-entry input:focus { border-color: var(--tool-color); }
.add-competitor { display: inline-flex; align-items: center; gap: 0.4rem; background: none; border: 2px dashed var(--border); border-radius: 0.75rem; padding: 0.75rem 1.25rem; cursor: pointer; color: #7a7a8e; font-size: 0.9rem; font-family: inherit; font-weight: 500; transition: all 0.2s; width: 100%; justify-content: center; }
.add-competitor:hover { border-color: var(--tool-color); color: var(--tool-color); }

/* Buttons */
.btn-row { display: flex; justify-content: space-between; align-items: center; margin-top: 2rem; }
.btn { padding: 0.85rem 2rem; border-radius: 0.5rem; font-weight: 600; font-size: 1rem; cursor: pointer; transition: all 0.3s; border: none; font-family: inherit; }
.btn-primary { background: var(--tool-color); color: white; }
.btn-primary:hover { filter: brightness(0.9); transform: translateY(-2px); box-shadow: 0 8px 24px color-mix(in srgb, var(--tool-color) 40%, transparent); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-back { background: none; color: #7a7a8e; padding: 0.85rem 1rem; }
.btn-back:hover { color: var(--primary); }
.btn-secondary { background: var(--bg-light); color: var(--primary); border: 2px solid var(--border); padding: 0.85rem 2rem; border-radius: 0.5rem; font-weight: 600; cursor: pointer; font-family: inherit; font-size: 1rem; transition: all 0.3s; }
.btn-secondary:hover { border-color: var(--tool-color); }

/* Loading */
.loading { text-align: center; padding: 3rem; }
.loading .spinner { width: 48px; height: 48px; border: 4px solid var(--border); border-top: 4px solid var(--tool-color); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 1.5rem; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading h2 { color: var(--primary); margin-bottom: 0.5rem; }
.loading p { color: #7a7a8e; }

/* Report Output */
.brief-output { padding: 2.5rem; }
.brief-header { text-align: center; margin-bottom: 2rem; padding-bottom: 2rem; border-bottom: 2px solid var(--border); }
.brief-header h2 { color: var(--primary); font-size: 1.5rem; margin-bottom: 0.25rem; }
.brief-header p { color: #7a7a8e; }
.brief-content { line-height: 1.8; color: #2d2d42; }
.brief-content h2 { font-size: 1.15rem; color: var(--primary); margin: 2rem 0 0.75rem; padding-bottom: 0.35rem; border-bottom: 2px solid var(--tool-color); }
.brief-content h3 { font-size: 1rem; color: var(--primary); margin: 1.5rem 0 0.5rem; }
.brief-content p { margin-bottom: 0.75rem; }
.brief-content ul { margin: 0.5rem 0 1rem 1.5rem; }
.brief-content li { margin-bottom: 0.35rem; }
.brief-content strong { color: var(--primary); }
.brief-content table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.9rem; }
.brief-content th { padding: 0.6rem 0.75rem; background: var(--primary); color: white; text-align: left; font-weight: 600; font-size: 0.8rem; }
.brief-content td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); }

.brief-actions { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; margin-top: 2.5rem; padding-top: 2rem; border-top: 2px solid var(--border); }
.brief-cta { text-align: center; margin-top: 1.5rem; }
.brief-cta p { color: #7a7a8e; font-size: 0.9rem; }
.brief-cta a { color: var(--tool-color); text-decoration: none; }

/* CTA Box */
.cta-box { background: var(--bg-light); border-radius: 0.75rem; padding: 1.5rem; margin-top: 2rem; text-align: center; }
.cta-box h3 { color: var(--primary); font-size: 1.1rem; margin-bottom: 0.5rem; }
.cta-box p { color: #4a4a5e; font-size: 0.95rem; margin-bottom: 1.25rem; }

/* Share Link */
.share-link { background: #f0fdf4; border: 2px solid #86efac; border-radius: 0.75rem; padding: 1rem 1.25rem; margin-top: 1.5rem; display: none; }
.share-link p { font-size: 0.85rem; font-weight: 600; color: #166534; margin-bottom: 0.5rem; }
.share-link-row { display: flex; gap: 0.5rem; align-items: center; }
.share-link input { flex: 1; padding: 0.6rem 0.85rem; border: 2px solid #d1d5db; border-radius: 0.5rem; font-size: 0.85rem; font-family: monospace; background: white; }

/* Footer */
footer { background: var(--primary); color: white; padding: 3rem 0; text-align: center; }
.footer-content { margin-bottom: 1.5rem; }
.footer-content p { color: #a8bcc8; margin: 0.5rem 0; }
.footer-content a { color: var(--accent-light); text-decoration: none; }
.footer-copyright { color: #7a8f9e; font-size: 0.85rem; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 1.5rem; margin-top: 1.5rem; }
