/* Custom styles */
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Smooth transitions */
* {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

/* Fade-in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

/* Tab button active state */
.tab-button[data-active="true"] {
    border-bottom-color: #3b82f6;
    color: #3b82f6;
}

.dark .tab-button[data-active="true"] {
    border-bottom-color: #60a5fa;
    color: #60a5fa;
}

/* Prose styles for dark mode */
.prose.dark\:prose-invert {
    color: #e5e7eb;
}

.prose.dark\:prose-invert h1,
.prose.dark\:prose-invert h2,
.prose.dark\:prose-invert h3,
.prose.dark\:prose-invert h4,
.prose.dark\:prose-invert h5,
.prose.dark\:prose-invert h6 {
    color: #f9fafb;
}

.prose.dark\:prose-invert strong {
    color: #f9fafb;
}

.prose.dark\:prose-invert a {
    color: #60a5fa;
}

.prose.dark\:prose-invert a:hover {
    color: #93c5fd;
}

.prose.dark\:prose-invert blockquote {
    color: #d1d5db;
    border-left-color: #4b5563;
}

.prose.dark\:prose-invert code {
    color: #f9fafb;
    background-color: #374151;
}

.prose.dark\:prose-invert pre {
    background-color: #1f2937;
    color: #e5e7eb;
}

/* Comprehensive prose styles for content rendering */
.prose {
    color: #111827;
    max-width: 65ch;
    line-height: 1.75;
}

.prose-lg {
    font-size: 1.125rem;
    line-height: 1.7777778;
}

.prose h1 {
    color: #000000 !important;
    font-weight: 800;
    font-size: 2.25rem;
    margin-top: 0;
    margin-bottom: 0.8888889em;
    line-height: 1.1111111;
}

.prose h2 {
    color: #000000 !important;
    font-weight: 700;
    font-size: 1.875rem;
    margin-top: 2em;
    margin-bottom: 1em;
    line-height: 1.3333333;
}

.prose h3 {
    color: #000000 !important;
    font-weight: 600;
    font-size: 1.5rem;
    margin-top: 1.6em;
    margin-bottom: 0.6em;
    line-height: 1.6;
}

.prose h4 {
    color: #000000 !important;
    font-weight: 600;
    font-size: 1.25rem;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    line-height: 1.5;
}

.prose h5 {
    color: #000000 !important;
    font-weight: 600;
    font-size: 1.125rem;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    line-height: 1.5;
}

.prose h6 {
    color: #000000 !important;
    font-weight: 600;
    font-size: 1rem;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    line-height: 1.5;
}

.prose p {
    margin-top: 1.25em;
    margin-bottom: 1.25em;
    color: #111827;
}

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

.prose ul {
    margin-top: 1.25em;
    margin-bottom: 1.25em;
    padding-left: 1.625em;
}

.prose ol {
    margin-top: 1.25em;
    margin-bottom: 1.25em;
    padding-left: 1.625em;
}

.prose li {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    color: #111827;
}

.prose li p {
    margin-top: 0.75em;
    margin-bottom: 0.75em;
    color: #111827;
}

.prose blockquote {
    font-weight: 500;
    font-style: italic;
    color: #111827;
    border-left-width: 0.25rem;
    border-left-color: #e5e7eb;
    quotes: "\201C""\201D""\2018""\2019";
    margin-top: 1.6em;
    margin-bottom: 1.6em;
    padding-left: 1em;
}

.prose code {
    color: #111827;
    font-weight: 600;
    font-size: 0.875em;
    background-color: #f3f4f6;
    padding: 0.25em 0.375em;
    border-radius: 0.25rem;
}

.prose pre {
    color: #e5e7eb;
    background-color: #1f2937;
    overflow-x: auto;
    font-weight: 400;
    font-size: 0.875em;
    line-height: 1.7142857;
    margin-top: 1.7142857em;
    margin-bottom: 1.7142857em;
    border-radius: 0.375rem;
    padding: 0.8571429em 1.1428571em;
}

.prose pre code {
    background-color: transparent;
    border-width: 0;
    border-radius: 0;
    padding: 0;
    font-weight: inherit;
    color: inherit;
    font-size: inherit;
    font-family: inherit;
    line-height: inherit;
}

.prose table {
    width: 100%;
    table-layout: auto;
    text-align: left;
    margin-top: 2em;
    margin-bottom: 2em;
    font-size: 0.875em;
    line-height: 1.7142857;
}

.prose thead {
    border-bottom-width: 1px;
    border-bottom-color: #d1d5db;
}

.prose th {
    color: #111827;
    font-weight: 600;
    vertical-align: bottom;
    padding-right: 0.5714286em;
    padding-bottom: 0.5714286em;
    padding-left: 0.5714286em;
}

.prose tbody tr {
    border-bottom-width: 1px;
    border-bottom-color: #e5e7eb;
}

.prose td {
    vertical-align: baseline;
    padding-top: 0.5714286em;
    padding-right: 0.5714286em;
    padding-bottom: 0.5714286em;
    padding-left: 0.5714286em;
}

/* Dark mode prose styles */
.dark .prose {
    color: #e5e7eb;
}

.dark .prose h1,
.dark .prose h2,
.dark .prose h3,
.dark .prose h4,
.dark .prose h5,
.dark .prose h6 {
    color: #f9fafb !important;
}

.dark .prose p {
    color: #e5e7eb;
}

.dark .prose li {
    color: #e5e7eb;
}

.dark .prose li p {
    color: #e5e7eb;
}

.dark .prose strong {
    color: #f9fafb;
}

.dark .prose code {
    color: #f9fafb;
    background-color: #374151;
}

.dark .prose blockquote {
    color: #d1d5db;
    border-left-color: #4b5563;
}

.dark .prose th {
    color: #f9fafb;
}

.dark .prose thead {
    border-bottom-color: #4b5563;
}

.dark .prose tbody tr {
    border-bottom-color: #374151;
}

.prose.max-w-none {
    max-width: none;
}

/* Aspect ratio utility */
.aspect-w-16 {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.aspect-w-16 > * {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Focus styles for accessibility */
.tab-button:focus,
button:focus,
a:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Responsive grid improvements */
@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

.tab-button[data-active="true"] {
    color: #2563eb;
    border-color: #2563eb;
}

.dark .tab-button[data-active="true"] {
    color: #60a5fa;
    border-color: #60a5fa;
}

/* Smooth transitions */
.tab-content {
    transition: opacity 0.3s ease-in-out;
}

.tab-content.hidden {
    opacity: 0;
    pointer-events: none;
}

.tab-content:not(.hidden) {
    opacity: 1;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

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

.dark ::-webkit-scrollbar-track {
    background: #374151;
}

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

.dark ::-webkit-scrollbar-thumb {
    background: #6b7280;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Responsive images */
img {
    max-width: 100%;
    height: auto;
}

/* Code blocks */
pre {
    background-color: #f8fafc;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
}

.dark pre {
    background-color: #1f2937;
}

code {
    background-color: #f1f5f9;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.dark code {
    background-color: #374151;
}

/* Links */
a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.dark a {
    color: #60a5fa;
}

/* Header anchor links - completely hidden */
.header-anchor {
    display: none;
}

/* Print styles */
@media print {
    .tab-button,
    #theme-toggle,
    footer {
        display: none !important;
    }
    
    .tab-content {
        display: block !important;
        opacity: 1 !important;
    }
    
    .shadow-md,
    .shadow-lg {
        box-shadow: none !important;
        border: 1px solid #e5e7eb !important;
    }
}

/* Clean content area styles */
.content-area {
    color: #374151;
    line-height: 1.75;
    font-size: 1rem;
}

.content-area h1 {
    color: #111827;
    font-weight: 800;
    font-size: 2.25rem;
    margin-top: 0;
    margin-bottom: 1em;
    line-height: 1.2;
}

.content-area h2 {
    color: #111827;
    font-weight: 700;
    font-size: 1.875rem;
    margin-top: 2em;
    margin-bottom: 1em;
    line-height: 1.3;
}

.content-area h3 {
    color: #111827;
    font-weight: 600;
    font-size: 1.5rem;
    margin-top: 1.6em;
    margin-bottom: 0.6em;
    line-height: 1.4;
}

.content-area h4,
.content-area h5,
.content-area h6 {
    color: #111827;
    font-weight: 600;
    font-size: 1.25rem;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    line-height: 1.5;
}

.content-area p {
    margin-top: 1.25em;
    margin-bottom: 1.25em;
}

.content-area ul,
.content-area ol {
    margin-top: 1.25em;
    margin-bottom: 1.25em;
    padding-left: 1.5em;
}

.content-area li {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

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

.content-area code {
    background-color: #f3f4f6;
    color: #111827;
    padding: 0.25em 0.375em;
    border-radius: 0.25rem;
    font-size: 0.875em;
}

/* Dark mode styles */
.dark .content-area {
    color: #d1d5db;
}

.dark .content-area h1,
.dark .content-area h2,
.dark .content-area h3,
.dark .content-area h4,
.dark .content-area h5,
.dark .content-area h6 {
    color: #f9fafb;
}

.dark .content-area strong {
    color: #f9fafb;
}

.dark .content-area code {
    background-color: #374151;
    color: #f9fafb;
}
