/**
 * Donation Progress Meter Block Styles
 */

.wp-block-donation-progress {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #ffffff;
    border-radius: 8px;
}

.wp-block-donation-progress.alignwide {
    max-width: 100%;
}

.wp-block-donation-progress.alignfull {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.donation-progress-title {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
}

.donation-progress-meter {
    position: relative;
    width: 100%;
    height: 32px;
    border-radius: 16px;
    overflow: hidden;
    background-color: #e0e0e0;
    margin-bottom: 1rem;
}

.donation-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: #2271b1;
    border-radius: 16px;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 12px;
    animation: progressAnimation 1.5s ease-out;
}

@keyframes progressAnimation {
    from {
        width: 0 !important;
    }
}

.donation-progress-label {
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.donation-progress-label-outside {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    font-size: 0.875rem;
    font-weight: 600;
    z-index: 1;
}

.donation-progress-details {
    text-align: center;
}

.donation-progress-amounts {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.donation-current-amount {
    font-weight: 700;
    font-size: 1.5rem;
    color: inherit;
}

.donation-separator {
    margin: 0 0.25rem;
    opacity: 0.6;
    font-size: 1.125rem;
}

.donation-target-amount {
    opacity: 0.7;
    font-size: 1.125rem;
}

.donation-raised-label {
    margin-left: 0.5rem;
    opacity: 0.7;
    font-size: 0.875rem;
    text-transform: lowercase;
}

.donation-progress-percentage {
    font-size: 1rem;
    opacity: 0.8;
    margin-top: 0.5rem;
}

.donation-donor-count {
    font-size: 0.875rem;
    opacity: 0.7;
    margin-top: 0.5rem;
}

/* Donate button styling */
.donation-progress-button-wrapper {
    margin-top: 1.25rem;
    text-align: center;
}

.donation-progress-donate-button {
    display: inline-block;
    background-color: #47D7AC;
    color: #ffffff;
    padding: 12px 32px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0; /* Square corners */
    transition: background-color 0.2s ease, transform 0.1s ease;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.donation-progress-donate-button:hover {
    background-color: #485CC7;
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-1px);
}

.donation-progress-donate-button:active {
    transform: translateY(0);
}

.donation-progress-donate-button:focus {
    outline: 2px solid #485CC7;
    outline-offset: 2px;
}

/* Hover effect on the meter */
.donation-progress-meter:hover .donation-progress-fill {
    filter: brightness(1.1);
}

/* Mobile responsiveness */
@media (max-width: 600px) {
    .wp-block-donation-progress {
        padding: 1rem;
    }
    
    .donation-progress-title {
        font-size: 1.125rem;
    }
    
    .donation-progress-meter {
        height: 28px;
    }
    
    .donation-current-amount {
        font-size: 1.25rem;
    }
    
    .donation-target-amount {
        font-size: 1rem;
    }
}

/* Editor specific styles */
.editor-styles-wrapper .wp-block-donation-progress {
    margin: 1rem 0;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .wp-block-donation-progress {
        background: #1e1e1e;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }
}

/* Animation for when meter comes into view */
.donation-progress-fill[data-animated="true"] {
    animation: fillProgress 2s ease-out forwards;
}

@keyframes fillProgress {
    from {
        transform: scaleX(0);
        transform-origin: left center;
    }
    to {
        transform: scaleX(1);
        transform-origin: left center;
    }
}

/* Success state when goal is reached */
.wp-block-donation-progress.goal-reached .donation-progress-fill {
    background: linear-gradient(135deg, #4caf50, #45a049);
}

.wp-block-donation-progress.goal-reached .donation-progress-title:after {
    content: " ✓";
    color: #4caf50;
    margin-left: 0.5rem;
}
