/**
 * YukPeduli Campaign Widget Styles (Grid & List View)
 */

:root {
    --yp-primary: #10b981;
    --yp-primary-dark: #059669;
    --yp-primary-light: #ecfdf5;
    --yp-text-main: #0f172a;
    --yp-text-muted: #64748b;
    --yp-border: #e2e8f0;
    --yp-bg-card: #ffffff;
    --yp-radius: 16px;
    --yp-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --yp-shadow-hover: 0 14px 20px -4px rgba(15, 23, 42, 0.12), 0 8px 8px -4px rgba(15, 23, 42, 0.04);
}

.yp-campaign-wrapper {
    width: 100%;
    margin: 24px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    box-sizing: border-box;
}

.yp-campaign-wrapper *,
.yp-campaign-wrapper *::before,
.yp-campaign-wrapper *::after {
    box-sizing: border-box;
}

/* ==========================================================================
   GRID LAYOUT
   ========================================================================== */
.yp-campaigns-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.yp-campaigns-grid.yp-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.yp-campaigns-grid.yp-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.yp-campaigns-grid.yp-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* ==========================================================================
   CARD STRUCTURE
   ========================================================================== */
.yp-card {
    background: var(--yp-bg-card);
    border: 1px solid var(--yp-border);
    border-radius: var(--yp-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--yp-shadow);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s;
    text-decoration: none !important;
    color: inherit !important;
}

.yp-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--yp-shadow-hover);
    border-color: #cbd5e1;
}

/* Thumbnail */
.yp-card-thumb-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
    background: #f1f5f9;
}

.yp-card-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.yp-card:hover .yp-card-thumb {
    transform: scale(1.04);
}

/* Badges */
.yp-badge-wrap {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    z-index: 2;
}

.yp-badge {
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.2;
    backdrop-filter: blur(8px);
}

.yp-badge-category {
    background: rgba(15, 23, 42, 0.75);
    color: #ffffff;
}

.yp-badge-emergency {
    background: #ef4444;
    color: #ffffff;
}

.yp-badge-urgent {
    background: #f59e0b;
    color: #ffffff;
}

/* Card Body */
.yp-card-body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.yp-card-fundraiser {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--yp-text-muted);
    margin-bottom: 6px;
}

.yp-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--yp-text-main);
    line-height: 1.4;
    margin: 0 0 10px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 44px;
}

.yp-card-desc {
    font-size: 13px;
    color: var(--yp-text-muted);
    line-height: 1.5;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Progress Bar */
.yp-progress-wrap {
    margin-top: auto;
    padding-top: 10px;
}

.yp-progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
    position: relative;
    margin-bottom: 10px;
}

.yp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--yp-primary) 0%, var(--yp-primary-dark) 100%);
    border-radius: 9999px;
    transition: width 0.6s ease;
}

/* Stats Row */
.yp-stats-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}

.yp-stat-item {
    display: flex;
    flex-direction: column;
}

.yp-stat-label {
    font-size: 11px;
    color: var(--yp-text-muted);
    margin-bottom: 2px;
}

.yp-stat-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--yp-primary);
}

.yp-stat-target {
    font-size: 12px;
    font-weight: 600;
    color: var(--yp-text-main);
    text-align: right;
}

/* Meta Footer: Donors & Days Left */
.yp-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 12px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--yp-text-muted);
}

.yp-meta-donors,
.yp-meta-days {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* CTA Button */
.yp-btn-donate {
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px 16px;
    margin-top: 14px;
    background: linear-gradient(135deg, var(--yp-primary) 0%, var(--yp-primary-dark) 100%);
    color: #ffffff !important;
    font-size: 13px;
    font-weight: 700;
    border-radius: 10px;
    text-decoration: none !important;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.yp-btn-donate:hover {
    background: linear-gradient(135deg, var(--yp-primary-dark) 0%, #047857 100%);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35);
    transform: translateY(-1px);
}

/* ==========================================================================
   LIST LAYOUT
   ========================================================================== */
.yp-campaigns-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.yp-campaigns-list .yp-card {
    flex-direction: row;
}

.yp-campaigns-list .yp-card-thumb-wrap {
    width: 220px;
    padding-top: 0;
    height: auto;
    flex-shrink: 0;
}

.yp-campaigns-list .yp-card-body {
    padding: 18px 20px;
}

.yp-campaigns-list .yp-card-title {
    font-size: 17px;
    min-height: auto;
}

.yp-campaigns-list .yp-card-desc {
    -webkit-line-clamp: 2;
}

.yp-campaigns-list .yp-btn-donate {
    width: auto;
    align-self: flex-start;
    padding: 8px 22px;
}

/* ==========================================================================
   RESPONSIVE QUERIES
   ========================================================================== */
@media (max-width: 1024px) {
    .yp-campaigns-grid.yp-cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .yp-campaigns-grid.yp-cols-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .yp-campaigns-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    }
    .yp-campaigns-list .yp-card {
        flex-direction: column;
    }
    .yp-campaigns-list .yp-card-thumb-wrap {
        width: 100%;
        padding-top: 56.25%;
    }
    .yp-campaigns-list .yp-btn-donate {
        width: 100%;
    }
}

/* ==========================================================================
   SWIPER / CAROUSEL SLIDER STYLES
   ========================================================================== */
.yp-swiper-outer {
    position: relative;
    width: 100%;
}

.yp-swiper-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 6px 4px 44px;
}

.yp-swiper-container .swiper-wrapper {
    display: flex;
    box-sizing: border-box;
}

.yp-swiper-container .swiper-slide {
    height: auto !important;
    display: flex !important;
    box-sizing: border-box;
    flex-shrink: 0;
}

.yp-swiper-container .swiper-slide .yp-card {
    width: 100%;
    height: 100%;
}

/* Swiper List Style Adaptation */
.yp-swiper-container.yp-style-list .yp-card {
    flex-direction: row;
}

.yp-swiper-container.yp-style-list .yp-card-thumb-wrap {
    width: 200px;
    padding-top: 0;
    height: auto;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .yp-swiper-container.yp-style-list .yp-card {
        flex-direction: column;
    }
    .yp-swiper-container.yp-style-list .yp-card-thumb-wrap {
        width: 100%;
        padding-top: 56.25%;
    }
}

/* Navigation Buttons (Prev / Next) */
.yp-swiper-btn-prev,
.yp-swiper-btn-next {
    position: absolute !important;
    top: 45% !important;
    transform: translateY(-50%) !important;
    width: 40px !important;
    height: 40px !important;
    margin-top: 0 !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.15) !important;
    border: 1px solid #e2e8f0 !important;
    color: #10b981 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    z-index: 10 !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.yp-swiper-btn-prev {
    left: -16px !important;
}

.yp-swiper-btn-next {
    right: -16px !important;
}

.yp-swiper-btn-prev:after,
.yp-swiper-btn-next:after {
    font-size: 15px !important;
    font-weight: 900 !important;
    color: #10b981 !important;
}

.yp-swiper-btn-prev:hover,
.yp-swiper-btn-next:hover {
    background: #10b981 !important;
    border-color: #10b981 !important;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35) !important;
    transform: translateY(-50%) scale(1.08) !important;
}

.yp-swiper-btn-prev:hover:after,
.yp-swiper-btn-next:hover:after {
    color: #ffffff !important;
}

.yp-swiper-btn-prev.swiper-button-disabled,
.yp-swiper-btn-next.swiper-button-disabled {
    opacity: 0.3 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* Pagination Dots */
.yp-swiper-pagination {
    position: absolute !important;
    bottom: 8px !important;
    left: 0 !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    z-index: 10 !important;
}

.yp-swiper-pagination .swiper-pagination-bullet {
    width: 8px !important;
    height: 8px !important;
    background: #cbd5e1 !important;
    opacity: 1 !important;
    margin: 0 !important;
    border-radius: 50% !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    cursor: pointer !important;
}

.yp-swiper-pagination .swiper-pagination-bullet-active {
    background: #10b981 !important;
    width: 22px !important;
    border-radius: 9999px !important;
}

@media (max-width: 768px) {
    .yp-swiper-btn-prev {
        left: 2px !important;
    }
    .yp-swiper-btn-next {
        right: 2px !important;
    }
}

