/* ═══════════════════════════════════════════════════════════
   CaseIndex — Shared Guide Page Stylesheet
   Used by: guides.html, widget-guide.html, and all feature guides
   ═══════════════════════════════════════════════════════════ */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --primary-xlight: #eff6ff;
    --accent: #06b6d4;
    --accent-dark: #0891b2;
    --accent-light: #cffafe;
    --green: #10b981;
    --green-light: #d1fae5;
    --yellow: #f59e0b;
    --yellow-light: #fef3c7;
    --red: #ef4444;
    --red-light: #fee2e2;
    --dark: #0f172a;
    --dark-muted: #334155;
    --gray: #64748b;
    --gray-light: #f1f5f9;
    --white: #ffffff;
    --border: #e2e8f0;
    --gradient-hero: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    --gradient-accent: linear-gradient(135deg, #2563eb, #06b6d4);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-lg: 20px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--dark);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    background: #f8fafc;
}

h1, h2, h3, h4, h5 { font-weight: 700; line-height: 1.2; color: var(--dark); }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); letter-spacing: -0.02em; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; }
p { color: var(--dark-muted); margin-bottom: 1rem; font-size: 1.05rem; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

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

/* ─── Navigation ─── */
.nav {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}
.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}
.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.35rem;
    color: var(--dark);
    text-decoration: none;
}
.nav-logo .logo-icon {
    width: 36px;
    height: 36px;
    background: var(--gradient-accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}
.nav-actions { display: flex; align-items: center; gap: 16px; }
.nav-link { font-size: 0.95rem; font-weight: 500; color: var(--gray); transition: color 0.2s; }
.nav-link:hover { color: var(--primary); text-decoration: none; }
.btn-nav {
    padding: 9px 22px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    background: var(--primary);
    color: white;
    transition: all 0.2s;
    display: inline-block;
}
.btn-nav:hover { transform: translateY(-1px); opacity: 0.9; text-decoration: none; color: white; }

/* ─── Page Hero ─── */
.page-hero {
    background: var(--gradient-hero);
    padding: 80px 0 100px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.page-hero::before {
    content: '';
    position: absolute;
    top: -40%; right: -10%;
    width: 70%; height: 150%;
    background: radial-gradient(circle, rgba(37,99,235,0.15) 0%, transparent 65%);
    pointer-events: none;
}
.page-hero::after {
    content: '';
    position: absolute;
    bottom: -30%; left: -5%;
    width: 60%; height: 100%;
    background: radial-gradient(circle, rgba(6,182,212,0.1) 0%, transparent 65%);
    pointer-events: none;
}
.page-hero .container { position: relative; z-index: 1; }
.page-hero .hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.85);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 20px;
    border: 1px solid rgba(255,255,255,0.15);
}
.page-hero h1 { color: white; margin-bottom: 16px; }
.page-hero p { color: rgba(255,255,255,0.75); font-size: 1.2rem; max-width: 640px; margin: 0 auto; }

/* ─── Content Card ─── */
.content-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 56px 64px;
    margin: -52px auto 80px;
    position: relative;
    z-index: 10;
}

/* ─── Section Divider ─── */
.section-divider {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 48px 0;
}

/* ─── Callout Boxes ─── */
.callout {
    padding: 20px 24px;
    border-radius: var(--radius);
    margin: 24px 0;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.callout i { font-size: 1.25rem; flex-shrink: 0; margin-top: 2px; }
.callout-content h4 { margin-bottom: 4px; font-size: 1rem; }
.callout-content p { margin-bottom: 0; font-size: 0.95rem; }
.callout-info { background: var(--primary-xlight); border-left: 4px solid var(--primary); }
.callout-info i, .callout-info h4 { color: var(--primary-dark); }
.callout-tip { background: var(--green-light); border-left: 4px solid var(--green); }
.callout-tip i, .callout-tip h4 { color: #047857; }
.callout-warning { background: var(--yellow-light); border-left: 4px solid var(--yellow); }
.callout-warning i, .callout-warning h4 { color: #92400e; }

/* ─── Steps ─── */
.steps { counter-reset: step; margin: 32px 0; }
.step {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 24px;
    margin-bottom: 36px;
    position: relative;
}
.step::before {
    content: '';
    position: absolute;
    left: 24px; top: 48px;
    width: 2px;
    height: calc(100% + 36px - 48px);
    background: var(--border);
}
.step:last-child::before { display: none; }
.step-number {
    counter-increment: step;
    width: 48px;
    height: 48px;
    background: var(--gradient-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}
.step-content h4 { font-size: 1.15rem; margin-bottom: 8px; padding-top: 10px; }
.step-content p { margin-bottom: 12px; }
.step-content .sub-steps {
    background: var(--gray-light);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-top: 12px;
}
.step-content .sub-steps ol { padding-left: 20px; margin-bottom: 0; }
.step-content .sub-steps li { margin-bottom: 8px; font-size: 0.95rem; color: var(--dark-muted); }
.step-content .sub-steps li:last-child { margin-bottom: 0; }

/* ─── Code Blocks ─── */
.code-block {
    background: #1e293b;
    color: #e2e8f0;
    padding: 24px;
    border-radius: var(--radius);
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    line-height: 1.7;
    margin: 16px 0;
}
.code-block .highlight { color: #f472b6; }
.code-block .value { color: #86efac; }
.code-block .comment { color: #94a3b8; font-style: italic; }
code {
    background: var(--gray-light);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.88em;
    color: #db2777;
    font-family: 'Courier New', Courier, monospace;
}

/* ─── Field Snippet (copy-paste pill) ─── */
.field-snippet {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1e293b;
    color: #86efac;
    padding: 8px 16px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.95rem;
    margin: 8px 0;
}
.field-label {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 2px 10px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ─── Feature Grid ─── */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin: 28px 0;
}
.feature-box {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: box-shadow 0.2s, transform 0.2s;
}
.feature-box:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.feature-box .icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 16px;
}
.icon-blue { background: var(--primary-light); color: var(--primary); }
.icon-cyan { background: var(--accent-light); color: var(--accent-dark); }
.icon-green { background: var(--green-light); color: var(--green); }
.icon-yellow { background: var(--yellow-light); color: #92400e; }
.feature-box h4 { margin-bottom: 8px; }
.feature-box p { font-size: 0.92rem; margin-bottom: 0; }

/* ─── Guide Index Cards ─── */
.guide-card {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
.guide-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--primary); text-decoration: none; }
.guide-card .card-icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
}
.guide-card-content h4 { font-size: 1.1rem; margin-bottom: 6px; color: var(--dark); }
.guide-card-content p { font-size: 0.9rem; margin-bottom: 0; }
.guide-card .arrow { margin-left: auto; color: var(--gray); font-size: 1.25rem; align-self: center; flex-shrink: 0; transition: transform 0.2s; }
.guide-card:hover .arrow { transform: translateX(4px); color: var(--primary); }

/* ─── Navigation Breadcrumb ─── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: 28px;
}
.breadcrumb a { color: var(--gray); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb i { font-size: 0.75rem; }

/* ─── Section Heading ─── */
.section-heading {
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 12px;
    margin-bottom: 24px;
    margin-top: 48px;
}
.section-heading:first-of-type { margin-top: 0; }
.section-heading h2, .section-heading h3 { margin: 0; }

/* ─── Tables ─── */
.guide-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.95rem;
}
.guide-table th {
    background: var(--gray-light);
    color: var(--dark);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border);
}
.guide-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--dark-muted);
}
.guide-table tr:last-child td { border-bottom: none; }
.guide-table tr:hover td { background: var(--gray-light); }

/* ─── Lists ─── */
ul.guide-list, ol.guide-list {
    margin: 12px 0 20px 0;
    padding-left: 24px;
}
ul.guide-list li, ol.guide-list li {
    color: var(--dark-muted);
    font-size: 1.05rem;
    margin-bottom: 10px;
    padding-left: 4px;
}
ul.guide-list li::marker { color: var(--primary); }

/* ─── Footer ─── */
.guide-footer {
    background: white;
    border-top: 1px solid var(--border);
    padding: 48px 0;
}
.guide-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}
.guide-footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--dark);
    text-decoration: none;
}
.guide-footer-logo .logo-icon {
    width: 32px; height: 32px;
    background: var(--gradient-accent);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 14px;
}
.guide-footer-links { display: flex; gap: 24px; }
.guide-footer-links a { font-size: 0.9rem; color: var(--gray); transition: color 0.2s; }
.guide-footer-links a:hover { color: var(--primary); text-decoration: none; }
.guide-footer-copy { font-size: 0.85rem; color: var(--gray); }

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .content-card { padding: 32px 24px; margin-top: -32px; }
    .page-hero { padding: 60px 0 90px; }
    .step { grid-template-columns: 36px 1fr; gap: 16px; }
    .step-number { width: 36px; height: 36px; font-size: 0.9rem; }
    .guide-footer-inner { flex-direction: column; gap: 16px; }
    .guide-footer-links { flex-wrap: wrap; gap: 16px; }
}
