/**
 * Simple Fundraiser - Frontend Styles
 */

/* Container */
.sf-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Archive Header */
.sf-archive-header {
    text-align: center;
    margin-bottom: 40px;
}

.sf-archive-title {
    font-size: 2.5rem;
    color: #1a1a2e;
    margin: 0 0 10px;
}

.sf-archive-desc {
    color: #666;
    font-size: 1.1rem;
    margin: 0;
}

/* Campaign Grid */
.sf-campaigns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.sf-campaign-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.sf-campaign-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.sf-campaign-image {
    aspect-ratio: 16/9;
    overflow: hidden;
}

.sf-campaign-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.sf-campaign-card:hover .sf-campaign-image img {
    transform: scale(1.05);
}

.sf-campaign-content {
    padding: 20px;
}

.sf-campaign-title {
    font-size: 1.25rem;
    margin: 0 0 15px;
    line-height: 1.4;
}

.sf-campaign-title a {
    color: #1a1a2e;
    text-decoration: none;
}

.sf-campaign-title a:hover {
    color: #16a085;
}

/* Progress Bar */
.sf-campaign-progress {
    margin-bottom: 15px;
}

.sf-progress-bar {
    background: #e9ecef;
    border-radius: 10px;
    height: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.sf-progress-bar-large {
    height: 14px;
}

.sf-progress-fill {
    background: linear-gradient(90deg, #16a085, #1abc9c);
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease-out;
}

.sf-progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.sf-raised {
    color: #16a085;
    font-weight: 600;
}

.sf-goal {
    color: #666;
}

.sf-progress-percent {
    text-align: right;
    color: #16a085;
    font-size: 0.9rem;
}

.sf-campaign-deadline {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 15px;
}

.sf-campaign-deadline .dashicons {
    vertical-align: middle;
    margin-right: 5px;
}

.sf-campaign-button {
    display: block;
    text-align: center;
    padding: 12px 24px;
    background: linear-gradient(90deg, #16a085, #1abc9c);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: opacity 0.3s;
}

.sf-campaign-button:hover {
    opacity: 0.9;
    color: #fff;
}

.sf-campaign-donors {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 15px;
}

.sf-campaign-donors .dashicons {
    vertical-align: middle;
    margin-right: 5px;
}

/* Single Campaign */
.sf-single-campaign {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 40px;
}

@media (max-width: 900px) {
    .sf-single-campaign {
        grid-template-columns: 1fr;
    }
}

.sf-single-main {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.sf-single-image {
    margin: -30px -30px 20px;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
}

.sf-single-image img {
    width: 100%;
    height: auto;
}

.sf-single-title {
    font-size: 2rem;
    color: #1a1a2e;
    margin: 0 0 20px;
}

.sf-single-content {
    font-size: 1rem;
    line-height: 1.8;
    color: #444;
    margin-bottom: 30px;
}

/* Sidebar Cards */
.sf-single-sidebar>div {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.sf-progress-card {
    text-align: center;
}

.sf-raised-amount {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #16a085;
}

.sf-goal-text {
    display: block;
    color: #666;
    margin-bottom: 15px;
}

.sf-progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 0.9rem;
}

.sf-campaign-dates {
    text-align: right;
}

.sf-date-start {
    display: block;
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 2px;
}

.sf-date-start .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin-right: 2px;
}

.sf-days-left {
    display: block;
    color: #e74c3c;
    font-weight: 500;
}

/* Payment Card */
.sf-payment-card h3 {
    margin: 0 0 20px;
    color: #1a1a2e;
    font-size: 1.2rem;
}

.sf-payment-card h4 {
    color: #666;
    font-size: 0.9rem;
    text-transform: uppercase;
    margin: 20px 0 10px;
}

.sf-qris-image {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.sf-qris-image img {
    max-width: 200px;
    height: auto;
}

.sf-bank-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
}

.sf-bank-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.sf-bank-row:last-child {
    border-bottom: none;
}

.sf-bank-label {
    color: #666;
}

.sf-bank-value {
    font-weight: 600;
    color: #1a1a2e;
}

.sf-account-number {
    font-family: monospace;
    font-size: 1.1rem;
}

.sf-payment-note {
    font-size: 0.85rem;
    color: #666;
    margin: 15px 0 0;
    font-style: italic;
}

/* Share Card */
.sf-share-card h4 {
    margin: 0 0 15px;
    color: #1a1a2e;
}

.sf-share-buttons {
    display: flex;
    gap: 10px;
}

.sf-share-buttons a {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 6px;
    text-decoration: none;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
}

.sf-share-wa {
    background: #25D366;
}

.sf-share-fb {
    background: #1877F2;
}

.sf-share-tw {
    background: #1DA1F2;
}

/* Recent Donations */
.sf-recent-donations h3 {
    margin: 0 0 20px;
    color: #1a1a2e;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.sf-donations-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sf-donation-item {
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
}

.sf-donation-item:last-child {
    border-bottom: none;
}

.sf-donation-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.sf-donor-name {
    color: #1a1a2e;
}

.sf-donation-amount {
    color: #16a085;
    font-weight: 600;
}

.sf-donation-message {
    font-style: italic;
    color: #666;
    font-size: 0.9rem;
    margin: 5px 0;
}

.sf-donation-date {
    font-size: 0.8rem;
    color: #999;
}

/* Typography Improvements */
.sf-single-content p {
    margin-bottom: 1.5em;
}

/* QRIS Centering */
.sf-qris-image {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Toggle Button */
#sf-toggle-donations {
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

#sf-toggle-donations:hover {
    background: #f0f0f0;
    color: #333;
}

.sf-no-donations,
.sf-no-campaigns {
    text-align: center;
    color: #666;
    padding: 40px;
}

/* Confirm Button */
.sf-confirm-button {
    display: block;
    text-align: center;
    margin-top: 15px;
    padding: 10px;
    background: #25D366;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s;
}

.sf-confirm-button:hover {
    background: #128C7E;
    color: #fff;
}

/* Back Link */
.sf-back-link {
    display: inline-block;
    margin-top: 30px;
    color: #16a085;
    text-decoration: none;
}

.sf-back-link:hover {
    text-decoration: underline;
}

/* Pagination */
.nav-links {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.nav-links a,
.nav-links span {
    padding: 10px 15px;
    border-radius: 6px;
    text-decoration: none;
}

.nav-links a {
    background: #fff;
    color: #16a085;
}

.nav-links a:hover {
    background: #16a085;
    color: #fff;
}


/* Donation Contols & Pagination */
.sf-donation-type-badge {
    display: inline-block;
    background: #e9ecef;
    color: #666;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 5px;
    vertical-align: middle;
}

.sf-donation-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.sf-sort-form label {
    margin-right: 5px;
    color: #666;
}

.sf-sort-form select {
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-size: 0.9rem;
}

.sf-pagination {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: center;
}

.sf-pagination ul.page-numbers {
    display: flex;
    justify-content: center;
    gap: 5px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.sf-pagination ul.page-numbers li {
    margin: 0;
    padding: 0;
}

.sf-pagination a.page-numbers,
.sf-pagination span.page-numbers {
    display: block;
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #666;
    font-size: 0.9rem;
    line-height: normal;
}

.sf-pagination span.page-numbers.current {
    background: #16a085;
    color: white;
    border-color: #16a085;
}

.sf-pagination a.page-numbers:hover {
    background: #f8f9fa;
    border-color: #ccc;
}

/* Loading State */
#sf-donations-wrapper {
    position: relative;
    min-height: 200px;
}

#sf-donations-wrapper.sf-loading::after {
    content: "";
    position: absolute;
    top: 100px;
    left: 50%;
    width: 40px;
    height: 40px;
    margin-left: -20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #16a085;
    border-radius: 50%;
    animation: sf-spin 1s linear infinite;
    z-index: 10;
}

@keyframes sf-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ============================================
   CAMPAIGN WIDGET STYLES
   ============================================ */

.sf-campaigns-widget {
    margin: 20px 0;
}

.sf-widget-title {
    font-size: 1.5rem;
    color: #1a1a2e;
    margin: 0 0 20px;
    font-weight: 600;
}

.sf-widget-no-campaigns {
    color: #666;
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

/* ----- Featured Grid Layout ----- */
.sf-widget-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.sf-widget-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sf-widget-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.sf-card-image {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.sf-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.sf-widget-card:hover .sf-card-image img {
    transform: scale(1.05);
}

.sf-card-content {
    padding: 16px;
}

.sf-card-title {
    font-size: 1rem;
    margin: 0 0 12px;
    font-weight: 600;
    line-height: 1.4;
}

.sf-card-title a {
    color: #1a1a2e;
    text-decoration: none;
}

.sf-card-title a:hover {
    color: #16a085;
}

.sf-card-progress {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.sf-card-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #16a085, #1abc9c);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.sf-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #666;
}

.sf-card-amount {
    font-weight: 600;
    color: #16a085;
}

.sf-card-donors {
    color: #888;
}

/* ----- Carousel Layout ----- */
.sf-widget-carousel {
    position: relative;
    padding: 0 50px;
}

.sf-carousel-viewport {
    overflow: hidden;
}

.sf-carousel-track {
    display: flex;
    transition: transform 0.4s ease;
}

.sf-carousel-slide {
    flex: 0 0 100%;
    min-width: 100%;
    padding: 0 10px;
    box-sizing: border-box;
}

/* Ensure cards inside carousel take full width */
.sf-carousel-slide .sf-campaign-card {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.sf-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, box-shadow 0.2s;
}

.sf-carousel-nav:hover {
    background: #16a085;
    color: #fff;
}

.sf-carousel-prev {
    left: 0;
}

.sf-carousel-next {
    right: 0;
}

.sf-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.sf-carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: #ddd;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.sf-carousel-dot.active,
.sf-carousel-dot:hover {
    background: #16a085;
    transform: scale(1.2);
}

/* ----- Hero Spotlight Layout ----- */
/* Base styles for the hero widget */
.sf-widget-hero {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Mobile-only: hide background image and show stacked card */
@media (max-width: 767px) {
    .sf-widget-hero {
        background-color: #fff !important;
        background-image: none !important;
    }
}

.sf-hero-image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    display: block;
}

.sf-hero-image a {
    display: block;
    height: 100%;
}

.sf-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.sf-widget-hero:hover .sf-hero-image img {
    transform: scale(1.05);
}

/* Overlay - hidden on mobile */
.sf-hero-overlay {
    display: none;
}

.sf-hero-content {
    padding: 20px;
    background: #fff;
}

.sf-hero-title {
    font-size: 1.25rem;
    margin: 0 0 15px;
    font-weight: 600;
    line-height: 1.4;
}

.sf-hero-title a {
    color: #1a1a2e;
    text-decoration: none;
}

.sf-hero-title a:hover {
    color: #16a085;
}

.sf-hero-excerpt {
    color: #666;
    margin: 0 0 15px;
    line-height: 1.6;
    font-size: 0.95rem;
}

.sf-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
}

.sf-hero-stat {
    display: flex;
    flex-direction: column;
}

.sf-hero-stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #16a085;
}

.sf-hero-stat-label {
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sf-hero-progress {
    background: #e9ecef;
    border-radius: 10px;
    height: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.sf-hero-progress-bar {
    background: linear-gradient(90deg, #16a085, #1abc9c);
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease-out;
}

.sf-hero-progress-text {
    color: #16a085;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 15px;
    display: block;
    text-align: right;
}

.sf-hero-button {
    display: block;
    text-align: center;
    padding: 12px 24px;
    background: linear-gradient(90deg, #16a085, #1abc9c);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: opacity 0.3s;
}

.sf-hero-button:hover {
    opacity: 0.9;
    color: #fff;
}

/* Desktop: full-width background image with overlay (768px and up) */
@media (min-width: 768px) {
    .sf-widget-hero {
        position: relative;
        min-height: 400px;
        background-color: #1a1a2e;
        /* Fallback if no image */
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
    }

    /* Hide the mobile image on desktop */
    .sf-widget-hero .sf-hero-image {
        display: none;
    }

    /* Dark overlay for text readability */
    .sf-hero-overlay {
        display: block;
        position: absolute;
        inset: 0;
        background: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.4) 100%);
        z-index: 1;
    }

    .sf-hero-content {
        position: relative;
        z-index: 2;
        padding: 40px;
        background: transparent;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        min-height: 400px;
        max-width: 600px;
    }

    .sf-hero-title {
        font-size: 2rem;
    }

    .sf-hero-title a {
        color: #fff;
    }

    .sf-hero-title a:hover {
        color: #1abc9c;
    }

    .sf-hero-excerpt {
        color: rgba(255, 255, 255, 0.9);
    }

    .sf-hero-stats {
        gap: 30px;
        flex-wrap: nowrap;
    }

    .sf-hero-stat-value {
        font-size: 1.5rem;
        color: #1abc9c;
    }

    .sf-hero-stat-label {
        color: rgba(255, 255, 255, 0.8);
    }

    .sf-hero-progress {
        background: rgba(255, 255, 255, 0.3);
    }

    .sf-hero-progress-text {
        color: #1abc9c;
    }

    .sf-hero-button {
        align-self: flex-start;
    }
}

/* ----- Responsive Styles ----- */
@media (max-width: 992px) {
    .sf-widget-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .sf-widget-grid {
        grid-template-columns: 1fr;
    }

    .sf-widget-carousel {
        padding: 0 40px;
    }

    .sf-carousel-nav {
        width: 32px;
        height: 32px;
    }

    .sf-hero-button {
        text-align: center;
    }
}