/* Custom styles for Comments Flow */

/* Prose styling for Markdown content */
.prose {
    line-height: 1.6;
}

.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-weight: 600;
    color: #1f2937;
}

.prose h1 { font-size: 1.5em; }
.prose h2 { font-size: 1.25em; }
.prose h3 { font-size: 1.1em; }

.prose p {
    margin-bottom: 1em;
}

.prose ul, .prose ol {
    margin-left: 1.5em;
    margin-bottom: 1em;
}

.prose ul {
    list-style-type: disc;
}

.prose ol {
    list-style-type: decimal;
}

.prose li {
    margin-bottom: 0.25em;
}

.prose code {
    background-color: #f3f4f6;
    padding: 0.125em 0.25em;
    border-radius: 0.25em;
    font-size: 0.875em;
    font-family: ui-monospace, monospace;
}

.prose pre {
    background-color: #1f2937;
    color: #f9fafb;
    padding: 1em;
    border-radius: 0.5em;
    overflow-x: auto;
    margin-bottom: 1em;
}

.prose pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
}

.prose blockquote {
    border-left: 4px solid #d1d5db;
    padding-left: 1em;
    margin-left: 0;
    margin-bottom: 1em;
    color: #6b7280;
    font-style: italic;
}

.prose a {
    color: #2563eb;
    text-decoration: underline;
}

.prose a:hover {
    color: #1d4ed8;
}

.prose img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5em;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1em;
}

.prose th, .prose td {
    border: 1px solid #e5e7eb;
    padding: 0.5em;
    text-align: left;
}

.prose th {
    background-color: #f9fafb;
    font-weight: 600;
}

.prose hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 1.5em 0;
}

/* Loading spinner animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Smooth transitions */
.transition-shadow {
    transition: box-shadow 0.2s ease-in-out;
}

/* Card hover effects */
.hover\:shadow-md:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Focus styles for accessibility */
input:focus, select:focus, textarea:focus, button:focus {
    outline: none;
    ring: 2px;
    ring-color: #3b82f6;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* File input styling */
input[type="file"]::file-selector-button {
    cursor: pointer;
}

/* ── Snippet Block ──────────────────────────────────────────────────────── */
/*
 * .snippet-block  – outer wrapper for a rendered saved-text comment block.
 * Designed to be artifact-free: no syntax-highlighter spans, no colour
 * bleed, no accidental Markdown rendering.  The raw text is HTML-escaped
 * server-side and placed verbatim inside <pre><code>.
 */

.snippet-block {
    border: 1px solid #d1d5db;          /* gray-300 */
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    background-color: #ffffff;
}

/* ── Header bar ── */
.snippet-block__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.75rem;
    background-color: #1e293b;          /* slate-800 */
    border-bottom: 1px solid #334155;   /* slate-700 */
    gap: 0.5rem;
    flex-wrap: wrap;
}

.snippet-block__header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

/* Language badge */
.snippet-block__badge {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: 0.25rem;
    background-color: #3b82f6;          /* blue-500 */
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Optional human-readable label */
.snippet-block__title {
    color: #cbd5e1;                     /* slate-300 */
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 24rem;
}

/* Line / char count */
.snippet-block__meta {
    color: #94a3b8;                     /* slate-400 */
    font-size: 0.7rem;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Body – the <pre><code> block ── */
.snippet-block__body {
    margin: 0;
    padding: 1rem;
    background-color: #0f172a;          /* slate-900 */
    color: #e2e8f0;                     /* slate-200 */
    font-family: ui-monospace, 'Cascadia Code', 'Fira Code', Consolas,
                 'Liberation Mono', Menlo, monospace;
    font-size: 0.8125rem;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre;                   /* preserve indentation exactly */
    tab-size: 4;
    -moz-tab-size: 4;
    /* Prevent any inherited prose styles from leaking in */
    font-weight: normal;
    font-style: normal;
    text-decoration: none;
    letter-spacing: normal;
    word-spacing: normal;
}

/* Ensure the inner <code> tag is invisible (no extra styling) */
.snippet-block__body code {
    background: none;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
    color: inherit;
    font-family: inherit;
}

/* ── Prose override – prevent .prose rules from bleeding into snippets ── */
.prose .snippet-block__body,
.prose .snippet-block__body code {
    background-color: #0f172a;
    color: #e2e8f0;
    padding: 1rem;
    font-size: 0.8125rem;
}

/* ── Responsive sidebar */
/* Responsive sidebar */
@media (max-width: 768px) {
    aside {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }
    
    aside.open {
        transform: translateX(0);
    }
    
    main {
        margin-left: 0 !important;
    }
}
