/* Reset and Base Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --background: 0, 0%, 5%;
    --foreground: 210 40% 98%;
    --card: 0 0% 10%;
    --card-foreground: 210 40% 98%;
    --border: 0 0% 17%;
    --radius: 0.5rem;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #0D0D0D;
    color: #e5e5e5;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header */
header {
    background: #0D0D0D;
    border-bottom: 1px solid #2C2C2C;
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(13, 13, 13, 0.95);
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 0.95rem;
    color: #878787;
    font-weight: 400;
}

/* Main Content */
main {
    padding: 3rem 0;
    min-height: 100vh;
}

/* Intro Section */
.intro {
    background: #121212;
    border: 1px solid #2C2C2C;
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 3rem;
}

.intro h2 {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.intro p {
    color: #B8B8B8;
    font-size: 1rem;
    line-height: 1.7;
}

/* Search Section */
.search-section {
    margin-bottom: 3rem;
}

.search-box {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
    background: #121212;
    border: 1px solid #2C2C2C;
    color: #fff;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    transition: all 0.2s;
}

.search-box:focus {
    outline: none;
    border-color: #3f3f46;
    background: #161515;
}

.search-box::placeholder {
    color: #606060;
}

/* Filter Buttons */
.filter-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1.25rem;
    border: 1px solid #2C2C2C;
    background: transparent;
    color: #878787;
    border-radius: 9999px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
    font-weight: 500;
}

.filter-btn:hover {
    background: #1D1D1D;
    border-color: #3f3f46;
    color: #fff;
}

.filter-btn.active {
    background: #1D1D1D;
    border-color: #3f3f46;
    color: #fff;
}

/* Section Headers */
.servers h2 {
    color: #fff;
    font-size: 1.5rem;
    margin: 3rem 0 1.5rem 0;
    font-weight: 600;
}

/* Server Grid */
.server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
    margin-bottom: 3rem;
}

/* Server Cards */
.server-card {
    background: #121212;
    border: 1px solid #2C2C2C;
    border-radius: var(--radius);
    padding: 1.5rem;
    text-decoration: none;
    color: #e5e5e5;
    transition: all 0.2s;
    position: relative;
    display: block;
    cursor: pointer;
}

.server-card:hover {
    background: #1D1D1D;
    border-color: #3f3f46;
    transform: translateY(-2px);
}

.server-card h3 {
    color: #fff;
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.server-card p {
    color: #B8B8B8;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 0;
}

/* Badges */
.badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge.official {
    background: #166534;
    color: #fff;
}

.badge.community {
    background: #1e40af;
    color: #fff;
}

/* Footer */
footer {
    background: #0D0D0D;
    border-top: 1px solid #2C2C2C;
    padding: 2rem 0;
    margin-top: 4rem;
}

footer p {
    color: #878787;
    font-size: 0.875rem;
    margin: 0.5rem 0;
    text-align: center;
}

footer a {
    color: #B8B8B8;
    text-decoration: underline;
    transition: color 0.2s;
}

footer a:hover {
    color: #fff;
}

/* Server Detail Pages */
.server-detail {
    background: #121212;
    border: 1px solid #2C2C2C;
    border-radius: var(--radius);
    padding: 2.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.server-header-detail {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #2C2C2C;
    position: relative;
}

.server-icon-large {
    font-size: 3.5em;
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1D1D1D;
    border: 1px solid #2C2C2C;
    border-radius: var(--radius);
    flex-shrink: 0;
}

.server-header-detail h1 {
    color: #fff;
    font-size: 2rem;
    font-weight: 600;
    margin: 0;
}

.server-header-detail .badge {
    position: absolute;
    top: 0;
    right: 0;
}

.server-detail section {
    margin-bottom: 2.5rem;
}

.server-detail h2 {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #2C2C2C;
    font-weight: 600;
}

.server-detail h3 {
    color: #B8B8B8;
    font-size: 1.125rem;
    margin: 1.5rem 0 1rem 0;
    font-weight: 500;
}

.description-section p {
    font-size: 1rem;
    line-height: 1.7;
    color: #B8B8B8;
}

/* Feature Lists */
.features-section ul,
.usage-section ul {
    list-style: none;
    padding: 0;
}

.features-section li,
.usage-section li {
    padding: 0.75rem 0 0.75rem 2rem;
    position: relative;
    color: #B8B8B8;
    font-size: 0.95rem;
}

.features-section li:before,
.usage-section li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: #4ade80;
    font-weight: bold;
    font-size: 1.2em;
}

/* Installation Section */
.installation-section pre {
    background: #0D0D0D;
    border: 1px solid #2C2C2C;
    border-radius: var(--radius);
    padding: 1.25rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.installation-section code {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    color: #e5e5e5;
    line-height: 1.6;
}

.installation-section p {
    color: #B8B8B8;
    margin: 0.5rem 0;
}

/* Resource Links */
.resource-links {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.resource-links li {
    margin-bottom: 0;
}

.resource-links a {
    display: inline-block;
    padding: 0.75rem 1.25rem;
    background: #1D1D1D;
    color: #fff;
    text-decoration: none;
    border: 1px solid #2C2C2C;
    border-radius: var(--radius);
    transition: all 0.2s;
    font-size: 0.95rem;
}

.resource-links a:hover {
    background: #2c2c2c;
    border-color: #3f3f46;
    transform: translateX(5px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    header h1 {
        font-size: 1.25rem;
    }

    .subtitle {
        font-size: 0.875rem;
    }

    .server-grid {
        grid-template-columns: 1fr;
    }

    .filter-buttons {
        flex-wrap: wrap;
    }

    .server-detail {
        padding: 1.5rem;
    }

    .server-header-detail {
        flex-direction: column;
        text-align: center;
    }

    .server-header-detail h1 {
        font-size: 1.5rem;
    }

    .server-icon-large {
        width: 70px;
        height: 70px;
        font-size: 2.5em;
    }

    main {
        padding: 2rem 0;
    }
}

@media (min-width: 1024px) {
    .server-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1280px) {
    .server-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* FAQ Section */
.faq-section {
    margin-top: 4rem;
    padding: 3rem 0;
    border-top: 1px solid #2C2C2C;
}

.faq-section h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2rem;
    text-align: center;
}

.faq-item {
    background: #1A1A1A;
    border: 1px solid #2C2C2C;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: #404040;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.faq-item h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.75rem;
}

.faq-item p {
    color: #999;
    line-height: 1.7;
    font-size: 1rem;
}

@media (max-width: 768px) {
    .faq-section {
        margin-top: 3rem;
        padding: 2rem 0;
    }

    .faq-section h2 {
        font-size: 1.75rem;
        margin-bottom: 1.5rem;
    }

    .faq-item {
        padding: 1.25rem;
        margin-bottom: 1rem;
    }

    .faq-item h3 {
        font-size: 1.1rem;
    }

    .faq-item p {
        font-size: 0.95rem;
    }
}

/* Legal Pages (Privacy, Terms, Contact) */
.legal-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 0;
}

.legal-page h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
}

.legal-page .last-updated {
    color: #999;
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.legal-page section {
    margin-bottom: 2.5rem;
}

.legal-page h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 1rem;
    margin-top: 2rem;
}

.legal-page h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #e5e5e5;
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
}

.legal-page p {
    color: #999;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.legal-page ul {
    color: #999;
    line-height: 1.8;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.legal-page li {
    margin-bottom: 0.5rem;
}

.legal-page a {
    color: #60A5FA;
    text-decoration: none;
    transition: color 0.2s;
}

.legal-page a:hover {
    color: #93C5FD;
    text-decoration: underline;
}

/* Contact Page Specific Styles */
.contact-resources {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.contact-card {
    background: #1A1A1A;
    border: 1px solid #2C2C2C;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.contact-card:hover {
    border-color: #404040;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.contact-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.75rem;
    margin-top: 0;
}

.contact-card p {
    color: #999;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.contact-link {
    display: inline-block;
    color: #60A5FA;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.contact-link:hover {
    color: #93C5FD;
}

/* Footer Links */
.footer-links {
    margin-top: 1rem;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.footer-links a {
    color: #999;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #fff;
}

@media (max-width: 768px) {
    .legal-page {
        padding: 2rem 0;
    }

    .legal-page h1 {
        font-size: 2rem;
    }

    .legal-page h2 {
        font-size: 1.5rem;
    }

    .legal-page h3 {
        font-size: 1.1rem;
    }

    .contact-resources {
        grid-template-columns: 1fr;
    }

    .footer-links {
        flex-direction: column;
        gap: 0.75rem;
        align-items: center;
    }
}
