/* The Workbench — game mods showcase */

.workbench-hero {
    padding: 140px 0 60px;
    position: relative;
    overflow: hidden;
}

.workbench-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.filter-chip {
    padding: 8px 16px;
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--color-bg-card);
    color: var(--color-text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.filter-chip:hover,
.filter-chip.active {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(99, 102, 241, 0.1);
}

.mod-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.mod-card {
    background: var(--color-bg-card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.mod-card:hover {
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}

.mod-card-header {
    padding: 20px 20px 12px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.mod-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.mod-card-body {
    padding: 0 20px 16px;
    flex: 1;
}

.mod-card-body h3 {
    margin: 0 0 6px;
    font-size: 1.1rem;
}

.mod-game-label {
    font-size: 0.8rem;
    color: var(--color-primary);
    margin-bottom: 8px;
}

.mod-card-footer {
    padding: 12px 20px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.mod-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mod-badge {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 100px;
    font-weight: 600;
}

.mod-badge.updated {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.mod-badge.status-planned { background: rgba(99, 102, 241, 0.15); color: var(--color-primary); }
.mod-badge.status-in-development { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.mod-badge.status-released { background: rgba(34, 197, 94, 0.15); color: #22c55e; }

.mod-vote-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.vote-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    transition: var(--transition);
}

.vote-btn:hover { border-color: var(--color-primary); color: var(--color-text); }
.vote-btn.voted-up { border-color: #22c55e; color: #22c55e; }
.vote-btn.voted-down { border-color: #ef4444; color: #ef4444; }

/* Mod detail sections */
.mod-detail-section {
    padding: 80px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mod-detail-section:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.mod-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

@media (max-width: 768px) {
    .mod-detail-grid { grid-template-columns: 1fr; }
    .game-page-header { flex-direction: column; }
    .wb-cta-card { flex-direction: column; align-items: flex-start; }
}

.download-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.download-link-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--color-bg-card);
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.platform-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

button.platform-link {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

button.platform-link:hover {
    opacity: 0.9;
}

.platform-icon-wrap {
    position: relative;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.platform-icon {
    width: 24px;
    height: 24px;
    border-radius: 5px;
    object-fit: contain;
    display: block;
}

.platform-icon-fallback {
    display: none;
    width: 24px;
    height: 24px;
    border-radius: 5px;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    align-items: center;
    justify-content: center;
}

.platform-icon-wrap:not(:has(img)),
.platform-icon-wrap img[src=""] {
    display: inline-flex;
}

.platform-icon-wrap:not(:has(img)) .platform-icon-fallback,
.platform-icon-wrap img[src=""] + .platform-icon-fallback {
    display: inline-flex;
}

.platform-link-label {
    line-height: 1.3;
}

.download-count {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    white-space: nowrap;
}

.download-link-item a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

.media-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.media-thumb {
    aspect-ratio: 16/10;
    border-radius: 8px;
    background: var(--color-bg-card);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.changelog-entry {
    padding: 16px;
    background: var(--color-bg-card);
    border-radius: var(--border-radius-sm);
    margin-bottom: 12px;
    border-left: 3px solid var(--color-primary);
}

.mod-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

/* Dynamic form modal */
.wb-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.wb-modal-overlay.active { display: flex; }

.wb-modal {
    background: var(--color-bg-card);
    border-radius: var(--border-radius);
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.wb-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wb-modal-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
}

.wb-modal-close:hover { color: var(--color-text); }

.wb-modal-body { padding: 24px; }

.wb-form-group { margin-bottom: 16px; }

.wb-form-group > label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}

.wb-form-group input,
.wb-form-group select,
.wb-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--color-bg);
    color: var(--color-text);
    font-family: inherit;
}

.wb-form-group input[type="radio"],
.wb-form-group input[type="checkbox"] {
    width: auto;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
    accent-color: var(--color-primary);
}

.wb-form-group input[type="file"] {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--border-radius-sm);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.15);
    color: var(--color-text-muted);
    font-family: inherit;
    cursor: pointer;
}

.wb-form-group input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    background: var(--color-primary);
    color: #fff;
    font-family: inherit;
    cursor: pointer;
}

.wb-form-status {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 12px;
    min-height: 1.2em;
}

.wb-field-notice {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--border-radius-sm);
    border-left: 3px solid rgba(255, 255, 255, 0.15);
    margin-bottom: 8px;
}

.wb-file-input-disabled {
    opacity: 0.45;
    pointer-events: none;
}

.wb-hp-field {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.wb-form-group .required { color: #ef4444; }

.wb-radio-group,
.wb-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}

.wb-radio-group.is-horizontal,
.wb-checkbox-group.is-horizontal {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px 24px;
    align-items: center;
}

.wb-choice-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    cursor: pointer;
    width: auto;
    margin: 0;
    line-height: 1.3;
}

.wb-choice-label span {
    white-space: normal;
}

/* Hub sections */
.wb-section { padding: 72px 0; }
.wb-section-alt { background: rgba(255, 255, 255, 0.02); }
.wb-section-compact { padding: 48px 0; text-align: center; }
.wb-hidden { display: none !important; }
.wb-empty { color: var(--color-text-muted); text-align: center; padding: 32px; grid-column: 1 / -1; }
.section-desc { color: var(--color-text-muted); margin-top: 8px; }
.wb-field-help { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 4px; }
.wb-form-error { color: #ef4444; font-size: 0.9rem; margin-top: 12px; }

.workbench-hero-compact { padding: 120px 0 48px; }

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.game-card {
    display: block;
    padding: 24px;
    background: var(--color-bg-card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--border-radius);
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.game-card:hover {
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}

.game-card h3 { margin: 12px 0 8px; font-size: 1.1rem; }
.game-card p { font-size: 0.85rem; color: var(--color-text-muted); line-height: 1.5; margin: 0; }
.game-card-meta { display: inline-block; margin-top: 12px; font-size: 0.75rem; color: var(--color-primary); font-weight: 600; }

.game-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.game-card-icon.large {
    width: 72px;
    height: 72px;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.game-page-header {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    margin-top: 16px;
}

.wb-back-link {
    display: inline-block;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.wb-back-link:hover { color: var(--color-primary); }

.wb-cta-card {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: center;
    justify-content: space-between;
    padding: 32px;
    background: var(--color-bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius);
}

.wb-cta-card h3 { margin: 0 0 8px; }
.wb-cta-card p { margin: 0; color: var(--color-text-muted); max-width: 520px; line-height: 1.6; }

.wb-actions-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.mod-badge.featured {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.wb-admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    align-items: center;
}

.wb-admin-toolbar input,
.wb-admin-toolbar select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--color-bg);
    color: var(--color-text);
    font-family: inherit;
    min-width: 180px;
}

.wb-group-header td {
    background: rgba(99, 102, 241, 0.08);
    font-weight: 600;
    padding: 10px 16px !important;
    color: var(--color-primary);
}
