/* ============================================================
   Evidio AI Readiness Scanner — Custom Styles
   Inspired by neilpatel.com design system
   ============================================================ */

:root {
  --primary: #E85D04;
  --primary-dark: #C44D03;
  --primary-light: #FEF3E8;
  --red: #E53E3E;
  --red-dark: #C53030;
  --red-light: #FED7D7;
  --dark: #111827;
  --dark-secondary: #1F2937;
  --gray: #6B7280;
  --gray-light: #F3F4F6;
  --gray-border: #E5E7EB;
  --white: #FFFFFF;
  --green: #059669;
  --green-light: #D1FAE5;
  --orange: #D97706;
  --orange-light: #FEF3C7;
  --blue: #2563EB;
  --blue-light: #DBEAFE;
  --purple: #7C3AED;
  --amber: #CA8A04;
  --amber-light: #FEF9C3;
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--dark);
  background: var(--white);
  margin: 0;
  padding: 0;
}

/* Section anchors — offset for sticky nav (72px height + 16px gap) */
section[id] { scroll-margin-top: 88px; }

/* ── Typography ── */
.hero-heading {
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.section-heading {
  font-size: clamp(24px, 4vw, 46px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.section-subheading {
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 400;
  color: var(--gray);
  line-height: 1.6;
}

/* ── Container ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: var(--white);
  padding: 16px 32px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.3px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  white-space: nowrap;
  font-family: var(--font);
}

.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  color: var(--dark);
  padding: 14px 28px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border: 2px solid var(--gray-border);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  font-family: var(--font);
}

.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-dark {
  background: var(--dark);
  color: var(--white);
  padding: 14px 28px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s;
  font-family: var(--font);
}

.btn-dark:hover { background: var(--dark-secondary); }

/* ── Inputs ── */
.url-input {
  width: 100%;
  height: 60px;
  padding: 0 24px;
  border: 2px solid var(--gray-border);
  border-radius: 6px;
  font-size: 16px;
  font-family: var(--font);
  color: var(--dark);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.url-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(39,174,96,0.15);
}

.url-input::placeholder { color: #9CA3AF; }

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--gray-border);
  border-radius: 6px;
  font-size: 15px;
  font-family: var(--font);
  color: var(--dark);
  background: var(--white);
  transition: border-color 0.2s;
  outline: none;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(39,174,96,0.1);
}

/* ── URL combo (input + button) ── */
.url-combo { display: flex; max-width: 640px; margin: 0 auto; }
.url-combo .url-input { border-radius: 6px 0 0 6px; border-right: none; flex: 1; }
.url-combo .btn-primary { border-radius: 0 6px 6px 0; min-width: 160px; height: 60px; padding: 0 28px; }

@media (max-width: 600px) {
  .url-combo { flex-direction: column; gap: 8px; }
  .url-combo .url-input { border-radius: 6px; border-right: 2px solid var(--gray-border); }
  .url-combo .btn-primary { border-radius: 6px; height: 52px; }
}

/* ── Navigation ── */
.nav-sticky {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--gray-border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav-logo {
  font-size: 22px;
  font-weight: 800;
  color: var(--dark);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.nav-logo span { color: var(--primary); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: #4B5563;
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  padding: 8px 14px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover { color: var(--dark); background: var(--gray-light); }

@media (max-width: 768px) {
  .nav-links { display: none; }
}

/* ── Sections ── */
.section-dark  { background: var(--dark); color: var(--white); }
.section-dark .section-subheading { color: #9CA3AF; }
.section-red   { background: var(--primary); color: var(--white); }
.section-light { background: var(--gray-light); }
.section-pad   { padding: 80px 0; }
.section-pad-sm { padding: 56px 0; }

@media (max-width: 768px) {
  .section-pad { padding: 52px 0; }
  .section-pad-sm { padding: 36px 0; }
}

/* ── Cards ── */
.card {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  padding: 28px;
  transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.12); transform: translateY(-2px); }
.card-dark { background: var(--dark-secondary); color: var(--white); border-radius: 12px; padding: 28px; }

/* ── Score ── */
.score-gauge-wrapper { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.score-gauge-text { position: absolute; text-align: center; }
.score-number { font-size: 48px; font-weight: 800; line-height: 1; display: block; }
.score-label-text { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; opacity: 0.7; }

.score-excellent { color: var(--green); }
.score-good      { color: var(--blue); }
.score-moderate  { color: var(--orange); }
.score-weak      { color: var(--amber); }
.score-poor      { color: var(--red); }
.score-critical  { color: var(--purple); }

/* ── Progress bars ── */
.progress-bar { height: 8px; border-radius: 4px; background: var(--gray-border); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; transition: width 1s ease; }
.progress-green  { background: var(--green); }
.progress-blue   { background: var(--blue); }
.progress-orange { background: var(--orange); }
.progress-red    { background: var(--red); }

/* ── Gate badges ── */
.gate-pass { color: var(--green); }
.gate-fail { color: var(--red); }

.gate-badge-pass {
  background: var(--green-light);
  color: var(--green);
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.gate-badge-fail {
  background: var(--red-light);
  color: var(--red-dark);
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

/* ── Priority badges ── */
.badge-critical { background: var(--red-light); color: #991B1B; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.badge-high     { background: var(--orange-light); color: #92400E; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.badge-low      { background: var(--gray-light); color: var(--gray); padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; }

/* ── Blur overlay ── */
.blur-container { position: relative; overflow: hidden; }
.blur-content { filter: blur(5px); user-select: none; pointer-events: none; }
.blur-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to bottom, rgba(255,255,255,0.5) 0%, rgba(255,255,255,0.95) 60%);
  z-index: 10;
  padding: 32px;
  text-align: center;
}

/* ── htmx ── */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: block; }
.htmx-request.htmx-indicator { display: block; }

/* ── Spinner ── */
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.spinner { width: 20px; height: 20px; border: 2px solid rgba(255,255,255,0.3); border-top-color: var(--white); border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; }
.spinner-dark { border-color: rgba(0,0,0,0.1); border-top-color: var(--primary); } /* primary is now green */

/* ── Scan progress steps ── */
@keyframes pulse-dot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.8); } }

.scan-step { transition: opacity 0.3s, background 0.3s; }

.scan-step.step-active { background: var(--primary-light) !important; border: 1px solid rgba(232,93,4,0.3); opacity: 1 !important; }
.scan-step.step-active .scan-step-dot { background: var(--primary) !important; animation: pulse-dot 1.2s ease-in-out infinite; }
.scan-step.step-active .scan-step-label { color: var(--primary) !important; }

.scan-step.step-done { background: var(--green-light) !important; opacity: 1 !important; }
.scan-step.step-done .scan-step-dot { background: var(--green) !important; }
.scan-step.step-done .scan-step-label { color: var(--green) !important; }
.scan-step.step-done .scan-step-check { display: block !important; }

.scan-step.step-pending { opacity: 0.35 !important; background: transparent !important; border: none !important; }
.scan-step.step-pending .scan-step-dot { background: var(--gray) !important; }
.scan-step.step-pending .scan-step-label { color: var(--gray) !important; }

/* ── Alpine.js ── */
[x-cloak] { display: none !important; }

/* ── Animations ── */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.fade-in-up { animation: fadeInUp 0.5s ease both; }
.fade-in-up-delay-1 { animation-delay: 0.1s; }
.fade-in-up-delay-2 { animation-delay: 0.2s; }
.fade-in-up-delay-3 { animation-delay: 0.3s; }

/* ── Live dot ── */
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: live-pulse 1.5s ease-in-out infinite; display: inline-block; }

/* ── Stats ── */
.stat-number { font-size: clamp(36px, 5vw, 64px); font-weight: 800; line-height: 1; color: var(--primary); }

/* ── Footer ── */
.footer-dark { background: var(--dark); color: #9CA3AF; padding: 64px 0 32px; }
.footer-dark a { color: #9CA3AF; text-decoration: none; transition: color 0.2s; }
.footer-dark a:hover { color: var(--white); }
.footer-brand { color: var(--white) !important; font-size: 22px; font-weight: 800; }
.footer-brand span { color: var(--primary); }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 8px; }

/* ── Grids ── */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
@media (max-width: 900px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* ── Scan check items ── */
.scan-check-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--gray-border); }
.scan-check-item:last-child { border-bottom: none; }
.scan-check-name { flex: 1; font-size: 14px; font-weight: 500; }
.scan-check-pts { font-size: 13px; font-weight: 700; color: var(--gray); white-space: nowrap; }

/* ── Modal ── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-box { background: var(--white); border-radius: 16px; padding: 40px; max-width: 480px; width: 100%; box-shadow: 0 25px 50px rgba(0,0,0,0.25); position: relative; }

/* ── Accessibility ── */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ── Responsive utilities ── */
@media (max-width: 768px) { .hide-mobile { display: none !important; } .container { padding: 0 16px; } }
@media (min-width: 769px) { .hide-desktop { display: none !important; } }

/* ════════════════════════════════════════════════════════════════════
   Blog content styles (.blog-content)
   Applied to th:utext rendered HTML from Jodit editor
   ════════════════════════════════════════════════════════════════════ */

.blog-content {
    font-size: 17px;
    line-height: 1.8;
    color: #1f2937;
}

.blog-content h2 {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.25;
    color: var(--dark);
    margin: 48px 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gray-border);
}

.blog-content h3 {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--dark);
    margin: 36px 0 14px;
}

.blog-content h4 {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    margin: 28px 0 10px;
}

.blog-content p {
    margin-bottom: 24px;
}

.blog-content ul,
.blog-content ol {
    margin: 0 0 24px 0;
    padding-left: 28px;
}

.blog-content ul {
    list-style-type: disc;
}

.blog-content ol {
    list-style-type: decimal;
}

.blog-content li {
    margin-bottom: 8px;
    padding-left: 4px;
}

.blog-content blockquote {
    border-left: 4px solid var(--primary);
    background: #f0f7ff;
    margin: 32px 0;
    padding: 20px 24px;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #374151;
    font-size: 18px;
    line-height: 1.7;
}

.blog-content blockquote p:last-child {
    margin-bottom: 0;
}

.blog-content a {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: opacity .15s;
}

.blog-content a:hover {
    opacity: 0.75;
}

.blog-content strong,
.blog-content b {
    font-weight: 700;
    color: var(--dark);
}

.blog-content em,
.blog-content i {
    font-style: italic;
}

.blog-content code {
    font-family: 'Fira Code', 'Courier New', Courier, monospace;
    font-size: 0.875em;
    background: #f3f4f6;
    color: #be185d;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}

.blog-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 24px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 32px 0;
    font-size: 14px;
    line-height: 1.7;
}

.blog-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    border: none;
    font-size: inherit;
}

.blog-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 32px 0;
    font-size: 15px;
    overflow-x: auto;
    display: block;
}

.blog-content th {
    background: #f9fafb;
    font-weight: 700;
    text-align: left;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    color: var(--dark);
    white-space: nowrap;
}

.blog-content td {
    padding: 11px 16px;
    border: 1px solid #e5e7eb;
    vertical-align: top;
}

.blog-content tr:nth-child(even) td {
    background: #f9fafb;
}

.blog-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 32px auto;
    display: block;
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
}

.blog-content hr {
    border: none;
    border-top: 2px solid var(--gray-border);
    margin: 48px 0;
}

/* ── Blog / Podcast — sidebar layout ── */
.article-with-sidebar {
    max-width: 1100px;
    margin: 0 auto;
    padding: 60px 24px 80px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 64px;
    align-items: start;
}

.article-sidebar {
    position: sticky;
    top: 100px;
}

@media (max-width: 960px) {
    .article-with-sidebar {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 40px 16px 60px;
    }
    .article-sidebar {
        display: none;
    }
}
