/* Reusable game-mod picker component styles.
   Loaded on the provision wizard and instance Mods blades. */

.mod-picker {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ----- Performance warning banner (shown on every mod control) ----- */
.mod-picker-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid rgba(245, 176, 65, 0.45);
    border-left: 3px solid #f5b041;
    border-radius: 8px;
    background: rgba(245, 176, 65, 0.1);
}

.mod-picker-warning-icon {
    font-size: 1.1rem;
    line-height: 1.35;
    color: #f5b041;
    flex-shrink: 0;
}

.mod-picker-warning-body {
    min-width: 0;
}

.mod-picker-warning-title {
    display: block;
    font-size: 0.92rem;
    color: #f5c16b;
    margin-bottom: 0.15rem;
}

.mod-picker-warning-text {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--text-muted, #aeb4c2);
}

/* ----- Service-account credentials (e.g. Factorio Mod Portal) -----
   Flat layout: the fields sit inline with the rest of the form (no boxed
   background, border or padding). */
.mod-picker-creds {
    display: block;
}

.mod-picker-creds-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.mod-picker-creds-title {
    font-weight: 600;
    color: var(--text, #e6e8ee);
    font-size: 0.95rem;
}

.mod-picker-creds-required {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #ffcf6b;
    background: rgba(255, 207, 107, 0.12);
    border: 1px solid rgba(255, 207, 107, 0.35);
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
}

.mod-picker-creds-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

@media (max-width: 560px) {
    .mod-picker-creds-grid {
        grid-template-columns: 1fr;
    }
}

.mod-picker-creds-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mod-picker-creds-input.is-invalid {
    border-color: #e5484d;
}

.mod-picker-creds-error {
    margin-top: 0.55rem;
    color: #ff8a8d;
    font-size: 0.82rem;
}

.mod-picker-search {
    position: relative;
}

/* Floating result list — overlays the form instead of pushing content down. */
.mod-picker-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    margin-top: 0.4rem;
    border: 1px solid var(--border-color, #2a2f3a);
    border-radius: 8px;
    background: var(--surface-2, #1a1e27);
    max-height: 340px;
    overflow-y: auto;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.mod-picker-result {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-color, #2a2f3a);
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    color: var(--text, #e6e8ee);
}

.mod-picker-result:last-child {
    border-bottom: none;
}

.mod-picker-result:hover {
    background: var(--surface-3, #232834);
}

.mod-picker-status {
    font-size: 0.85rem;
    color: var(--text-muted, #9aa3b2);
    min-height: 1.1rem;
    margin-top: 0.25rem;
}

.mod-picker-selected {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mod-picker-empty {
    color: var(--text-muted, #9aa3b2);
    font-size: 0.9rem;
    margin: 0;
    padding: 0.5rem 0;
}

.mod-picker-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--border-color, #2a2f3a);
    border-radius: 8px;
    background: var(--surface-2, #1a1e27);
}

.mod-picker-item-info {
    flex: 1;
    min-width: 0;
}

.mod-picker-item-title {
    font-weight: 600;
    color: var(--text, #e6e8ee);
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.mod-picker-item-version {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted, #9aa3b2);
}

.mod-picker-item-author {
    font-size: 0.8rem;
    color: var(--text-muted, #9aa3b2);
}

.mod-picker-item-desc {
    font-size: 0.8rem;
    color: var(--text-muted, #9aa3b2);
    margin-top: 0.15rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.mod-picker-add {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent, #5b8cff);
    flex-shrink: 0;
    white-space: nowrap;
}

.mod-picker-remove {
    background: transparent;
    border: none;
    color: var(--text-muted, #9aa3b2);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem 0.4rem;
    border-radius: 6px;
    flex-shrink: 0;
}

.mod-picker-remove:hover {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}
