/**
 * NusantaRun Donation Widget Styles
 * Version: 1.3.0 - With Animations
 */

.nusantarun-donation-widget-container {
    font-family: inherit;
    background: transparent;
    max-width: 100%;
}

.nusantarun-donation-widget-container > *{
    transition: all 0.5s ease-in;
}

.donationWidget {
    display: flex;
    gap: 5rem;
    padding-bottom: 2em;
    align-items: center;
    transition: all 0.5s ease-in;
    border-bottom: solid 1px rgba(0,0,0,.15);
}

/* Circle Progress Bar */
.circleBar {
    position: relative;
    width: 200px;
    height: 200px;
    flex-shrink: 0;
}

.circleBar svg {
    width: 100%;
    height: 100%;
    /* REMOVED: transform: rotate(-90deg); - moved to inline style */
}

.circleBar .circle-bg {
    fill: none;
    stroke: rgba(206, 48, 11, 0.25);
    stroke-width: 15;
}

.circleBar .circle-progress {
    fill: none;
    stroke: url(#progressGradient);
    stroke-width: 15;
    stroke-linecap: round;
    /* REMOVED: hardcoded stroke-dasharray and offset */
}

/* Shimmer Animation - FIXED */
@keyframes shimmer-rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes shimmer-opacity {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.circle-shimmer {
    animation: shimmer-rotate 3s linear infinite, shimmer-opacity 2s ease-in-out infinite;
    transform-origin: center;
}

/* Rest of CSS stays the same */

.circleBar .circle-progress {
    fill: none;
    stroke: #ce300b;
    stroke-width: 15;
    stroke-linecap: round;
    stroke-dasharray: 565.48;
    stroke-dashoffset: 565.48;
    transition: stroke-dashoffset 0.1s linear;
}

.circleBar .percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3em;
    letter-spacing: -1px;
    font-weight: 500 !important;
    -webkit-background-clip: text;
    -moz-background-clip: text;
    -webkit-text-fill-color: transparent;
    -moz-text-fill-color: transparent;
    background-image: linear-gradient(#fff 0%, #ce300b 100%);
}

/* Counting animation effect */
.counting-up {
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.count-complete {
    animation: bounce-in 0.3s ease-out;
}

@keyframes bounce-in {
    0% {
        transform: scale(0.95);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Donation Data */
.donationData {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2em;
    text-align: left;
}

.totalData {
    display: flex;
    gap: 2em;
}

/* Total Donation - 2/3 width */
.totalDonation {
    flex: 2;
}

/* Total Donors - 1/3 width */
.totalDonors {
    flex: 1;
}

/* Same styling for both h3 headers */
.totalDonation h3,
.totalDonors h3 {
    font-size: 1.5em !important;
    -webkit-background-clip: text;
    -moz-background-clip: text;
    -webkit-text-fill-color: transparent;
    -moz-text-fill-color: transparent;
    background-image: linear-gradient(180deg, #000, rgba(0, 0, 0, 0.25));
    font-weight: normal !important;
    margin: 0 0 .25em;
}

@media (max-width: 768px) {
    .totalDonation h3,
    .totalDonors h3 {
        font-size: 1.1em !important;
    }
}

/* Same styling for both h1 values */
.totalDonation h1,
.totalDonors h1 {
    font-size: 3.5rem !important;
    -webkit-background-clip: text;
    -moz-background-clip: text;
    -webkit-text-fill-color: transparent;
    -moz-text-fill-color: transparent;
    background-image: linear-gradient(180deg, #a60900 0%, #ce300b 100%);
    line-height: 1 !important;
    margin: 0 !important;
    transition: all 0.15s ease;
}

@media (max-width: 768px) {
    .totalDonation h1,
    .totalDonors h1 {
        font-size: 1.75em !important;
    }
}

.totalDonation h1.superTotal,
.totalDonors h1.superTotal {
    background-image: linear-gradient(180deg, #ce920b, rgba(206, 146, 11,.5));
    background-color: transparent;
}

/* Donation Details */
.donationDetails {
    display: flex;
    gap: 1em;
}

/* .donationDetails > div {
    flex: 1;
} */

.targetDonation{
    flex: 1.25;
}

.raceCountdown{
    flex: .75;
}

.fundraisingCountdown{
    flex: 1
}

.donationDetails h6 {
    font-size: 1.15em !important;
    font-weight: normal !important;
    color: rgba(0, 0, 0, .5) !important;
    margin: 0 !important;
}

.donationDetails h5 {
    font-size: 2.25em !important;
    margin: .35em 0 !important;
    font-weight: 500 !important;
    -webkit-background-clip: text;
    -moz-background-clip: text;
    -webkit-text-fill-color: transparent;
    -moz-text-fill-color: transparent;
    background-image: linear-gradient(180deg, #000, rgba(0, 0, 0, 0.25));
    transition: all 0.15s ease;
}

/* Update Details */
.updateDetails {
    display: block;
    text-align: right;
    color: rgba(0, 0, 0, .25);
    font-size: .8em !important;
    margin-top: 1em;
    transition: all 0.5s ease-in !important;
}

.updateDetails:hover{
    color: rgba(0, 0, 0, .5);
}

/* Loading State */
.nusantarun-loading {
    text-align: center;
    color: rgba(0, 0, 0, .5);
    padding: 40px;
}

.nusantarun-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ce300b;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: nusantarun-spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes nusantarun-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error State */
.nusantarun-error {
    background: rgba(206, 48, 11, 0.25);
    color: #ce300b;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.nusantarun-error button {
    margin-top: 15px;
    padding: 10px 20px;
    background: #ce300b;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.nusantarun-error button:hover {
    background: #a60900;
}

/* Fade-in animations for individual elements */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.donationWidget h1,
.donationWidget h3,
.donationWidget h5,
.donationWidget h6 {
    animation: fade-in 0.5s ease-out forwards;
}

/* Responsive */
@media (max-width: 768px) {
    .donationWidget {
        flex-direction: column;
        gap: 30px;
    }

    .circleBar {
        width: 150px;
        height: 150px;
    }
    
    .circleBar .percentage {
        font-size: 2.5em !important;
    }

    .totalData {
        gap: 20px;
    }

    .totalDonation{
        flex: 3;
    }

    .totalDonors {
        flex: 1;
    }

    .donationDetails {
        display: flex;
        flex-wrap: wrap;
        gap: 15px;
    }

    /* Race Day - left half, top */
    .donationDetails .raceCountdown {
        flex: 1 1 calc(50% - 7.5px);
        order: 1;
    }

    /* Fundraising Period - right half, top */
    .donationDetails .fundraisingCountdown {
        flex: 1 1 calc(50% - 7.5px);
        order: 2;
    }

    /* Target Donation full width on bottom */
    .donationDetails .targetDonation {
        flex: 1 1 100%;
        order: 3;
    }

    .donationDetails h6{
        font-size: .85em !important;
    }

    .donationDetails h5{
        font-size: 1.5em !important;
        margin: 0 !important;
    }
}

/* Chart Container */
.nusantarun-chart-wrapper {
    margin: 30px 0 !important;
}

.nusantarun-chart-container canvas {
    max-width: 100%;
}

/* Responsive chart */
@media (max-width: 768px) {
    .nusantarun-chart-wrapper {
        margin: 20px 0;
    }
}