/* NFA Academy — Subject Library Styles */

.nfa-library-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Header ──────────────────────────────────────────────── */
.nfa-library-header {
    text-align: center;
    padding: 48px 0 32px;
    border-bottom: 2px solid #e8e8e8;
    margin-bottom: 32px;
}

.nfa-library-title {
    font-size: 2.2em;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px;
}

.nfa-library-subtitle {
    color: #666;
    font-size: 1.05em;
    margin: 0;
}

/* ── Filters ─────────────────────────────────────────────── */
.nfa-library-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 32px;
    padding: 20px;
    background: #f7f9f7;
    border-radius: 10px;
}

.nfa-filter-group {
    flex: 1;
    min-width: 180px;
}

.nfa-filter-input,
.nfa-filter-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95em;
    background: white;
    color: #1a1a1a;
    transition: border-color 0.2s;
}

.nfa-filter-input:focus,
.nfa-filter-select:focus {
    outline: none;
    border-color: #2c5f2e;
    box-shadow: 0 0 0 2px rgba(44,95,46,0.15);
}

.nfa-filter-status {
    flex: 0 0 auto;
}

.nfa-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    color: #555;
    cursor: pointer;
    white-space: nowrap;
}

.nfa-toggle-label input {
    accent-color: #2c5f2e;
    width: 16px;
    height: 16px;
}

/* ── Grid ────────────────────────────────────────────────── */
.nfa-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 280px));
    gap: 20px;
    margin-bottom: 40px;
    justify-content: start;
}

/* ── Subject Card ────────────────────────────────────────── */
.nfa-subject-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    border: 1px solid #e8e8e8;
}

.nfa-subject-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.nfa-card-coming {
    opacity: 0.82;
}

/* Image */
.nfa-card-image-wrap {
    position: relative;
    /* 3:4 portrait ratio — tall enough to show faces */
    aspect-ratio: 3 / 4;
    background: #e8ede8;
    overflow: hidden;
    cursor: zoom-in;
}

.nfa-card-image {
    width: 100%;
    height: 100%;
    /* cover fills card, top-center anchors to face area */
    object-fit: cover;
    object-position: center 15%;
    display: block;
    transition: transform 0.3s ease;
}

/* Zoom out slightly on hover so user sees more of the image */
.nfa-card-image-wrap:hover .nfa-card-image {
    transform: scale(1.06);
    object-position: center 20%;
}

.nfa-card-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2c5f2e 0%, #4a8c4d 100%);
}

.nfa-card-initial {
    font-size: 5em;
    font-weight: 700;
    color: rgba(255,255,255,0.7);
    font-family: Georgia, serif;
}

/* Lightbox overlay for full image view */
.nfa-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}
.nfa-lightbox.active {
    display: flex;
}
.nfa-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.nfa-lightbox-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.8);
    font-size: 0.85em;
    text-align: center;
    max-width: 600px;
    background: rgba(0,0,0,0.4);
    padding: 6px 16px;
    border-radius: 20px;
}
.nfa-lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    color: white;
    font-size: 2em;
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
    opacity: 0.8;
}
.nfa-lightbox-close:hover { opacity: 1; }

.nfa-card-image-credit {
    position: absolute;
    bottom: 0;
    right: 0;
    background: rgba(0,0,0,0.5);
    color: rgba(255,255,255,0.8);
    font-size: 0.65em;
    padding: 2px 6px;
    border-top-left-radius: 4px;
}

.nfa-card-coming-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.6);
    color: white;
    font-size: 0.75em;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Body */
.nfa-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nfa-card-name {
    font-size: 1.1em;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.3;
}

.nfa-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.nfa-card-years,
.nfa-card-era,
.nfa-card-domain {
    font-size: 0.78em;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.nfa-card-years  { background: #f0f4f0; color: #555; }
.nfa-card-era    { background: #e8f0e8; color: #2c5f2e; }
.nfa-card-domain { background: #f0e8f8; color: #6b4c8f; }

.nfa-card-blurb {
    font-size: 0.88em;
    color: #555;
    line-height: 1.55;
    margin: 0;
    flex: 1;
}

/* Progress */
.nfa-card-progress {
    margin-top: auto;
}

.nfa-progress-bar {
    height: 5px;
    background: #e8e8e8;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.nfa-progress-fill {
    height: 100%;
    background: #2c5f2e;
    border-radius: 3px;
    transition: width 0.3s;
}

.nfa-progress-label {
    font-size: 0.75em;
    color: #888;
}

/* Achievements */
.nfa-card-achievements ul {
    margin: 0;
    padding: 0 0 0 16px;
    font-size: 0.82em;
    color: #555;
}

.nfa-card-achievements li {
    margin-bottom: 2px;
}

/* Footer */
.nfa-card-footer {
    padding: 16px 20px;
    border-top: 1px solid #f0f0f0;
}

.nfa-card-btn {
    display: block;
    text-align: center;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}

.nfa-btn-active {
    background: #2c5f2e;
    color: white;
}

.nfa-btn-active:hover {
    background: #234c25;
    color: white;
    text-decoration: none;
}

.nfa-btn-coming {
    background: #f0f0f0;
    color: #999;
    cursor: default;
}

/* ── Pagination ──────────────────────────────────────────── */
.nfa-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 32px 0;
}

.nfa-page-btn {
    padding: 10px 20px;
    background: #2c5f2e;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: background 0.2s;
}

.nfa-page-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.nfa-page-btn:not(:disabled):hover {
    background: #234c25;
}

.nfa-page-info {
    color: #666;
    font-size: 0.9em;
}

/* ── Empty State ─────────────────────────────────────────── */
.nfa-empty-library {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

/* ── Loading Overlay ─────────────────────────────────────── */
.nfa-loading {
    position: relative;
    min-height: 200px;
}

.nfa-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
    .nfa-library-grid {
        grid-template-columns: 1fr;
    }
    .nfa-library-filters {
        flex-direction: column;
    }
    .nfa-filter-group {
        width: 100%;
    }
}

/* Hide placeholder when image URL is present — shown via JS if image fails */
.nfa-card-image ~ .nfa-card-image-placeholder {
    display: none;
}

/* Image processing status banner on dashboard */
.nfa-image-status {
    background: #fff8e1;
    border-left: 4px solid #f9a825;
    border-radius: 6px;
    padding: 14px 18px;
    margin-top: 16px;
    font-size: 0.9em;
    line-height: 1.6;
}
