/* Pragmatix Agentic AI eBook - Stylesheet */

:root {
    --pragmatix-blue: #1e4785;
    --pragmatix-blue-dark: #162d4d;
    --pragmatix-gold: #c9a227;
    --pragmatix-coral: #d4a27c;
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-light: #718096;
    --bg-light: #f7fafc;
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 18px;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg-white);
}

/* Header / Navigation */
.site-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 40px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--pragmatix-blue);
}

/* Hero Section (Landing Page) */
.hero {
    background: linear-gradient(135deg, var(--pragmatix-blue-dark) 0%, var(--pragmatix-blue) 100%);
    color: white;
    padding: 6rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 20% 50%, rgba(201, 162, 39, 0.1) 0%, transparent 50%),
                      radial-gradient(circle at 80% 50%, rgba(201, 162, 39, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--pragmatix-gold);
}

.hero .subtitle {
    font-size: 1.5rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.hero .tagline {
    font-size: 1.1rem;
    opacity: 0.8;
    font-style: italic;
    margin-bottom: 3rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--pragmatix-gold);
    color: var(--pragmatix-blue-dark);
}

.btn-primary:hover {
    background: #ddb832;
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.1);
}

/* Table of Contents */
.toc-section {
    padding: 4rem 2rem;
    background: var(--bg-light);
}

.toc-section h2 {
    text-align: center;
    color: var(--pragmatix-blue);
    margin-bottom: 3rem;
    font-size: 2rem;
}

.toc-container {
    max-width: 900px;
    margin: 0 auto;
}

.toc-part {
    margin-bottom: 2rem;
}

.toc-part-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--pragmatix-blue);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--pragmatix-gold);
}

.toc-chapters {
    list-style: none;
}

.toc-chapters li {
    margin-bottom: 0.5rem;
}

.toc-chapters a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
}

.toc-chapters a:hover {
    background: var(--bg-white);
    color: var(--pragmatix-blue);
    padding-left: 1.5rem;
}

.toc-chapters .chapter-number {
    color: var(--pragmatix-gold);
    font-weight: 600;
    margin-right: 0.5rem;
}

/* Chapter Content */
.chapter-container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
}

.chapter-sidebar {
    width: 280px;
    flex-shrink: 0;
    border-right: 1px solid var(--border-color);
    height: calc(100vh - 70px);
    position: sticky;
    top: 70px;
    overflow-y: auto;
    padding: 2rem 0;
    display: none;
}

@media (min-width: 1024px) {
    .chapter-sidebar {
        display: block;
    }
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav a {
    display: block;
    padding: 0.5rem 1.5rem;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    color: var(--pragmatix-blue);
    border-left-color: var(--pragmatix-gold);
    background: var(--bg-light);
}

.sidebar-nav .part-title {
    font-weight: 700;
    color: var(--pragmatix-blue);
    padding: 1rem 1.5rem 0.5rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chapter-content {
    flex: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.chapter-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.chapter-part {
    color: var(--pragmatix-gold);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.chapter-title {
    font-size: 2.5rem;
    color: var(--pragmatix-blue);
    line-height: 1.2;
}

.chapter-content h2 {
    font-size: 1.75rem;
    color: var(--pragmatix-blue);
    margin-top: 3rem;
    margin-bottom: 1rem;
}

.chapter-content h3 {
    font-size: 1.35rem;
    color: var(--pragmatix-blue);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.chapter-content p {
    margin-bottom: 1.5rem;
}

.chapter-content ul,
.chapter-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.chapter-content li {
    margin-bottom: 0.5rem;
}

.chapter-content strong {
    color: var(--text-primary);
}

.chapter-content em {
    color: var(--text-secondary);
}

/* Callout boxes */
.callout {
    background: var(--bg-light);
    border-left: 4px solid var(--pragmatix-gold);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0 4px 4px 0;
}

.callout-title {
    font-weight: 700;
    color: var(--pragmatix-blue);
    margin-bottom: 0.5rem;
}

.callout-pragmatix {
    background: linear-gradient(135deg, rgba(30, 71, 133, 0.05) 0%, rgba(201, 162, 39, 0.05) 100%);
    border-left-color: var(--pragmatix-blue);
}

/* Tables */
.chapter-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.95rem;
}

.chapter-content th,
.chapter-content td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.chapter-content th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--pragmatix-blue);
}

/* Code blocks */
.chapter-content code {
    background: var(--bg-light);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
}

.chapter-content pre {
    background: var(--pragmatix-blue-dark);
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 2rem 0;
}

.chapter-content pre code {
    background: none;
    padding: 0;
}

/* Chapter Navigation */
.chapter-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.chapter-nav a {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.2s;
    max-width: 45%;
}

.chapter-nav a:hover {
    background: var(--bg-light);
}

.chapter-nav .nav-label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.chapter-nav .nav-title {
    color: var(--pragmatix-blue);
    font-weight: 600;
}

.chapter-nav .prev {
    text-align: left;
}

.chapter-nav .next {
    text-align: right;
    margin-left: auto;
}

/* CTA Section */
.cta-section {
    background: var(--pragmatix-blue);
    color: white;
    padding: 4rem 2rem;
    text-align: center;
}

.cta-section h2 {
    color: var(--pragmatix-gold);
    margin-bottom: 1rem;
}

.cta-section p {
    opacity: 0.9;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Footer */
.site-footer {
    background: var(--pragmatix-blue-dark);
    color: white;
    padding: 3rem 2rem;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-brand {
    display: flex;
    align-items: center;
}

.footer-brand img {
    height: 32px;
    width: auto;
}

.footer-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.footer-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--pragmatix-gold);
}

.footer-contact {
    text-align: right;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Mobile menu */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--pragmatix-blue);
}

/* Mobile TOC button */
.mobile-toc-btn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--pragmatix-blue);
    color: white;
    padding: 12px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(30, 71, 133, 0.4);
    z-index: 99;
    transition: all 0.2s;
}

.mobile-toc-btn:hover {
    background: var(--pragmatix-blue-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 71, 133, 0.5);
}

@media (max-width: 1023px) {
    .mobile-toc-btn {
        display: flex;
        align-items: center;
        gap: 8px;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav-links {
        display: none;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero .subtitle {
        font-size: 1.2rem;
    }
    
    .chapter-title {
        font-size: 2rem;
    }
    
    .chapter-content {
        padding: 2rem 1rem;
    }
    
    .footer-inner {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-contact {
        text-align: center;
    }
}

/* Print styles */
@media print {
    .site-header,
    .chapter-sidebar,
    .chapter-nav,
    .cta-section,
    .site-footer {
        display: none;
    }
    
    .chapter-content {
        max-width: 100%;
        padding: 0;
    }
}
