/* ============================================
   Redesigned Report Card — Matches Reference UI
   ============================================ */

:root {
    --card-radius: 1rem;
    --transition-speed: 0.4s;
    --primary-color: #2563eb;
}

/* ── Card Shell ─────────────────────────────── */
.report-card {
    background-color: #ffffff;
    border-radius: var(--card-radius);
    margin-bottom: 1.25rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08), 0 0 1px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    max-width: 100%;
}

.report-card:active {
    transform: scale(0.995);
}

/* ── Front / Back Layers ────────────────────── */
.report-front,
.report-back {
    width: 100%;
    height: 100%;
    transition: opacity var(--transition-speed) ease, visibility var(--transition-speed);
}

.report-front {
    opacity: 1;
    visibility: visible;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.report-back {
    position: absolute;
    top: 0;
    left: 0;
    background-color: #ffffff;
    opacity: 0;
    visibility: hidden;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.25rem;
    z-index: 10;
}

.report-card.revealed .report-front {
    opacity: 0.1;
    filter: blur(4px);
}

.report-card.revealed .report-back {
    opacity: 1;
    visibility: visible;
}

/* ── Card Header (Avatar Row) ───────────────── */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6b7280, #9ca3af);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
    object-fit: cover;
}

.avatar-circle.object-cover {
    object-fit: cover;
}

.user-text {
    display: flex;
    flex-direction: column;
}

.username {
    font-weight: 700;
    font-size: 0.9rem;
    color: #1a1a1a;
    line-height: 1.2;
}

.time-ago {
    font-size: 0.72rem;
    color: #9ca3af;
    line-height: 1.3;
}

/* Three-dot menu icon in header */
.card-menu-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.15s;
}

.card-menu-btn:hover {
    background: #f3f4f6;
}

.card-menu-btn svg {
    width: 20px;
    height: 20px;
}

/* Three-dot menu wrapper & dropdown */
.card-menu-wrapper {
    position: relative;
}

.card-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 160px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    z-index: 50;
    padding: 0.35rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px) scale(0.96);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
    pointer-events: none;
}

.card-menu-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.card-menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: none;
    background: none;
    font-size: 0.82rem;
    font-weight: 500;
    color: #374151;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.card-menu-item:hover {
    background: #f3f4f6;
}

.card-menu-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.card-menu-item-danger {
    color: #ef4444;
}

.card-menu-item-danger:hover {
    background: #fef2f2;
    color: #dc2626;
}

.card-menu-empty {
    padding: 0.5rem 0.75rem;
    font-size: 0.78rem;
    color: #9ca3af;
    text-align: center;
}

/* ── Image Section ──────────────────────────── */
.card-image-wrapper {
    position: relative;
    width: 100%;
}

.card-image {
    width: calc(100% - 1.5rem);
    height: 300px;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    border-radius: 0.625rem;
    margin: 0 0.75rem;
    position: relative;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, object-fit 0.3s ease;
    border-radius: 0.625rem;
}

/* When user toggles to "contain" mode */
.card-image img.img-contain {
    object-fit: contain;
    background-color: #1a1a1a;
}

.report-card.revealed .card-image img {
    transform: scale(1.05);
}

/* Fit/Fill toggle button on image */
.img-fit-toggle {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.15s ease;
    z-index: 4;
}

.card-image:hover .img-fit-toggle,
.card-image:active .img-fit-toggle {
    opacity: 1;
}

/* Always show on touch devices */
@media (hover: none) {
    .img-fit-toggle {
        opacity: 1;
    }
}

.img-fit-toggle:hover {
    background: rgba(0, 0, 0, 0.75);
}

.img-fit-toggle svg {
    width: 18px;
    height: 18px;
}

/* Status Badge — Overlaid on image top-left */
.status-overlay {
    position: absolute;
    top: 0.75rem;
    left: 1.25rem;
    z-index: 5;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    border-radius: 0.45rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.status-pill.pending {
    background-color: rgba(255, 237, 213, 0.92);
    color: #c2410c;
}

.status-pill.resolved {
    background-color: rgba(220, 252, 231, 0.92);
    color: #15803d;
}

.status-pill.in-progress {
    background-color: rgba(219, 234, 254, 0.92);
    color: #1d4ed8;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.status-pill.pending .status-dot {
    background-color: #22c55e;
}

.status-pill.resolved .status-dot {
    background-color: #22c55e;
}

.status-pill.in-progress .status-dot {
    background-color: #3b82f6;
}

.status-pill.pending-verification {
    background-color: rgba(232, 222, 248, 0.92);
    color: #6d28d9;
}

.status-pill.pending-verification .status-dot {
    background-color: #7c3aed;
}

/* ── Rating Section ────────────────────────── */
.rating-section {
    padding: 0.5rem 1rem;
}

.rating-star {
    color: #d1d5db;
    user-select: none;
    transition: color 0.15s, transform 0.15s;
}

.rating-star.filled {
    color: #f59e0b;
}

.rating-star.clickable:hover {
    color: #f59e0b;
    transform: scale(1.25);
}

/* ── Title + Follow Row ─────────────────────── */
.card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem 0.25rem;
}

.card-issue-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
    flex: 1;
    min-width: 0;
}

/* ── Follow Button — Fixed size, no layout shift ── */
.follow-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.35rem;
    color: #9ca3af;
    transition: color 0.25s ease, transform 0.15s ease;
    flex-shrink: 0;
    margin-left: 0.5rem;
    /* FIXED dimensions to prevent layout shifting */
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    border-radius: 10px;
    position: relative;
}

.follow-btn svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    transition: fill 0.25s ease, stroke 0.25s ease, transform 0.2s ease;
}

.follow-btn .follow-text {
    font-size: 0.55rem;
    font-weight: 600;
    line-height: 1;
    display: block;
    white-space: nowrap;
    /* Fixed height so text changes don't shift layout */
    height: 10px;
    overflow: hidden;
    text-align: center;
    max-width: 48px;
}

.follow-btn:hover {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.06);
}

.follow-btn:active {
    transform: scale(0.9);
}

/* Active following state — filled icon */
.follow-btn.active-follow {
    color: #2563eb;
}

.follow-btn.active-follow svg {
    fill: #2563eb;
    stroke: #2563eb;
}

/* Legacy class kept for JS compatibility */
.follow-btn.text-\[\#2563eb\] {
    color: #2563eb;
}

.follow-btn.text-\[\#2563eb\] svg {
    fill: #2563eb;
    stroke: #2563eb;
}

/* Follow animation — stays in place, no shift */
.follow-btn .follow-text.animating-count {
    animation: followCountPulse 5s forwards;
}

@keyframes followCountPulse {
    0% {
        opacity: 0;
    }

    8% {
        opacity: 1;
    }

    80% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

/* ── Description ────────────────────────────── */
.card-description {
    padding: 0.25rem 1rem 0.5rem;
    font-size: 0.85rem;
    color: #4b5563;
    line-height: 1.55;
}

.card-description .more-link {
    display: inline;
    background-color: #fef08a;
    color: #1a1a1a;
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    text-decoration: none;
    cursor: pointer;
    margin-left: 2px;
    transition: background 0.15s;
}

.card-description .more-link:hover {
    background-color: #fde047;
}

/* ── Assigned-To Footer — Redesigned ─────────── */
.card-footer {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1rem;
    border-top: 1px solid #f3f4f6;
    margin-top: 0.25rem;
}

.card-footer-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #2563eb;
}

.card-footer-icon svg {
    width: 16px;
    height: 16px;
}

.card-footer-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.card-footer-label {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    line-height: 1.2;
}

.card-footer-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.35;
    /* Show full name, wrap if needed */
    white-space: normal;
    word-break: break-word;
}

/* ── Legacy Actions (hidden in new design, kept for compat) ─ */
.card-actions {
    display: none;
}

.action-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary, #1a1a1a);
    cursor: pointer;
    transition: all 0.2s ease;
    background: none;
    border: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.issue-tag {
    margin-left: auto;
    font-size: 0.8rem;
    color: #9ca3af;
    font-weight: 500;
}

/* ── Back Content ───────────────────────────── */
.back-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #9ca3af;
    margin-bottom: 0.25rem;
    font-weight: 700;
}

.back-content {
    font-size: 1rem;
    color: #1a1a1a;
    line-height: 1.5;
}

.detail-group {
    border-left: 3px solid #2563eb;
    padding-left: 1rem;
}

/* ── Swipe Instruction ──────────────────────── */
.swipe-instruction {
    text-align: center;
    padding: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #9ca3af;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    cursor: default;
}

.chevrons {
    display: inline-block;
    letter-spacing: -2px;
    animation: slideRight 1.5s infinite;
    color: #2563eb;
}

@keyframes slideRight {
    0% {
        transform: translateX(0);
        opacity: 0.5;
    }

    50% {
        transform: translateX(5px);
        opacity: 1;
    }

    100% {
        transform: translateX(0);
        opacity: 0.5;
    }
}

/* ── Desktop ────────────────────────────────── */
.desktop-reveal-btn {
    display: none;
    width: 100%;
    padding: 0.6rem;
    text-align: center;
    background-color: transparent;
    border: none;
    border-top: 1px solid #f3f4f6;
    color: #2563eb;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.desktop-reveal-btn:hover {
    background-color: rgba(37, 99, 235, 0.05);
}

/* ── Responsive ─────────────────────────────── */
@media (max-width: 640px) {
    .report-card {
        border-radius: 1rem;
        margin-bottom: 1rem;
    }

    .card-image {
        height: 260px;
    }

    .swipe-instruction {
        padding-top: 0;
        padding-bottom: 0.4rem;
        background: transparent;
        border-top: none;
    }
}

@media (min-width: 768px) {
    .swipe-instruction {
        display: none;
    }

    .desktop-reveal-btn {
        display: block;
    }

    .report-card:active {
        transform: none;
    }
}

/* ══════════════════════════════════════════════
   FILTER PANEL STYLES
   ══════════════════════════════════════════════ */

/* Filter button in header */
.filter-btn-redesigned {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    border-radius: 10px;
    border: 1.5px solid #e5e7eb;
    background: #ffffff;
    color: #374151;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.filter-btn-redesigned:hover {
    border-color: #2563eb;
    color: #2563eb;
    background: #f0f9ff;
}

.filter-btn-redesigned.has-filters {
    border-color: #2563eb;
    color: #2563eb;
    background: #eff6ff;
}

.filter-btn-redesigned svg {
    width: 16px;
    height: 16px;
}

.filter-count-badge {
    background: #2563eb;
    color: #ffffff;
    font-size: 0.6rem;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.filter-btn-redesigned.has-filters .filter-count-badge {
    display: flex;
}

/* Filter Panel — slides down below header */
.filter-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
    opacity: 0;
    background: #ffffff;
    border-bottom: 1px solid transparent;
}

.filter-panel.open {
    max-height: 500px;
    opacity: 1;
    border-bottom-color: #f3f4f6;
}

.filter-panel-inner {
    padding: 1rem 1rem 0.75rem;
    max-width: 48rem;
    margin: 0 auto;
}

.filter-section {
    margin-bottom: 0.75rem;
}

.filter-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #9ca3af;
    margin-bottom: 0.5rem;
    display: block;
}

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

.filter-chip {
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    border: 1.5px solid #e5e7eb;
    background: #ffffff;
    color: #4b5563;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
}

.filter-chip:hover {
    border-color: #93c5fd;
    background: #f0f9ff;
}

.filter-chip.selected {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 600;
}

.filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f3f4f6;
}

.filter-clear-btn {
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    border: none;
    background: none;
    color: #9ca3af;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s;
    font-family: 'Inter', sans-serif;
}

.filter-clear-btn:hover {
    color: #ef4444;
}

.filter-apply-btn {
    padding: 0.4rem 1rem;
    border-radius: 8px;
    border: none;
    background: #2563eb;
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    font-family: 'Inter', sans-serif;
}

.filter-apply-btn:hover {
    background: #1e40af;
}

.filter-apply-btn:active {
    transform: scale(0.97);
}

/* ── Skeleton Loading ───────────────────────── */
.skeleton-card {
    background-color: #ffffff;
    border-radius: var(--card-radius);
    margin-bottom: 1.25rem;
    min-height: 420px;
    padding: 0;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
}

.skeleton-header {
    padding: 0.875rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.skeleton-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #e5e7eb;
}

.skeleton-text-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
}

.skeleton-line {
    height: 10px;
    background: #e5e7eb;
    border-radius: 4px;
}

.skeleton-line.short {
    width: 40%;
}

.skeleton-line.medium {
    width: 70%;
}

.skeleton-image {
    width: calc(100% - 1.5rem);
    height: 260px;
    margin: 0 0.75rem;
    border-radius: 0.625rem;
    background: #e5e7eb;
}

.skeleton-actions {
    padding: 0.75rem 1rem;
    height: 50px;
    background: #ffffff;
}

.animate-pulse {
    animation: skeletonPulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes skeletonPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}