﻿.donation-card {
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    font-family: Montserrat, sans-serif;
    background: #f5f5f5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid gray;
    position: relative;
    max-width: 350px;
    min-width:300px;
    margin: 20px auto;
}

    .donation-card:hover {
        transform: translateY(-3px);
    }

/* Header image or placeholder */
.donation-header {
    height: 200px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #000;
}

    .donation-header.placeholder::before {
        content: "Image not available";
        font-style: italic;
        font-size: 0.9rem;
    }

/* Top title with logo */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 16px;
    font-weight: 800;
    font-size: 1rem;
    background-color: var(--bg-color);
    color: #000;
    position: relative;
    min-height: 80px; /* ensure space for content */
}

    .card-header h3,
    .card-header span {
        display: block;
        word-break: break-word;
        white-space: normal;
        padding-right: 50px;
    }

    .card-header::after {
        content: "";
        background-repeat: no-repeat;
        background-size: contain;
        background-position: center;
        width: 54px;
        height: 54px;
        position: absolute;
        top: 16px;
        right: 16px;
        background-image: var(--logo-url);
    }

    /* Optional logo image fallback */
    .card-header img {
        height: 32px;
        width: 32px;
    }

.header-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background-color: #ccc;
}

/* Content */
.donation-content {
    padding: 16px 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.short-summary {
    font-weight: 600;
    font-size: 1rem;
    margin: 0.5rem 0 0.25rem 0;
}

.divider {
    border-bottom: 1px solid #333;
    margin: 0.5rem 0;
    width: 100%;
}

.location {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 0.5rem;
}

.summary {
    font-size: 0.95rem;
    margin-bottom: 1rem;
    color: #333;
}

/* Progress bar */
.progress-container {
    background-color: #ffffff;
    border: 1px solid #ccc;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    margin: 0.5rem 0 0.25rem;
}

.progress-fill {
    height: 100%;
    background-color: var(--theme-color);
    transition: width 0.5s ease-in-out;
}

.progress-text {
    font-size: 0.85rem;
    margin-top: 6px;
    text-align: right;
    font-weight: 500;
    color: #333;
}

/* Donation amounts */
.goal-line {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
    margin: 0.5rem 0 1rem 0;
}

    .goal-line .raised {
        color: var(--theme-color);
    }

/* Donate Button Container */
.button-container {
    background-color: var(--bg-color);
    padding: 20px 24px;
    text-align: center;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

    .button-container .donate-button {
        width: 100%;
        padding: 5px;
        border-radius: 8px;
        background-color: var(--theme-color);
        color:#fff;
        font-weight: bold;
        font-size: 1.1rem;
        text-decoration: none;
        display: inline-block;
    }

    /* Two buttons side-by-side */
    .button-container.dual-buttons {
        display: flex;
        justify-content: space-between;
        gap: 16px;
        padding: 20px 24px;
        background-color: var(--bg-color);
        border-bottom-left-radius: 12px;
        border-bottom-right-radius: 12px;
    }

        .button-container.dual-buttons .donate-button {
            flex: 1 1 50%;
            padding: 5px;
            border-radius: 8px;
            font-weight: bold;
            font-size: 1.1rem;
            text-decoration: none;
            text-align: center;
        }

            /* Primary (Donate) button */
            .button-container.dual-buttons .donate-button.primary {
                background-color: var(--theme-color);
                color: #fff;
            }

            /* Secondary (Learn More) button */
            .button-container.dual-buttons .donate-button.secondary {
                background-color: var(--theme-color);
                color: #fff;
            }

/* Grid layout */
.donation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    justify-content: center;
    gap: 2rem;
}

@media (min-width: 1200px) {
    .donation-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Placeholder fallback */
.placeholder {
    height: 180px;
    background-color: #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-style: italic;
    font-size: 0.9rem;
}

/* THEME DEFINITIONS WITH CSS VARIABLES */
.theme-blue {
    --theme-color: #1d3c6b; /* progress bar + donate button */
    --bg-color: #B7BFCB; /* header + footer */
    --button-bg-color: #1d3c6b;
    --button-text-color: #fff;
    --logo-url: url('/images/default-source/donor-projects/img_mca_logo.png');
}

.theme-red {
    --theme-color: #E20917;
    --bg-color: #E6D8D4;
    --button-bg-color: #E20917;
    --button-text-color: #fff;
    --logo-url: url('/images/default-source/donor-projects/img_tspf_logo.png');
}

.theme-yellow {
    --theme-color: #F2BC12;
    --bg-color: #F7E4BB;
    --button-bg-color: #F2BC12;
    --button-text-color: #fff;
    --logo-url: url('/images/default-source/donor-projects/img_tsspa_logo.png');
}

.theme-green {
    --theme-color: #165342;
    --bg-color: #B6C8C3;
    --button-bg-color: #165342;
    --button-text-color: #fff;
    --logo-url: url('/images/default-source/donor-projects/img_tmu_logo.png');
}

.theme-general {
    --theme-color: #1d3c6b; /* progress bar + donate button */
    --bg-color: #FCFBFB; /* header + footer */
    --button-bg-color: #1d3c6b;
    --button-text-color: #fff;
    --logo-url: url('');
}