/* 
 * Fundraiser Grid Frontend Styles
 */

 .agape-fundraiser-wrapper {
    margin: var(--space-xl) 0;
    font-family: 'Montserrat', sans-serif;
}

.fundraiser-stats {
    text-align: center;
    margin-bottom: var(--space-md);
}

.fundraiser-stats h3 {
    margin-bottom: var(--space-xs);
    font-weight: 700;
}

.fundraiser-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    max-width: 400px;
    margin: 0 auto;
}

.progress-bar-wrap {
    flex-grow: 1;
    height: 12px;
    background: var(--neutral-200);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.5s ease;
}

.progress-text {
    font-weight: 600;
    color: var(--primary);
}

.fundraiser-grid-scroll-wrap {
    width: 100%;
    overflow-x: auto;
    padding-top: 90px; /* space for tooltip */
    padding-bottom: 20px; /* space for scrollbar */
}

/* 40 cols * 25 rows = 1000 cells */
.fundraiser-grid {
    display: grid;
    grid-template-columns: repeat(40, 1fr);
    grid-template-rows: repeat(25, 1fr);
    width: 1200px; /* Fixed width to maintain aspect ratio and prevent cells getting too small */
    aspect-ratio: 1.6; /* 40/25 */
    margin: 0 auto;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 2px solid var(--neutral-800);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.fundraiser-cell {
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    cursor: default;
    position: relative;
}

/* Free cells are grayed out but show the image. We use backdrop-filter to make it black & white */
.fundraiser-cell.cell-free {
    background-color: rgba(255, 255, 255, 0.15); /* Very light tint */
    backdrop-filter: grayscale(100%) brightness(0.9);
    -webkit-backdrop-filter: grayscale(100%) brightness(0.9);
}

.fundraiser-cell.cell-free:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Funded cells reveal the colored image underneath and are highlighted */
.fundraiser-cell.cell-funded {
    background-color: transparent; 
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8), inset 0 0 10px rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.5);
    z-index: 2;
}

.fundraiser-cell.cell-funded:hover {
    box-shadow: inset 0 0 0 2px #fff, 0 0 15px rgba(255, 255, 255, 0.8);
    border-color: #fff;
    z-index: 5;
    transform: scale(1.15);
    border-radius: 4px;
}

/* Custom Tooltip element for funded cells */
.fundraiser-cell .fundraiser-tooltip {
    position: absolute;
    bottom: 150%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--white);
    color: var(--neutral-900);
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 20;
    pointer-events: none;
    min-width: 140px;
    text-align: center;
    border: 1px solid var(--neutral-200);
}

.fundraiser-cell:hover .fundraiser-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Tooltip Arrow */
.fundraiser-cell .fundraiser-tooltip::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px 8px 0;
    border-style: solid;
    border-color: var(--white) transparent transparent transparent;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.05));
}

.fundraiser-tooltip-name {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
    color: #0056b3; /* Hard fallback */
    color: var(--primary, #0056b3);
}

.fundraiser-tooltip-amount {
    font-size: 13px;
    font-weight: 600;
    color: #333333; /* Hard fallback */
    color: var(--neutral-600, #333333);
    display: inline-block;
    background: #f0f0f0; /* Hard fallback */
    background: var(--neutral-100, #f0f0f0);
    padding: 2px 10px;
    border-radius: 12px;
}
