/* ffs-grid.css — Financial Statements Grid */
.ffs-statements-wrapper { max-width: 1200px; margin: 0 auto; padding: 20px 0; }

/* Filter Bar */
.ffs-filter-bar {
    display: flex; flex-wrap: wrap; gap: 12px 24px;
    align-items: center; margin-bottom: 20px;
    padding: 16px 20px; background: #f8f9fa;
    border-radius: 8px; border: 1px solid #e9ecef;
}
.ffs-filter-group { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ffs-filter-label { font-weight: 600; font-size: 13px; color: #555; margin-right: 4px; }
.ffs-filter-btn {
    padding: 6px 16px; border: 2px solid #ddd; border-radius: 20px;
    background: #fff; color: #444; font-size: 13px; cursor: pointer;
    transition: all .2s ease;
}
.ffs-filter-btn:hover { border-color: #C8102E; color: #C8102E; }
.ffs-filter-btn.active { background: #C8102E; border-color: #C8102E; color: #fff; font-weight: 600; }

.ffs-search-group { margin-left: auto; }
#ffs-search {
    padding: 8px 16px; border: 2px solid #ddd; border-radius: 20px;
    font-size: 14px; min-width: 220px; outline: none;
    transition: border-color .2s;
}
#ffs-search:focus { border-color: #C8102E; }

.ffs-results-count { font-size: 13px; color: #888; margin-bottom: 20px; }

/* ── Slider Track ── */
.ffs-slider-wrapper {
    position: relative;
    margin: 0 -14px;
}

.ffs-slider-track {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    padding: 12px 14px 24px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;        /* Firefox */
    -ms-overflow-style: none;     /* IE/Edge */
}

.ffs-slider-track::-webkit-scrollbar {
    display: none;                /* Chrome/Safari */
}

/* ── Cards in slider ── */
.ffs-card {
    flex: 0 0 300px;              /* fixed card width */
    scroll-snap-align: start;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
    transition: transform .25s ease, box-shadow .25s ease;
    display: flex;
    flex-direction: column;
    min-height: 420px;
}
.ffs-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(200,16,46,.13);
}

/* ── Arrow Navigation Buttons ── */
.ffs-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: #1a1a2e;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all .2s ease;
}

.ffs-arrow:hover {
    background: #C8102E;
    color: #fff;
    box-shadow: 0 6px 20px rgba(200,16,46,.3);
}

.ffs-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: #f3f4f6;
    color: #9ca3af;
    box-shadow: none;
}

.ffs-arrow-left  { left: -18px; }
.ffs-arrow-right { right: -18px; }

/* ── Dot Indicators ── */
.ffs-dots {
    display: flex;
    justify-content: center;
    gap: 7px;
    margin-top: 4px;
    padding-bottom: 8px;
}

.ffs-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d1d5db;
    border: none;
    cursor: pointer;
    transition: all .25s ease;
    padding: 0;
}

.ffs-dot.active {
    background: #C8102E;
    width: 24px;
    border-radius: 4px;
}

/* ── Card count badge ── */
.ffs-slider-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.ffs-card-counter {
    font-size: 13px;
    color: #9ca3af;
}

.ffs-card-counter span {
    color: #C8102E;
    font-weight: 700;
}

.ffs-card-icon {
    padding: 0;                    /* remove old padding */
    width: 100%;
    height: 180px;
    overflow: hidden;
    border-radius: 10px 10px 0 0;  /* match card top radius */
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* PDF fallback icon when no thumbnail */
.ffs-pdf-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #fff0f2 0%, #ffe4e8 100%);
}
.ffs-pdf-icon svg {
    width: 64px;
    height: 64px;
}
.ffs-card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;             /* fills width, crops nicely */
    object-position: center top;
    border-radius: 10px 10px 0 0;
    display: block;
}

.ffs-card-body { padding: 16px 20px; flex: 1; }
.ffs-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ffs-tag {
    display: inline-block; padding: 3px 10px; border-radius: 12px;
    font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px;
}
.ffs-tag-type { background: #fff0f3; color: #C8102E; border: 1px solid #f5c6cb; }
.ffs-tag-year { background: #f0f4ff; color: #3b5bdb; border: 1px solid #bac8ff; }

.ffs-card-title {
    font-size: 16px; font-weight: 700; margin: 0 0 8px;
    color: #1a1a2e; line-height: 1.4;
}
.ffs-card-excerpt { font-size: 13px; color: #6b7280; margin: 0 0 10px; line-height: 1.5; }
.ffs-card-date { font-size: 12px; color: #9ca3af; }

.ffs-card-footer {
    padding: 14px 20px; border-top: 1px solid #f3f4f6;
    background: #fafafa;
}
.ffs-btn {
    display: inline-block; padding: 9px 20px; border-radius: 6px;
    font-size: 13px; font-weight: 600; text-decoration: none;
    transition: all .2s ease; width: 100%; text-align: center; box-sizing: border-box;
}
.ffs-btn-download {
    background: #C8102E; color: #fff !important; border: 2px solid #C8102E;
}
.ffs-btn-download:hover { background: #a50d26; border-color: #a50d26; }
.ffs-btn-view {
    background: transparent; color: #C8102E !important; border: 2px solid #C8102E;
}
.ffs-btn-view:hover { background: #C8102E; color: #fff !important; }

/* ── No results ── */
.ffs-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
    width: 100%;
}
.ffs-no-results button {
    margin-top: 12px;
    padding: 8px 20px;
    background: #C8102E;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

/* ── Mobile: show scroll hint ── */
@media (max-width: 768px) {
    .ffs-card         { flex: 0 0 82vw; }
    .ffs-arrow        { display: none; }
    .ffs-slider-track { padding-bottom: 16px; }
}

@media (max-width: 480px) {
    .ffs-card { flex: 0 0 90vw; }
}

/* ── PDF Modal Viewer ── */
.ffs-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 20, 0.82);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.ffs-modal-overlay.active {
    display: flex;
}

.ffs-modal {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 960px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,0.4);
    animation: ffsModalIn 0.25s ease;
}

@keyframes ffsModalIn {
    from { opacity: 0; transform: scale(0.96) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.ffs-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #fafafa;
    flex-shrink: 0;
}

.ffs-modal-title {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

.ffs-modal-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.ffs-modal-download {
    padding: 7px 16px;
    background: #C8102E;
    color: #fff !important;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.ffs-modal-close {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #fff;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    line-height: 1;
    transition: all 0.15s;
}

.ffs-modal-close:hover {
    background: #fee2e2;
    border-color: #C8102E;
    color: #C8102E;
}

.ffs-modal-body {
    flex: 1;
    overflow: hidden;
    background: #525659;
    position: relative;
}

.ffs-modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* PDF not supported fallback */
.ffs-pdf-fallback {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #fff;
    text-align: center;
    gap: 12px;
    padding: 40px;
}

.ffs-pdf-fallback p {
    font-size: 15px;
    opacity: 0.85;
    margin: 0;
}

/* ── Card footer — two buttons ── */
.ffs-card-footer {
    padding: 14px 20px;
    border-top: 1px solid #f3f4f6;
    background: #fafafa;
    display: flex;
    gap: 8px;
}

.ffs-btn-download {
    flex: 1;
    background: #C8102E;
    color: #fff !important;
    border: 2px solid #C8102E;
}

.ffs-btn-download:hover { background: #a50d26; border-color: #a50d26; }

.ffs-btn-preview {
    flex: 1;
    background: transparent;
    color: #C8102E !important;
    border: 2px solid #C8102E;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    text-align: center;
    padding: 9px 10px;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    box-sizing: border-box;
}

.ffs-btn-preview:hover {
    background: #C8102E;
    color: #fff !important;
}

/* Mobile modal */
@media (max-width: 640px) {
    .ffs-modal { height: 95vh; border-radius: 10px 10px 0 0; }
    .ffs-modal-overlay { padding: 0; align-items: flex-end; }
    .ffs-modal-title { font-size: 13px; }
}