/* Server Detail Page CSS */

.server-header-section {
    background: linear-gradient(135deg, #f9fafb 0%, #e5e7eb 100%);
    padding: 40px 0;
    border-bottom: 1px solid var(--border);
}

.server-header-content {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 40px;
    margin-bottom: 32px;
}

.server-header-left {
    display: flex;
    gap: 24px;
    align-items: start;
    flex: 1;
}

.server-logo-large {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: contain;
    background: white;
    padding: 4px;
    box-shadow: var(--shadow);
}

.server-header-left h1 {
    font-size: 36px;
    margin-bottom: 8px;
}

.server-description-header {
    font-size: 18px;
    color: var(--gray);
    margin-bottom: 16px;
}

.server-meta {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: var(--gray);
}

.server-meta a {
    color: var(--primary);
    text-decoration: none;
}

.health-score-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-lg);
}

.score-number {
    font-size: 48px;
    font-weight: bold;
}

.score-label {
    font-size: 14px;
}

.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
    background: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 20px;
    font-weight: bold;
    color: var(--dark);
}

.stat-label {
    font-size: 14px;
    color: var(--gray);
}

.action-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.btn-secondary {
    background: white;
    color: var(--dark);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-secondary:hover {
    background: var(--light);
    border-color: var(--primary);
}

/* Detail Content */
.detail-content {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    margin-top: 40px;
}

.detail-section {
    background: white;
    border-radius: 8px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.detail-section h2 {
    font-size: 24px;
    margin-bottom: 24px;
}

.code-block {
    background: var(--dark);
    color: white;
    padding: 16px 20px;
    border-radius: 6px;
    font-family: monospace;
    margin-bottom: 16px;
    position: relative;
}

.ai-content {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    padding: 16px;
    margin-top: 16px;
}

.ai-summary {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 16px;
    margin-top: 16px;
}

/* Environment Variables */
.env-vars-table {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.env-var-item {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 16px;
}

.env-var-name {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.env-var-name code {
    background: var(--light);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: monospace;
}

.badge-required {
    background: var(--danger);
    color: white;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
}

.env-var-desc {
    color: var(--gray);
    margin-bottom: 8px;
}

.env-var-example {
    font-size: 14px;
    color: var(--gray);
}

/* Tools */
.tools-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tool-item {
    border-left: 3px solid var(--primary);
    padding-left: 16px;
}

.tool-item h4 {
    margin-bottom: 4px;
}

.tool-item p {
    color: var(--gray);
}

/* Compatibility */
.compatibility-table {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.compatibility-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.client-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge-official {
    background: var(--primary);
    color: white;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
}

.compatibility-status {
    font-size: 14px;
}

.status-verified { color: var(--success); }
.status-works { color: var(--secondary); }
.status-issues { color: var(--warning); }
.status-incompatible { color: var(--danger); }
.status-unknown { color: var(--gray); }

/* Sidebar */
.detail-sidebar {
    position: sticky;
    top: 80px;
    height: fit-content;
}

.sidebar-section {
    background: white;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.sidebar-section h3 {
    font-size: 18px;
    margin-bottom: 16px;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.github-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.info-label {
    color: var(--gray);
}

.info-value {
    font-weight: 500;
}

/* Similar Servers */
.similar-servers {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.similar-server-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    text-decoration: none;
    color: var(--dark);
    transition: all 0.2s;
}

.similar-server-item:hover {
    border-color: var(--primary);
    background: var(--light);
}

.similar-server-item img {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: contain;
    background: var(--light);
}

.similar-server-name {
    font-weight: 500;
    margin-bottom: 2px;
}

.similar-server-score {
    font-size: 12px;
    color: var(--gray);
}

/* Responsive */
@media (max-width: 1024px) {
    .detail-content {
        grid-template-columns: 1fr;
    }
    
    .detail-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .server-header-content {
        flex-direction: column;
    }
    
    .quick-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .action-buttons {
        width: 100%;
    }
    
    .action-buttons > * {
        flex: 1;
    }
}
/* README Content Styling */
.readme-content {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text);
    max-width: 100%;
    overflow-x: hidden;
    overflow-wrap: break-word;
    word-wrap: break-word;
    margin: 0;
}

/* Ensure all child elements respect viewport width */
.readme-content * {
    max-width: calc(100vw - 40px) !important;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.readme-content h1,
.readme-content h2,
.readme-content h3,
.readme-content h4,
.readme-content h5,
.readme-content h6 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    color: var(--dark);
}

.readme-content h1 { 
    font-size: 28px; 
    border-bottom: 1px solid var(--border); 
    padding-bottom: 8px; 
}
.readme-content h2 { font-size: 24px; }
.readme-content h3 { font-size: 20px; }
.readme-content h4 { font-size: 18px; }

.readme-content p {
    margin-bottom: 16px;
}

.readme-content pre {
    background: #f6f8fa;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    padding: 16px;
    overflow-x: auto;
    max-width: calc(100vw - 40px) !important;
    margin-bottom: 16px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
}

/* Syntax highlighting - Basic theme */
.readme-content .language-bash,
.readme-content .language-sh {
    color: #032f62;
}

.readme-content .language-javascript,
.readme-content .language-js,
.readme-content .language-typescript,
.readme-content .language-ts {
    color: #d73a49;
}

.readme-content .language-python,
.readme-content .language-py {
    color: #6f42c1;
}

.readme-content .language-json {
    color: #005cc5;
}

.readme-content code {
    background: rgba(175, 184, 193, 0.2);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
}

.readme-content pre code {
    background: none;
    padding: 0;
}

.readme-content ul,
.readme-content ol {
    margin-bottom: 16px;
    padding-left: 32px;
}

.readme-content li {
    margin-bottom: 4px;
}

.readme-content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 16px;
    margin: 16px 0;
    color: var(--gray);
}

.readme-content table {
    border-collapse: collapse;
    width: 100%;
    max-width: calc(100vw - 40px) !important;
    margin-bottom: 16px;
    overflow-x: auto;
    display: block;
}

.readme-content table th,
.readme-content table td {
    border: 1px solid var(--border);
    padding: 8px 12px;
}

.readme-content table th {
    background: var(--light);
    font-weight: 600;
}

/* GitHub-style alignment for centered content */
.readme-content div[align="center"],
.readme-content p[align="center"],
.readme-content center {
    text-align: center;
}

.readme-content sub {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
    bottom: -0.25em;
}

.readme-content sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
    top: -0.5em;
}

.readme-content img {
    max-width: calc(100vw - 40px) !important;
    width: auto;
    height: auto !important;
    border-radius: 4px;
    display: inline-block;
    margin: 16px 0;
    object-fit: contain;
    vertical-align: middle;
}

/* Badge images should display inline with spacing */
.readme-content img[src*="shields.io"],
.readme-content img[src*="badge"] {
    display: inline !important;
    width: auto !important;
    margin: 0 8px 4px 0 !important;
}


/* Hide zero-height images */
.readme-content img[height="0"] {
    display: none;
}

.readme-content a {
    color: var(--primary);
    text-decoration: none;
}

.readme-content a:hover {
    text-decoration: underline;
}

.readme-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

.no-readme {
    color: var(--gray);
    font-style: italic;
    text-align: center;
    padding: 40px 20px;
}

/* GitHub-style Alerts */
.readme-content .markdown-alert {
    padding: 16px;
    margin-bottom: 16px;
    border-radius: 6px;
    border: 1px solid;
}

.readme-content .markdown-alert-title {
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.readme-content .markdown-alert-note {
    background-color: #e3f2fd;
    border-color: #1976d2;
    color: #0d47a1;
}

.readme-content .markdown-alert-tip {
    background-color: #e8f5e9;
    border-color: #388e3c;
    color: #1b5e20;
}

.readme-content .markdown-alert-important {
    background-color: #f3e5f5;
    border-color: #7b1fa2;
    color: #4a148c;
}

.readme-content .markdown-alert-warning {
    background-color: #fff3e0;
    border-color: #f57c00;
    color: #e65100;
}

.readme-content .markdown-alert-caution {
    background-color: #ffebee;
    border-color: #d32f2f;
    color: #b71c1c;
}
