/* Mods platform (Thunderstore-style) shared styles */

.mods-panel {
    background: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(75, 85, 99, 0.4);
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .mods-panel {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

/* Game cards */
.mods-game-card {
    display: block;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.mods-game-card:hover {
    transform: translateY(-3px);
    border-color: rgba(59, 130, 246, 0.6);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.6);
}

/* Package cards */
.mods-package-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.mods-package-card:hover {
    transform: translateY(-2px);
    border-color: rgba(59, 130, 246, 0.5);
}

.mods-package-icon {
    width: 64px;
    height: 64px;
    border-radius: 0.75rem;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(31, 41, 55, 0.8);
    border: 1px solid rgba(75, 85, 99, 0.5);
}

.mods-package-icon-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 2rem;
}

.mods-version-icon {
    width: 96px;
    height: 96px;
}

/* Tag / category chips */
.mods-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    line-height: 1.25rem;
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.3);
    white-space: nowrap;
}

.mods-chip-neutral {
    background: rgba(107, 114, 128, 0.15);
    color: #9ca3af;
    border-color: rgba(107, 114, 128, 0.3);
}

.mods-chip-warn {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.35);
}

.mods-chip-link {
    text-decoration: none;
    cursor: pointer;
    transition: filter 120ms ease, transform 120ms ease;
}

.mods-chip-link:hover {
    filter: brightness(1.2);
    transform: translateY(-1px);
}

.mods-chip-link:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

[data-theme="light"] .mods-chip {
    color: #1d4ed8;
}

[data-theme="light"] .mods-chip-neutral {
    color: #4b5563;
}

/* Category filter pills */
.mods-pill {
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    border: 1px solid rgba(75, 85, 99, 0.5);
    color: #9ca3af;
    background: rgba(17, 24, 39, 0.5);
    transition: all 0.15s ease;
    cursor: pointer;
}

.mods-pill:hover {
    border-color: rgba(59, 130, 246, 0.5);
    color: #e5e7eb;
}

.mods-pill.is-active {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.6);
    color: #93c5fd;
}

[data-theme="light"] .mods-pill {
    color: #4b5563;
    background: rgba(255, 255, 255, 0.6);
}

[data-theme="light"] .mods-pill.is-active {
    color: #1d4ed8;
}

/* Game category images */
.mods-game-banner {
    aspect-ratio: 16 / 9;
    background: rgba(17, 24, 39, 0.6);
    overflow: hidden;
}

.mods-game-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.25s ease;
}

.mods-game-card:hover .mods-game-banner img {
    transform: scale(1.04);
}

.mods-game-banner-empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mods-game-banner-empty i {
    font-size: 2.5rem;
    color: #4b5563;
}

[data-theme="light"] .mods-game-banner {
    background: rgba(229, 231, 235, 0.8);
}

/* Game page hero banner */
#game-header.has-banner {
    position: relative;
    border-radius: 1rem;
    padding: 2.5rem 1.5rem;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

#game-header.has-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(11, 15, 25, 0.55), rgba(11, 15, 25, 0.88));
}

#game-header.has-banner > * {
    position: relative;
    z-index: 1;
}

#game-header.has-banner h1,
#game-header.has-banner p {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

/* Admin dashboard tag delete button inside tag chips */
.admin-tag-x {
    background: none;
    border: none;
    padding: 0 0 0 0.25rem;
    margin: 0;
    color: inherit;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    opacity: 0.6;
}

.admin-tag-x:hover {
    opacity: 1;
    color: #f87171;
}

/* Smaller pills for the tag filter row */
.mods-pill-sm {
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
}

.mods-chip-count {
    display: inline-block;
    margin-left: 0.375rem;
    padding: 0 0.375rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    line-height: 1.1rem;
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
}

[data-theme="light"] .mods-chip-count {
    background: rgba(0, 0, 0, 0.08);
}

/* Readme / changelog markdown */
.mods-markdown {
    color: #d1d5db;
    line-height: 1.7;
    font-size: 0.9375rem;
    overflow-wrap: break-word;
    word-break: break-word;
}

.mods-markdown h1,
.mods-markdown h2,
.mods-markdown h3,
.mods-markdown h4 {
    color: #f3f4f6;
    font-weight: 700;
    margin: 1.25em 0 0.5em;
    line-height: 1.3;
}

.mods-markdown h1 {
    font-size: 1.5rem;
}

.mods-markdown h2 {
    font-size: 1.25rem;
    border-bottom: 1px solid rgba(75, 85, 99, 0.4);
    padding-bottom: 0.3em;
}

.mods-markdown h3 {
    font-size: 1.1rem;
}

.mods-markdown p {
    margin: 0.75em 0;
}

.mods-markdown a {
    color: #60a5fa;
    text-decoration: underline;
}

.mods-markdown a:hover {
    color: #93c5fd;
}

.mods-markdown ul,
.mods-markdown ol {
    margin: 0.75em 0;
    padding-left: 1.5em;
}

.mods-markdown ul {
    list-style: disc;
}

.mods-markdown ol {
    list-style: decimal;
}

.mods-markdown li {
    margin: 0.25em 0;
}

.mods-markdown code {
    background: rgba(31, 41, 55, 0.8);
    padding: 0.15em 0.4em;
    border-radius: 0.375rem;
    font-size: 0.85em;
    color: #fca5a5;
}

.mods-markdown pre {
    background: rgba(17, 24, 39, 0.9);
    border: 1px solid rgba(75, 85, 99, 0.4);
    border-radius: 0.5rem;
    padding: 0.875rem 1rem;
    overflow-x: auto;
    margin: 0.75em 0;
}

.mods-markdown pre code {
    background: none;
    padding: 0;
    color: #e5e7eb;
    font-size: 0.8125rem;
}

.mods-markdown blockquote {
    border-left: 3px solid rgba(59, 130, 246, 0.5);
    padding-left: 1em;
    color: #9ca3af;
    margin: 0.75em 0;
}

.mods-markdown img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

.mods-markdown table {
    border-collapse: collapse;
    margin: 0.75em 0;
    width: 100%;
    font-size: 0.875rem;
}

.mods-markdown th,
.mods-markdown td {
    border: 1px solid rgba(75, 85, 99, 0.5);
    padding: 0.4em 0.75em;
    text-align: left;
}

.mods-markdown th {
    background: rgba(31, 41, 55, 0.7);
    color: #f3f4f6;
}

.mods-markdown hr {
    border: none;
    border-top: 1px solid rgba(75, 85, 99, 0.5);
    margin: 1.25em 0;
}

[data-theme="light"] .mods-markdown {
    color: #374151;
}

[data-theme="light"] .mods-markdown h1,
[data-theme="light"] .mods-markdown h2,
[data-theme="light"] .mods-markdown h3,
[data-theme="light"] .mods-markdown h4 {
    color: #111827;
}

[data-theme="light"] .mods-markdown code {
    background: rgba(229, 231, 235, 0.8);
    color: #b91c1c;
}

[data-theme="light"] .mods-markdown pre {
    background: rgba(243, 244, 246, 0.9);
}

[data-theme="light"] .mods-markdown pre code {
    color: #1f2937;
}

[data-theme="light"] .mods-markdown th {
    background: rgba(243, 244, 246, 0.9);
    color: #111827;
}

/* Tabs */
.mods-tab {
    padding: 0.5rem 1rem;
    border-bottom: 2px solid transparent;
    color: #9ca3af;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.mods-tab:hover {
    color: #e5e7eb;
}

.mods-tab.is-active {
    color: #60a5fa;
    border-bottom-color: #3b82f6;
}

/* Upload dropzone */
.mods-dropzone {
    border: 2px dashed rgba(75, 85, 99, 0.6);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.mods-dropzone:hover,
.mods-dropzone.is-dragover {
    border-color: rgba(59, 130, 246, 0.7);
    background: rgba(59, 130, 246, 0.05);
}

.mods-dropzone.is-dragover {
    border-style: solid;
}

/* Validation checklist */
.mods-check {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.8125rem;
    padding: 0.25rem 0;
}

.mods-check .ph {
    margin-top: 0.125rem;
    flex-shrink: 0;
}

.mods-check.ok .ph {
    color: #34d399;
}

.mods-check.bad .ph {
    color: #f87171;
}

.mods-check.pending .ph {
    color: #6b7280;
}

/* Forms */
.mods-input,
.mods-select,
.mods-textarea {
    width: 100%;
    background: rgba(17, 24, 39, 0.7);
    border: 1px solid rgba(75, 85, 99, 0.6);
    color: #f3f4f6;
    border-radius: 0.625rem;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mods-input:focus,
.mods-select:focus,
.mods-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.mods-input::placeholder,
.mods-textarea::placeholder {
    color: #6b7280;
}

[data-theme="light"] .mods-input,
[data-theme="light"] .mods-select,
[data-theme="light"] .mods-textarea {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.15);
    color: #111827;
}

.mods-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #d1d5db;
    margin-bottom: 0.375rem;
}

[data-theme="light"] .mods-label {
    color: #374151;
}

/* Tag checkbox grid */
.mods-tag-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.375rem 0.75rem;
}

.mods-tag-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: #d1d5db;
    padding: 0.25rem 0.375rem;
    border-radius: 0.375rem;
    cursor: pointer;
}

.mods-tag-option:hover {
    background: rgba(59, 130, 246, 0.08);
}

.mods-tag-option input {
    accent-color: #3b82f6;
}

[data-theme="light"] .mods-tag-option {
    color: #374151;
}

/* Buttons */
.mods-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.625rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}

.mods-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mods-btn-primary {
    background: #2563eb;
    color: #fff;
}

.mods-btn-primary:hover:not(:disabled) {
    background: #1d4ed8;
}

.mods-btn-secondary {
    background: rgba(75, 85, 99, 0.3);
    border-color: rgba(75, 85, 99, 0.6);
    color: #e5e7eb;
}

.mods-btn-secondary:hover:not(:disabled) {
    background: rgba(75, 85, 99, 0.5);
}

.mods-btn-danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fca5a5;
}

.mods-btn-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.3);
}

.mods-btn-sm {
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    border-radius: 0.5rem;
}

[data-theme="light"] .mods-btn-secondary {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.15);
    color: #374151;
}

/* Progress bar */
.mods-progress-track {
    width: 100%;
    height: 0.5rem;
    background: rgba(31, 41, 55, 0.8);
    border-radius: 9999px;
    overflow: hidden;
}

.mods-progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #2563eb, #60a5fa);
    border-radius: 9999px;
    transition: width 0.2s ease;
}

/* Version rows */
.mods-version-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    justify-content: space-between;
    padding: 0.625rem 0.875rem;
    border-radius: 0.625rem;
    border: 1px solid rgba(75, 85, 99, 0.35);
    background: rgba(17, 24, 39, 0.4);
}

[data-theme="light"] .mods-version-row {
    background: rgba(255, 255, 255, 0.6);
}

.mods-version-row.is-latest {
    border-color: rgba(52, 211, 153, 0.4);
}

/* Empty state */
.mods-empty {
    text-align: center;
    color: #6b7280;
    padding: 3rem 1rem;
}

.mods-empty .ph {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.75rem;
}

/* Skeleton loading */
.mods-skeleton {
    background: linear-gradient(90deg, rgba(31, 41, 55, 0.5) 25%, rgba(55, 65, 81, 0.5) 50%, rgba(31, 41, 55, 0.5) 75%);
    background-size: 200% 100%;
    animation: mods-shimmer 1.4s infinite;
    border-radius: 0.5rem;
}

@keyframes mods-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

@media (max-width: 640px) {
    .mods-package-card {
        flex-direction: column;
    }

    .mods-version-icon {
        width: 72px;
        height: 72px;
    }
}
