/* VectorWiki Custom Styles */

:root {
    --header-height: 64px;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

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

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

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

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

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

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

/* Playground Canvas */
.playground-canvas {
    touch-action: none;
    user-select: none;
}

/* Code blocks */
pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    position: relative;
}

code {
    font-family: 'JetBrains Mono', monospace;
}

/* Inline code */
:not(pre) > code {
    background: #f1f5f9;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
}

.dark :not(pre) > code {
    background: #334155;
}

/* Article content styling */
.article-content h2 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-top: 3rem;
    margin-bottom: 1rem;
}

.article-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.article-content h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.article-content p {
    font-size: 1.125rem;
    line-height: 1.75;
    margin-bottom: 1rem;
}

.article-content ul,
.article-content ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.article-content ul {
    list-style-type: disc;
}

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

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

.article-content a {
    color: #0066ff;
    text-decoration: underline;
}

.article-content a:hover {
    color: #0047b3;
}

.article-content blockquote {
    border-left: 4px solid #0066ff;
    padding-left: 1rem;
    font-style: italic;
    margin: 1rem 0;
}

/* Table styling */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

thead {
    background: #f1f5f9;
}

.dark thead {
    background: #1e293b;
}

th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #d1d5db;
}

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

td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.dark td {
    border-bottom-color: #374151;
}

/* Callout boxes */
.callout {
    border-left: 4px solid;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0 0.5rem 0.5rem 0;
}

.callout-info {
    border-color: #3b82f6;
    background: #eff6ff;
}

.dark .callout-info {
    background: rgba(59, 130, 246, 0.1);
}

.callout-warning {
    border-color: #f59e0b;
    background: #fffbeb;
}

.dark .callout-warning {
    background: rgba(245, 158, 11, 0.1);
}

.callout-success {
    border-color: #10b981;
    background: #ecfdf5;
}

.dark .callout-success {
    background: rgba(16, 185, 129, 0.1);
}

.callout-danger {
    border-color: #ef4444;
    background: #fef2f2;
}

.dark .callout-danger {
    background: rgba(239, 68, 68, 0.1);
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 102, 255, 0.3);
    border-radius: 50%;
    border-top-color: #0066ff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Fade in animation */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Sticky header */
#site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.9);
}

.dark #site-header {
    background: rgba(15, 23, 42, 0.9);
}

/* Context indicators */
.context-math {
    border-left: 4px solid #0066ff;
}

.context-graphics {
    border-left: 4px solid #10b981;
}

.context-ai {
    border-left: 4px solid #9333ea;
}

/* Card hover effects */
.card-hover {
    transition: transform 0.2s, box-shadow 0.2s;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* Hero gradient */
.hero-gradient {
    background: linear-gradient(135deg, #0066ff 0%, #9333ea 50%, #10b981 100%);
}

/* Feature card backgrounds */
.feature-math {
    background: linear-gradient(135deg, #e6f0ff 0%, #f0f4ff 100%);
}

.dark .feature-math {
    background: linear-gradient(135deg, #1e3a5f 0%, #1e293b 100%);
}

.feature-graphics {
    background: linear-gradient(135deg, #d1fae5 0%, #ecfdf5 100%);
}

.dark .feature-graphics {
    background: linear-gradient(135deg, #064e3b 0%, #1e293b 100%);
}

.feature-ai {
    background: linear-gradient(135deg, #f3e6ff 0%, #faf5ff 100%);
}

.dark .feature-ai {
    background: linear-gradient(135deg, #4c1d95 0%, #1e293b 100%);
}

/* Interactive playground styles */
.playground-container {
    background: #f8fafc;
    border-radius: 1rem;
    padding: 1.5rem;
}

.dark .playground-container {
    background: #1e293b;
}

/* Vector visualization colors */
.vector-a { color: #0066ff; }
.vector-b { color: #9333ea; }
.vector-result { color: #10b981; }

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.tooltip:hover::after {
    opacity: 1;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }

    #site-header {
        position: static;
    }
}

/* KaTeX adjustments */
.katex-display {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 1rem 0;
}

/* Mobile menu animation */
#mobile-menu {
    transition: max-height 0.3s ease-in-out;
    overflow: hidden;
}

#mobile-menu.hidden {
    max-height: 0;
    padding: 0;
}

/* Search modal backdrop */
.search-modal-backdrop {
    backdrop-filter: blur(4px);
}

/* Result item hover */
.search-result-item {
    transition: background-color 0.15s;
}

/* Tab styles */
.tab-button {
    position: relative;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #0066ff;
}

/* Comparison table */
.comparison-table th:first-child,
.comparison-table td:first-child {
    position: sticky;
    left: 0;
    background: inherit;
    z-index: 1;
}

/* Range slider styling */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #0066ff;
    border-radius: 50%;
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #0066ff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.dark input[type="range"] {
    background: #374151;
}

/* Number input styling */
input[type="number"] {
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
