/* MCP Server Finder - Custom Styles */

/* CSS Variables for theming */
:root {
    --background: 0 0% 100%;
    --foreground: 240 10% 3.9%;
    --card: 0 0% 100%;
    --card-foreground: 240 10% 3.9%;
    --popover: 0 0% 100%;
    --popover-foreground: 240 10% 3.9%;
    --primary: 240 5.9% 10%;
    --primary-foreground: 0 0% 98%;
    --secondary: 240 4.8% 95.9%;
    --secondary-foreground: 240 5.9% 10%;
    --muted: 240 4.8% 95.9%;
    --muted-foreground: 240 3.8% 46.1%;
    --accent: 240 4.8% 95.9%;
    --accent-foreground: 240 5.9% 10%;
    --border: 240 5.9% 90%;
    --input: 240 5.9% 90%;
    --ring: 240 5.9% 10%;
    --radius: 0.625rem;
}

.dark {
    --background: 240 10% 3.9%;
    --foreground: 0 0% 98%;
    --card: 240 10% 3.9%;
    --card-foreground: 0 0% 98%;
    --popover: 240 10% 3.9%;
    --popover-foreground: 0 0% 98%;
    --primary: 0 0% 98%;
    --primary-foreground: 240 5.9% 10%;
    --secondary: 240 3.7% 15.9%;
    --secondary-foreground: 0 0% 98%;
    --muted: 240 3.7% 15.9%;
    --muted-foreground: 240 5% 64.9%;
    --accent: 240 3.7% 15.9%;
    --accent-foreground: 0 0% 98%;
    --border: 240 3.7% 25%;
    --input: 240 3.7% 25%;
    --ring: 240 3.7% 25%;
}

/* Base styles */
* {
    border-color: hsl(var(--border));
}

body {
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
}

/* Hide scrollbar utility class */
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

/* Line clamp utilities */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

/* Grid pattern background */
.grid-pattern {
    background-image: linear-gradient(to right, hsl(var(--border)) 1px, transparent 1px),
                      linear-gradient(to bottom, hsl(var(--border)) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* Markdown body styling */
.markdown-body {
    padding: 1.5rem;
    border-radius: 0.5rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-x: auto;
    color: #24292e;
    background-color: #ffffff;
    border: 1px solid #e1e4e8;
}

.dark .markdown-body {
    color: #e6e6e6;
    background-color: #0d1117;
    border-color: #30363d;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.25;
    color: #24292e;
}

.dark .markdown-body h1,
.dark .markdown-body h2,
.dark .markdown-body h3,
.dark .markdown-body h4,
.dark .markdown-body h5,
.dark .markdown-body h6 {
    color: #ffffff;
}

.markdown-body h1,
.markdown-body h2 {
    padding-bottom: 0.3em;
    border-bottom: 1px solid #eaecef;
}

.dark .markdown-body h1,
.dark .markdown-body h2 {
    border-bottom-color: #30363d;
}

.markdown-body h1 { font-size: 2em; }
.markdown-body h2 { font-size: 1.5em; }
.markdown-body h3 { font-size: 1.25em; }
.markdown-body h4 { font-size: 1em; }
.markdown-body h5 { font-size: 0.875em; }
.markdown-body h6 { font-size: 0.85em; color: #6a737d; }

.markdown-body a {
    color: #0366d6;
    text-decoration: none;
}

.markdown-body a:hover {
    text-decoration: underline;
}

.dark .markdown-body a {
    color: #58a6ff;
}

.markdown-body ul,
.markdown-body ol {
    padding-left: 2em;
    margin-bottom: 16px;
}

.markdown-body pre {
    padding: 16px;
    overflow: auto;
    font-size: 85%;
    line-height: 1.45;
    background-color: #f6f8fa;
    border-radius: 6px;
    margin-bottom: 16px;
}

.dark .markdown-body pre {
    background-color: #161b22;
}

.markdown-body code {
    padding: 0.2em 0.4em;
    font-size: 85%;
    background-color: rgba(27,31,35,0.05);
    border-radius: 3px;
    font-family: "SFMono-Regular", Consolas, monospace;
}

.dark .markdown-body code {
    background-color: rgba(110,118,129,0.4);
}

.markdown-body pre code {
    padding: 0;
    background: transparent;
    border: 0;
}

.markdown-body table {
    width: 100%;
    margin-bottom: 16px;
    border-collapse: collapse;
}

.markdown-body table th,
.markdown-body table td {
    padding: 6px 13px;
    border: 1px solid #dfe2e5;
}

.dark .markdown-body table th,
.dark .markdown-body table td {
    border-color: #30363d;
}

.markdown-body table th {
    font-weight: 600;
}

.markdown-body table tr {
    background-color: #fff;
}

.dark .markdown-body table tr {
    background-color: #0d1117;
}

.markdown-body table tr:nth-child(2n) {
    background-color: #f6f8fa;
}

.dark .markdown-body table tr:nth-child(2n) {
    background-color: #161b22;
}

.markdown-body blockquote {
    padding: 0 1em;
    color: #6a737d;
    border-left: 0.25em solid #dfe2e5;
    margin-bottom: 16px;
}

.dark .markdown-body blockquote {
    color: #b0b9c4;
    border-left-color: #30363d;
}

.markdown-body img {
    max-width: 100%;
    border-radius: 3px;
}

/* Form input focus styles */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    ring: 2px;
    ring-color: hsl(var(--ring));
}

/* Smooth transitions */
a,
button {
    transition: all 0.2s ease-in-out;
}

/* Container max-width */
.container {
    max-width: 1280px;
}

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

::-webkit-scrollbar-track {
    background: hsl(var(--muted));
}

::-webkit-scrollbar-thumb {
    background: hsl(var(--muted-foreground));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: hsl(var(--foreground));
}

/* Prose styles for content */
.prose {
    max-width: 65ch;
}

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

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

.prose li {
    margin-bottom: 0.5rem;
}

/* Category tag hover effects */
.category-tag {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

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

.server-card:hover,
.guide-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Animation for mobile menu */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-menu-open {
    animation: slideDown 0.3s ease-out;
}

/* FAQ accordion styles */
.faq-item {
    transition: all 0.3s ease;
}

.faq-item:hover {
    background-color: hsl(var(--accent));
}

/* Loading spinner */
.spinner {
    border: 2px solid hsl(var(--muted));
    border-top: 2px solid hsl(var(--primary));
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

    body {
        background-color: white !important;
        color: black !important;
    }

    a {
        color: black !important;
        text-decoration: underline !important;
    }
}
