/* Servers page additions. Everything else comes from site.css and benchmarks.css */
.server-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.server-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--bg3);
}

.server-icon-empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--muted);
}

/* Light + text label: colour is never the only signal */
.status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--mono);
    font-size: 13px;
    color: var(--text);
    white-space: nowrap;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--muted);
}

.status-dot.online {
    background: var(--good);
    box-shadow: 0 0 0 3px rgba(61, 232, 154, 0.18);
}

.status-dot.offline {
    background: var(--danger);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.18);
}

.status-dot.unknown {
    background: var(--muted);
}

.server-desc {
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--muted);
    overflow-wrap: anywhere;
}

/* Cards here are not links */
.server-card {
    cursor: default;
}

/* Form */
.feature-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: 8px;
    cursor: pointer;
}

.feature-option input {
    margin-top: 3px;
    accent-color: var(--accent);
}

.feature-name {
    font-family: var(--mono);
    font-size: 13px;
}

textarea.form-control {
    resize: vertical;
}

.icon-input {
    display: flex;
    align-items: center;
    gap: 12px;
}


/* Icon picker (image library) */
.server-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 10px;
}

.server-picker-item {
    padding: 0;
    border: 2px solid var(--border2);
    border-radius: 10px;
    background: var(--bg3);
    overflow: hidden;
    aspect-ratio: 1;
    cursor: pointer;
}

.server-picker-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.server-picker-item:hover,
.server-picker-item.selected {
    border-color: var(--accent);
}

.icon-input {
    flex-wrap: wrap;
}

/* Fields directly under the feature they belong to */
.feature-fields {
    margin: 8px 0 4px 34px;
}

/* The status check is a small option under the address field, not a feature block of its own */
.status-option {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed var(--border2);
    font-size: 0.85rem;
}

.status-option-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    cursor: pointer;
}

.status-option-check input {
    accent-color: var(--accent);
}

.status-option-fields {
    margin: 8px 0 0 24px;
}

.status-option-row {
    margin-bottom: 8px;
}

/* The whole card is the link to the detail page: the name's link is stretched over the card.
   Buttons and links inside the card stay clickable above it. */
.server-card {
    position: relative;
}

.server-link {
    color: inherit;
    text-decoration: none;
}

.server-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.server-card:hover {
    border-color: var(--accent);
}

.server-link:focus-visible::after {
    outline: 3px solid var(--accent);
    outline-offset: -3px;
    border-radius: var(--radius);
}

.server-card .card-actions a,
.server-card .card-actions button {
    position: relative;
    z-index: 2;
}

/* Category dropdown with the gear icon that opens the Edit categories page */
.category-input {
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-input .form-select {
    flex: 1;
}

/* Refresh button while the pull is running */
.spin {
    display: inline-block;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .spin {
        animation: none;
    }
}

/* Shown after an admin started or restarted a server, until the status check sees it online */
.status-dot.starting {
    background: var(--warn, #f0b429);
    box-shadow: 0 0 0 3px rgba(240, 180, 41, 0.18);
}
