/* Core Layout */
.tpc-donation-sticky-wrapper {
    position: relative;
    min-height: 1px;
    transition: height 0.3s ease;
    z-index: 100;
}

.tpc-donation-widget {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Sticky Behavior */
.tpc-donation-total {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 20px;
    transition: all 0.3s ease;
    will-change: transform, position, width;
    backface-visibility: hidden;
}

.tpc-donation-total.is-sticky {
    position: fixed;
    top: 20px;
    width: 100% !important;
    max-width: 400px;
    z-index: 1000;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transform: translateZ(0);
    animation: tpcStickyFadeIn 0.3s ease-out;
}

@keyframes tpcStickyFadeIn {
    from {
        opacity: 0.9;
        transform: translateY(-10px) translateZ(0);
    }
    to {
        opacity: 1;
        transform: translateY(0) translateZ(0);
    }
}

/* Progress Bar */
.tpc-progress-bar {
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    margin-bottom: 15px;
    position: relative;
    overflow: hidden;
}

.tpc-progress {
    height: 100%;
    background: #4CAF50;
    border-radius: 10px;
    transition: width 0.5s ease;
}

.tpc-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
}

/* Text Styles */
.tpc-amount-raised {
    font-size: 18px;
    margin: 0 0 10px 0;
    color: #333;
    line-height: 1.4;
}

.tpc-amount-raised strong {
    color: #2c3e50;
    font-size: 24px;
    font-weight: 700;
}

.tpc-goal {
    font-size: 16px;
    margin: 0 0 15px 0;
    color: #666;
    line-height: 1.5;
}

.tpc-deadline {
    font-size: 14px;
    color: #e74c3c;
    display: inline-block;
    margin-top: 5px;
    font-weight: 500;
}

/* Donate Button */
.tpc-donate-button {
    margin-top: 15px;
}

.tpc-donate-link {
    display: block;
    background: #e74c3c;
    color: white !important;
    text-align: center;
    padding: 12px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.tpc-donate-link:hover {
    background: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Recent Donors */
.tpc-recent-donors {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.tpc-donor-count {
    font-size: 16px;
    margin: 0 0 15px 0;
    color: #333;
    font-weight: bold;
}

.tpc-donor {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.tpc-donor:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.tpc-donor-avatar {
    margin-right: 15px;
    flex-shrink: 0;
}

.tpc-donor-avatar img {
    border-radius: 50%;
    display: block;
}

.tpc-donor-info {
    flex: 1;
    min-width: 0;
}

.tpc-donor-name {
    font-weight: bold;
    margin: 0 0 5px 0;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tpc-donor-amount {
    margin: 0;
    color: #27ae60;
    font-size: 14px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.tpc-donation-time {
    color: #7f8c8d;
    font-size: 12px;
    margin-left: 10px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .tpc-donation-total.is-sticky {
        position: static !important;
        width: 100% !important;
        max-width: none !important;
        transform: none !important;
        animation: none !important;
    }
    
    .tpc-donation-sticky-wrapper {
        min-height: 0 !important;
    }
    
    .tpc-amount-raised strong {
        font-size: 20px;
    }
    
    .tpc-donate-link {
        padding: 10px 15px;
    }
    
    .tpc-donor {
        flex-direction: column;
        text-align: center;
    }
    
    .tpc-donor-avatar {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .tpc-donor-name {
        white-space: normal;
    }
    
    .tpc-donor-amount {
        justify-content: center;
    }
}