
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
    --bg: #090a12;
    --surface: #111321;
    --surface2: #171a2b;
    --border: #252941;
    --purple: #9065ff;
    --purple-light: #b49aff;
    --text: #f5f5ff;
    --muted: #999bb3;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 8%;
    background: rgba(9, 10, 18, 0.95);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

header h1 {
    font-size: 25px;
    font-weight: 900;
}

nav {
    display: flex;
    gap: 28px;
}

nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: 0.2s;
}

nav a:hover {
    color: var(--purple-light);
}

.hero,
.details-hero {
    text-align: center;
    padding: 110px 20px;
    background: radial-gradient(ellipse at top, #29204e 0%, transparent 65%);
}

.eyebrow {
    color: var(--purple-light);
    font-size: 12px;
    letter-spacing: 3px;
    font-weight: 800;
}

.hero h2,
.details-hero h2 {
    font-size: clamp(34px, 5vw, 58px);
    font-weight: 900;
    line-height: 1.15;
    margin: 20px 0;
}

.hero h2 span,
.details-hero h2 span {
    color: var(--purple-light);
}

.hero p,
.details-hero p {
    color: var(--muted);
    margin-bottom: 30px;
}

.btn {
    display: inline-block;
    background: var(--purple);
    color: white;
    padding: 13px 23px;
    border: none;
    border-radius: 9px;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}

.btn:hover {
    background: #7650dc;
    transform: translateY(-2px);
}

.servers,
.submit-section {
    padding: 85px 8%;
}

.section-heading {
    text-align: center;
    margin-bottom: 35px;
}

.section-heading h2,
.submit-section h2 {
    font-size: 32px;
    margin: 12px 0;
}

.section-heading p,
.submit-section > p {
    color: var(--muted);
}

.server-count {
    display: flex;
    align-items: center;
    gap: 15px;
    width: fit-content;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 15px 25px;
    border-radius: 12px;
    margin: 30px auto;
}

.server-count > span {
    font-size: 30px;
}

.server-count strong {
    display: block;
    font-size: 25px;
}

.server-count small {
    color: var(--muted);
}

#search,
input,
select,
textarea {
    width: 100%;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 14px;
    font-family: inherit;
    outline: none;
    margin: 8px 0;
}

#search:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: var(--purple);
}

.filters {
    display: flex;
    gap: 15px;
    margin: 15px 0 25px;
}

/* SERVER GRID */

#server-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
    gap: 24px;
    align-items: stretch;
}

/* SERVER CARDS */

.server-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 250px;
    background: linear-gradient(145deg, var(--surface2), var(--surface));
    border: 1px solid var(--border);
    padding: 0 25px 25px;
    border-radius: 16px;
    overflow: hidden;
    transition: 0.25s;
}

.server-card:hover {
    border-color: var(--purple);
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(144, 101, 255, 0.10);
}

.server-card h3 {
    font-size: 21px;
    font-weight: 800;
    margin-bottom: 14px;
    overflow-wrap: anywhere;
}

/* SERVER BANNER */

.server-banner {
    display: block;
    width: calc(100% + 50px);
    height: 180px;
    margin: 0 -25px 20px;
    object-fit: cover;
    object-position: center;
    border-radius: 15px 15px 0 0;
    background: var(--surface2);
    flex-shrink: 0;
}

/* TAGS */

.server-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    margin: 4px 0 17px;
}

.server-tags span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(144, 101, 255, 0.13);
    border: 1px solid rgba(144, 101, 255, 0.22);
    color: var(--purple-light);
    padding: 6px 12px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
}

/* DESCRIPTION */

.server-card .server-description {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
    margin: 0 0 16px;
    overflow-wrap: anywhere;
    flex-grow: 1;
}

/* IP */

.server-card .ip,
.ip {
    color: var(--purple-light);
    font-weight: 700;
    font-size: 13px;
    overflow-wrap: anywhere;
    margin: 0 0 18px;
}

/* BUTTONS */

.server-actions {
    display: flex;
    gap: 11px;
    width: 100%;
    margin-top: auto;
}

.card-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 0;
    padding: 12px 10px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: 0.2s;
}

.btn-details {
    background: var(--purple);
    color: white;
}

.btn-copy {
    background: var(--surface2);
    color: var(--purple-light);
    border-color: var(--border);
}

.btn-details:hover,
.btn-copy:hover {
    transform: translateY(-2px);
}

.btn-details:hover {
    background: #7650dc;
}

.btn-copy:hover {
    background: #27213f;
    border-color: var(--purple);
}

.card-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* DISCORD */

.discord-link {
    display: inline-block;
    color: var(--purple-light);
    text-decoration: none;
    margin: 12px 8px 0 0;
    font-weight: 700;
}

/* PAGINATION */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 35px;
}

.pagination button {
    padding: 10px 18px;
    background: var(--surface2);
    color: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#page-info {
    color: var(--muted);
    font-size: 13px;
}

/* SUBMISSION FORM */

.submit-section {
    background: #0d0e19;
    text-align: center;
}

#serverForm {
    max-width: 600px;
    margin: 35px auto 0;
    text-align: left;
}

#serverForm label {
    display: block;
    margin-top: 14px;
    font-size: 14px;
    font-weight: 700;
}

#serverForm textarea {
    min-height: 120px;
    resize: vertical;
}

#serverForm button {
    width: 100%;
    margin-top: 20px;
    background: var(--purple);
    color: white;
    border: none;
    padding: 13px;
    border-radius: 9px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 800;
}

#serverForm button:disabled {
    opacity: 0.6;
    cursor: wait;
}

#formMessage {
    margin-top: 15px;
    color: var(--purple-light);
}

#no-results {
    text-align: center;
    color: var(--muted);
    padding: 25px;
}

.loading-text {
    text-align: center;
    padding: 40px;
    color: var(--muted);
}

/* DETAILS PAGE */

.server-details {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 25px 100px;
}

.back-button {
    display: inline-block;
    color: var(--purple-light);
    text-decoration: none;
    font-weight: 700;
    margin-bottom: 25px;
}

.details-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 24px;
    align-items: start;
}

#server-details-content {
    min-width: 0;
    overflow: hidden;
    background: linear-gradient(145deg, #17162a, #10121e 65%);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25);
}

.details-title {
    font-size: 38px;
    font-weight: 900;
    overflow-wrap: anywhere;
    line-height: 1.2;
}

.details-banner {
    display: block;
    width: calc(100% + 80px);
    max-width: none;
    height: 320px;
    object-fit: cover;
    object-position: center;
    margin: -40px -40px 30px;
    border-radius: 19px 19px 0 0;
    background: var(--surface2);
}

#server-details-content h2 {
    font-size: 19px;
    margin-top: 32px;
    margin-bottom: 10px;
}

#server-details-content p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.9;
    overflow-wrap: anywhere;
}

#server-details-content .server-tags {
    margin: 18px 0 25px;
}

#server-details-content > .ip {
    display: inline-block;
    background: var(--surface2);
    border: 1px solid var(--border);
    padding: 13px 17px;
    border-radius: 9px;
    margin-top: 5px;
}

#server-details-content > .btn-copy {
    display: flex;
    width: 160px;
    min-height: 43px;
    margin-top: 12px;
}

/* DETAILS SIDEBAR */

.details-sidebar {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.sidebar-card {
    background: linear-gradient(145deg, var(--surface2), var(--surface));
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    transition: 0.25s;
}

.sidebar-card:hover {
    border-color: var(--purple);
    transform: translateY(-3px);
}

.sidebar-card h3 {
    font-size: 19px;
    margin: 12px 0;
}

.sidebar-card p {
    color: var(--muted);
    font-size: 13px;
    margin: 12px 0;
}

.sidebar-card .btn {
    display: block;
    text-align: center;
    margin-top: 20px;
}

/* IMAGE UPLOAD */

.upload-section {
    margin-top: 22px;
    text-align: left;
}

.upload-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    padding: 28px 18px;
    margin-top: 10px;
    background: var(--surface);
    border: 2px dashed var(--border);
    border-radius: 13px;
    transition: 0.2s;
}

.upload-box:hover {
    border-color: var(--purple);
}

.upload-icon {
    font-size: 35px;
}

.upload-box strong {
    font-size: 14px;
}

.upload-box p {
    color: var(--muted);
    font-size: 12px;
}

.upload-box input {
    max-width: 300px;
    border: none;
    margin-top: 8px;
}

#imagePreviewContainer {
    margin-top: 15px;
    width: 100%;
}

#imagePreviewContainer[hidden] {
    display: none;
}

#imagePreview {
    display: block;
    width: 100%;
    height: 180px;
    max-height: 180px;
    object-fit: contain;
    object-position: center;
    padding: 8px;
    background: var(--surface2);
    border-radius: 12px;
    border: 1px solid var(--border);
}

#removeImage {
    width: 100%;
    margin-top: 10px;
    padding: 9px 14px;
    background: #302039;
    color: #ffb4c0;
    border: 1px solid #593047;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
}

/* FOOTER */

footer {
    text-align: center;
    padding: 40px 20px;
    background: #070810;
    border-top: 1px solid var(--border);
}

footer h2 {
    margin-bottom: 10px;
}

footer p {
    color: var(--muted);
    font-size: 13px;
    margin: 5px;
}

/* LOGO */

.brand-logo {
    width: 220px;
    height: 85px;
    object-fit: contain;
}

.brand-link {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* MOBILE */

@media (max-width: 800px) {
    .details-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 650px) {
    header {
        flex-direction: column;
        gap: 15px;
    }

    nav {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero,
    .details-hero {
        padding: 75px 18px;
    }

    .servers,
    .submit-section {
        padding: 55px 18px;
    }

    .filters {
        flex-direction: column;
        gap: 5px;
    }

    #server-details-content {
        padding: 23px;
    }

    .details-title {
        font-size: 29px;
    }

    .details-banner {
        width: calc(100% + 46px);
        height: 220px;
        margin: -23px -23px 24px;
    }

    .server-card {
        padding: 0 21px 21px;
    }

    .server-banner {
        width: calc(100% + 42px);
        height: 165px;
        margin: 0 -21px 18px;
    }

    .server-actions {
        gap: 8px;
    }

    .card-button {
        padding: 12px 7px;
        font-size: 11px;
    }

    .brand-logo {
        width: 190px;
        height: 75px;
    }
}

@media (max-width: 380px) {
    .server-actions {
        flex-direction: column;
    }

    .card-button {
        width: 100%;
    }
}
