/* Enhanced Markdown Rendering Styles - Professional Proposal Design */

.markdown-content {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.8;
    color: #1f2937;
    max-width: 100%;
    font-size: 16px;
}

/* Headers - Enhanced for professional proposals */
.markdown-content h1 {
    font-size: 2.5em;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 1em;
    padding-bottom: 0.5em;
    border-bottom: 3px solid #2563eb;
    color: #111827;
    line-height: 1.2;
}

.markdown-content h2 {
    font-size: 1.875em;
    font-weight: 600;
    margin-top: 2.5em;
    margin-bottom: 1em;
    padding: 0.75em 0 0.5em 0;
    border-bottom: 2px solid #e5e7eb;
    color: #1f2937;
    background: linear-gradient(to bottom, transparent 50%, #f9fafb 50%);
    background-size: 100% 200%;
    background-position: 0 0;
}

.markdown-content h3 {
    font-size: 1.375em;
    font-weight: 600;
    margin-top: 2em;
    margin-bottom: 0.75em;
    color: #374151;
    padding-left: 0.5em;
    border-left: 4px solid #3b82f6;
}

.markdown-content h4 {
    font-size: 1.125em;
    font-weight: 600;
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    color: #4b5563;
}

/* Paragraphs and text - Improved readability */
.markdown-content p {
    margin-bottom: 1.5em;
    font-size: 1.0625em;
    line-height: 1.8;
}

.markdown-content strong {
    font-weight: 600;
    color: #111827;
}

.markdown-content em {
    font-style: italic;
    color: #4b5563;
}

/* First paragraph after heading gets extra spacing */
.markdown-content h2 + p,
.markdown-content h3 + p {
    margin-top: 0.5em;
}

/* Lists - Enhanced spacing and visual markers */
.markdown-content ul,
.markdown-content ol {
    margin-left: 1.5em;
    margin-bottom: 2em;
    padding-left: 1em;
}

.markdown-content li {
    margin-bottom: 0.875em;
    line-height: 1.75;
    padding-left: 0.5em;
}

.markdown-content ul li {
    list-style-type: disc;
    color: #1f2937;
}

.markdown-content ul li::marker {
    color: #3b82f6;
    font-size: 1.1em;
}

.markdown-content ul ul li {
    list-style-type: circle;
}

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

.markdown-content ol li::marker {
    color: #3b82f6;
    font-weight: 600;
}

/* Tables - Professional pricing tables */
.markdown-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 2em 0;
    font-size: 1em;
    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.markdown-content table thead {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.markdown-content table thead th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    color: #ffffff;
    border-bottom: none;
    font-size: 1.05em;
}

.markdown-content table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s ease;
}

.markdown-content table tbody tr:hover {
    background-color: #f0f9ff;
}

.markdown-content table tbody tr:last-child {
    border-bottom: none;
    font-weight: 600;
    background-color: #f9fafb;
}

.markdown-content table tbody td {
    padding: 14px 20px;
    color: #374151;
    line-height: 1.6;
}

.markdown-content table tbody tr:nth-child(even) {
    background-color: #fafbfc;
}

/* Make total row stand out */
.markdown-content table tbody tr:last-child td {
    color: #111827;
    font-size: 1.05em;
}

/* Code blocks */
.markdown-content code {
    font-family: 'Monaco', 'Menlo', 'Consolas', 'Courier New', monospace;
    font-size: 0.9em;
}

/* Inline code */
.markdown-content p code,
.markdown-content li code,
.markdown-content td code {
    background-color: #f3f4f6;
    color: #e11d48;
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-size: 0.88em;
    font-weight: 500;
}

/* Code blocks */
.markdown-content pre {
    background-color: #1f2937;
    color: #f3f4f6;
    padding: 1.25em 1.5em;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5em 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    line-height: 1.5;
}

.markdown-content pre code {
    background: none;
    color: inherit;
    padding: 0;
    font-size: 0.9em;
}

/* Syntax highlighting */
.markdown-content .highlight {
    background-color: #1f2937;
    border-radius: 8px;
    padding: 1.25em 1.5em;
    margin: 1.5em 0;
    overflow-x: auto;
}

.markdown-content .highlight pre {
    background: none;
    padding: 0;
    margin: 0;
    box-shadow: none;
}

/* Blockquotes - For notes and important callouts */
.markdown-content blockquote {
    border-left: 5px solid #3b82f6;
    padding-left: 1.5em;
    margin: 2em 0;
    color: #374151;
    font-style: italic;
    background: linear-gradient(to right, #eff6ff, transparent);
    padding: 1.25em 1.5em;
    border-radius: 0 10px 10px 0;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
}

.markdown-content blockquote p {
    margin-bottom: 0.5em;
    line-height: 1.7;
}

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

/* Horizontal rules - Professional section dividers */
.markdown-content hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 3em 0;
    position: relative;
}

.markdown-content hr::after {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 8px;
    background: linear-gradient(90deg, transparent, #3b82f6, transparent);
    border-radius: 4px;
}

/* Links */
.markdown-content a {
    color: #2563eb;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s;
}

.markdown-content a:hover {
    border-bottom-color: #2563eb;
}

/* Images */
.markdown-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5em 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Table of Contents */
.markdown-content .toc {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5em;
    margin: 2em 0;
}

.markdown-content .toc ul {
    margin-left: 1em;
    margin-bottom: 0;
}

.markdown-content .toc li {
    margin-bottom: 0.5em;
}

/* Pygments syntax highlighting - 'friendly' theme */
.highlight .hll { background-color: #ffffcc }
.highlight { background: #1f2937; color: #f8f8f8 }
.highlight .c { color: #999988; font-style: italic } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #66d9ef; font-weight: bold } /* Keyword */
.highlight .o { font-weight: bold } /* Operator */
.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */
.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */
.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #999999 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #aaaaaa } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { font-weight: bold } /* Keyword.Constant */
.highlight .kd { font-weight: bold } /* Keyword.Declaration */
.highlight .kn { font-weight: bold } /* Keyword.Namespace */
.highlight .kp { font-weight: bold } /* Keyword.Pseudo */
.highlight .kr { font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #a6e22e; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #ae81ff } /* Literal.Number */
.highlight .s { color: #e6db74 } /* Literal.String */
.highlight .na { color: #a6e22e } /* Name.Attribute */
.highlight .nb { color: #f8f8f2 } /* Name.Builtin */
.highlight .nc { color: #a6e22e; font-weight: bold } /* Name.Class */
.highlight .no { color: #66d9ef } /* Name.Constant */
.highlight .nd { color: #a6e22e; font-weight: bold } /* Name.Decorator */
.highlight .ni { color: #f8f8f2 } /* Name.Entity */
.highlight .ne { color: #a6e22e; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #a6e22e } /* Name.Function */
.highlight .nl { color: #f8f8f2 } /* Name.Label */
.highlight .nn { color: #f8f8f2 } /* Name.Namespace */
.highlight .nt { color: #66d9ef } /* Name.Tag */
.highlight .nv { color: #f8f8f2 } /* Name.Variable */
.highlight .ow { font-weight: bold } /* Operator.Word */
.highlight .w { color: #f8f8f2 } /* Text.Whitespace */
.highlight .mf { color: #ae81ff } /* Literal.Number.Float */
.highlight .mh { color: #ae81ff } /* Literal.Number.Hex */
.highlight .mi { color: #ae81ff } /* Literal.Number.Integer */
.highlight .mo { color: #ae81ff } /* Literal.Number.Oct */
.highlight .sb { color: #e6db74 } /* Literal.String.Backtick */
.highlight .sc { color: #e6db74 } /* Literal.String.Char */
.highlight .sd { color: #e6db74 } /* Literal.String.Doc */
.highlight .s2 { color: #e6db74 } /* Literal.String.Double */
.highlight .se { color: #ae81ff } /* Literal.String.Escape */
.highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */
.highlight .si { color: #e6db74 } /* Literal.String.Interpol */
.highlight .sx { color: #e6db74 } /* Literal.String.Other */
.highlight .sr { color: #e6db74 } /* Literal.String.Regex */
.highlight .s1 { color: #e6db74 } /* Literal.String.Single */
.highlight .ss { color: #e6db74 } /* Literal.String.Symbol */
.highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */
.highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */
.highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */

/* =================================================================== */
/* PROFESSIONAL PROPOSAL ENHANCEMENTS */
/* =================================================================== */

/* Add subtle visual interest to first paragraph */
.markdown-content > p:first-of-type {
    font-size: 1.125em;
    color: #374151;
}

/* Improve readability with print-style formatting */
.markdown-content {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Add visual hierarchy with section spacing */
.markdown-content h2:not(:first-child) {
    padding-top: 1em;
}

/* Style checkmarks/bullets in "What's Included" sections */
.markdown-content li:has(> :first-child:is(:contains("✓"), :contains("✅"))) {
    list-style: none;
    padding-left: 0;
}

/* Enhance emphasis in pricing contexts */
.markdown-content td strong,
.markdown-content li strong {
    color: #1e40af;
}

/* Subtle hover effect for tables */
.markdown-content table {
    cursor: default;
}

/* Add professional spacing to ordered lists in terms */
.markdown-content ol {
    counter-reset: item;
}

.markdown-content ol > li {
    counter-increment: item;
}

/* Make signature lines more visible */
.markdown-content p:contains("Signature") {
    border-bottom: 2px solid #cbd5e1;
    padding-bottom: 0.5em;
    margin-top: 2em;
}

/* Print-friendly styling */
@media print {
    .markdown-content {
        font-size: 12pt;
        color: #000;
    }
    
    .markdown-content h1 {
        border-bottom-color: #000;
    }
    
    .markdown-content h2 {
        page-break-after: avoid;
    }
    
    .markdown-content table {
        page-break-inside: avoid;
        box-shadow: none;
        border: 2px solid #000;
    }
    
    .markdown-content table thead {
        background: #f0f0f0 !important;
    }
    
    .markdown-content table thead th {
        color: #000 !important;
    }
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .markdown-content {
        font-size: 15px;
    }
    
    .markdown-content h1 {
        font-size: 2em;
    }
    
    .markdown-content h2 {
        font-size: 1.5em;
        margin-top: 2em;
    }
    
    .markdown-content h3 {
        font-size: 1.25em;
    }
    
    .markdown-content table {
        font-size: 0.9em;
    }
    
    .markdown-content table thead th,
    .markdown-content table tbody td {
        padding: 10px 12px;
    }
}
