/* ===========================================
   MSiMDb — Incomplete Entries Page
   =========================================== */

/* --- Entry cards (float-based, matching main site .section) --- */

.incomplete-entry {
    position: relative;
    overflow: hidden;
}

.incomplete-entry::after {
    content: "";
    display: block;
    clear: both;
}

.incomplete-entry .entry-meta {
    margin: 0.3em 0;
}

.incomplete-entry .meta-line {
    margin: 0.15em 0;
}

.incomplete-entry .is-missing {
    color: #ffb0b0;
    background: rgba(170, 17, 17, 0.12);
    border-left: 3px solid #AA1111;
    padding: 0.15em 0.5em;
    border-radius: 3px;
}

.incomplete-entry .reason-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4em;
    margin: 0.5em 0;
}

.badge {
    display: inline-block;
    background-color: rgba(180, 130, 50, 0.2);
    color: #e8c870;
    padding: 0.3em 0.6em;
    border-radius: 4px;
    font-size: 0.85em;
    border: 1px solid rgba(200, 150, 60, 0.4);
}

.badge--pending {
    border: 1px dashed #5a8a5a;
    background: rgba(40, 80, 40, 0.3);
}

.badge-pending-label {
    font-size: 0.8em;
    color: #8c8;
}

/* Entry link — subtle, not a button */
.incomplete-entry .entry-link,
.incomplete-entry .entry-link:visited,
.incomplete-entry a.entry-link {
    color: #888 !important;
    background: none !important;
    text-decoration: none;
    font-size: 0.8rem;
    padding: 0;
    display: inline;
}

.incomplete-entry .entry-link:hover {
    color: #ccc !important;
    text-decoration: underline;
}

/* --- Suggestion area --- */

.suggestion-area {
    clear: both;
    padding-top: 0.5em;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 0.5em;
}

.suggest-toggle {
    appearance: none;
    border: 1px solid #444;
    background: #222;
    color: #ccc;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: background 0.2s, border-color 0.2s;
    width: 100%;
}

.suggest-toggle:hover {
    background: #2a2a2a;
    border-color: #666;
}

.suggest-toggle--open {
    background: #333;
    border-color: #888;
}

.suggest-toggle--submitted {
    background: #1a3a1a;
    border-color: #2a5a2a;
    color: #8c8;
    cursor: default;
}

/* --- Suggestion form --- */

.suggestion-form {
    margin-top: 0.75rem;
    padding: 1rem;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
}

.suggestion-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.6rem 1rem;
    margin-bottom: 1rem;
}

.suggestion-field label {
    display: block;
    font-size: 0.85rem;
    color: #aaa;
    margin-bottom: 0.25rem;
}

.suggestion-field label .optional {
    color: #666;
    font-style: italic;
}

.suggestion-input {
    width: 100%;
    padding: 0.45rem 0.6rem;
    border: 1px solid #444;
    border-radius: 6px;
    background: #252525;
    color: #eee;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.suggestion-input:focus {
    border-color: #0077cc;
    outline: none;
}

.suggestion-input--disabled {
    border-color: #333;
    background: #1a1a1a;
    color: #666;
    font-style: italic;
}

.suggestion-submit-btn {
    appearance: none;
    border: none;
    background: #0055aa;
    color: #fff;
    border-radius: 8px;
    padding: 0.6rem 1.5rem;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s;
}

.suggestion-submit-btn:hover { background: #0066cc; }
.suggestion-submit-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* --- Filter bar (collapsible <details>) --- */

details.filter-bar {
    border: 1px solid #2a2a2a !important;
    border-radius: 8px;
    background: #141414;
    margin: 0.5em 5px 1em 5px;
    overflow: hidden;
}

details.filter-bar > summary {
    background: #1a1a1a !important;
    color: #aaa;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 7px;
    list-style: none;
    cursor: pointer;
}

details.filter-bar > summary:hover {
    background: #252525 !important;
}

details.filter-bar > summary::-webkit-details-marker { display: none; }

details.filter-bar > summary::after {
    content: '▸';
    transition: transform 0.2s;
}

details.filter-bar[open] > summary::after {
    transform: rotate(90deg);
}

details.filter-bar[open] > summary {
    border-radius: 7px 7px 0 0;
}

.filter-bar-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 1rem 0.75rem 1rem;
}

.filter-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    flex: 1;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.filter-label {
    font-size: 0.85rem;
    color: #aaa;
    font-weight: 500;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.filter-bar .filter-btn,
.filter-btn {
    appearance: none;
    border: 1px solid #2f2f2f;
    background: #1f1f1f;
    color: #ccc;
    border-radius: 999px;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.filter-btn:hover {
    background: #2c2c2c;
}

.filter-btn.active,
.filter-btn.filter-include {
    background: #0055aa;
    border-color: #0077dd;
    color: #fff;
}

.filter-btn.filter-exclude {
    background: #6b2222;
    border-color: #993333;
    color: #faa;
    text-decoration: line-through;
}

.filter-count {
    color: #cfd8e5;
    font-size: 0.9rem;
    white-space: nowrap;
    align-self: center;
}

/* --- Turnstile widget --- */

#turnstile-global {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

#turnstile-global.turnstile-visible {
    opacity: 1;
    pointer-events: auto;
}

#turnstile-global.turnstile-solved {
    opacity: 0.15;
    pointer-events: none;
    transition: opacity 1.5s ease 0.5s;
}

#turnstile-global.turnstile-solved:hover {
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.2s ease;
}

/* --- Toast notifications --- */

.suggestion-toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 9999;
    max-width: min(360px, calc(100vw - 2rem));
}

.suggestion-toast {
    padding: 0.9rem 1rem;
    border-radius: 10px;
    color: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    transition: opacity 0.3s, transform 0.3s;
}

.suggestion-toast--success { background: #2c6b2f; }
.suggestion-toast--error { background: #a42f2f; }
.suggestion-toast--hide { opacity: 0; transform: translateY(-8px); }

/* --- No results --- */

.no-results {
    text-align: center;
    padding: 2em;
    background-color: var(--section-background-color);
    border-radius: 8px;
    color: var(--text-secondary-color, #aaa);
}

/* --- Mobile --- */

@media (max-width: 600px) {
    .suggestion-fields {
        grid-template-columns: 1fr !important;
    }

    .filter-bar-inner {
        flex-direction: column;
        gap: 0.5rem;
    }

    .filter-btn {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
}
