/* arkon-kcs-fleet — frontend structural CSS */
/* Theme handles colours, fonts, and visual styling. This file handles layout only. */

.mbt-notice {
    margin: 1em 0;
    padding: 0.75em 1em;
}

.mbt-notice--error {
    border-left: 4px solid currentColor;
}

/* ── Ship grid ───────────────────────────────────────────────────────────────── */

.mbt-ship-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}

.mbt-ship-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Image */
.mbt-ship-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.mbt-ship-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mbt-ship-image-placeholder {
    width: 100%;
    height: 100%;
    background: rgba(128, 128, 128, 0.15);
}

/* Body */
.mbt-ship-body {
    padding: 0.5rem 0.6rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.mbt-ship-member {
    font-size: 0.8em;
    margin: 0;
    opacity: 0.7;
}

.mbt-ship-name {
    margin: 0;
    font-size: 1rem;
}

.mbt-ship-name a {
    text-decoration: none;
}

.mbt-ship-total-count {
    font-size: 0.8em;
    font-weight: 600;
    opacity: 0.55;
    margin-left: 0.3em;
}

.mbt-no-image-marker {
    font-size: 0.75em;
    opacity: 0.45;
    margin-left: 0.2em;
    font-weight: 400;
}

.mbt-ship-type {
    margin: 0;
    font-size: 0.85em;
    opacity: 0.75;
}

.mbt-ship-manufacturer {
    margin: 0;
    font-size: 0.8em;
    opacity: 0.6;
}

/* Badges */
.mbt-ship-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.25rem;
}

.mbt-badge {
    display: inline-block;
    padding: 0.15em 0.5em;
    font-size: 0.75em;
    font-weight: 600;
    border-radius: 3px;
    letter-spacing: 0.03em;
}

/* Badge variants — theme overrides these colours */
.mbt-badge--lti       { background: rgba(0, 180, 120, 0.2); }
.mbt-badge--warbond   { background: rgba(220, 160, 0, 0.2); }
.mbt-badge--unidentified { background: rgba(200, 80, 0, 0.2); }

/* Pledge info */
.mbt-pledge-name,
.mbt-pledge-date,
.mbt-pledge-cost {
    margin: 0;
    font-size: 0.8em;
    opacity: 0.65;
}

/* ── Guild fleet — grouped card extras ──────────────────────────────────────── */

/* Count badge overlaid on image */
.mbt-ship-card--grouped .mbt-ship-image {
    position: relative;
}

.mbt-ship-count {
    position: absolute;
    bottom: 0.4rem;
    right: 0.4rem;
    padding: 0.2em 0.5em;
    font-size: 0.9rem;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.65);
    border-radius: 3px;
    line-height: 1;
}

/* Owner list */
.mbt-ship-owners {
    list-style: none;
    margin: 0.25rem 0 0;
    padding: 0;
    font-size: 0.82em;
}

.mbt-ship-owners li {
    padding: 0.1em 0;
    display: flex;
    align-items: center;
    gap: 0.3em;
}

.mbt-owner-count {
    font-size: 0.85em;
    opacity: 0.65;
}

/* ── Guild fleet totals bar ─────────────────────────────────────────────────── */

.mbt-guild-totals {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9em;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.mbt-guild-total-sep {
    opacity: 0.4;
}

/* ── Filter bar ──────────────────────────────────────────────────────────────── */

.mbt-filters {
    margin-bottom: 1rem;
}

.mbt-filters select {
    margin-left: 0.5rem;
}

/* Hidden cards during filter/pagination */
.mbt-ship-card[hidden] {
    display: none;
}

/* ── Pagination ──────────────────────────────────────────────────────────────── */

.mbt-pagination {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

.mbt-btn-page {
    padding: 0.35em 1em;
    cursor: pointer;
}

.mbt-btn-page:disabled {
    opacity: 0.35;
    cursor: default;
}

.mbt-page-info {
    font-size: 0.9em;
    opacity: 0.75;
}

/* ── Summary stats ───────────────────────────────────────────────────────────── */

.mbt-summary {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.mbt-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mbt-stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.mbt-stat-label {
    font-size: 0.8rem;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mbt-stat--muted .mbt-stat-value,
.mbt-stat--muted .mbt-stat-label {
    opacity: 0.4;
}

/* ── Import form ─────────────────────────────────────────────────────────────── */

.mbt-import-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(128, 128, 128, 0.2);
}

.mbt-import-heading {
    margin-top: 0;
}

.mbt-import-file-row {
    margin: 0.75rem 0;
}

/* Fallback textarea — hidden by default, revealed by JS on error */
.mbt-import-fallback {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    border-left: 3px solid currentColor;
    opacity: 0.85;
}

.mbt-import-fallback-label {
    font-size: 0.875em;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.mbt-import-fallback textarea {
    width: 100%;
    font-family: monospace;
    font-size: 0.82em;
    display: block;
    margin: 0.5rem 0;
    box-sizing: border-box;
}

.mbt-btn {
    cursor: pointer;
    padding: 0.5em 1.25em;
}

#mbt-import-result {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.9em;
}
