/* =========================================
   DONORCORE FRONTEND BLOCK STYLES
   Refactored to use CSS variables only
   ========================================= */

/* Box Sizing Reset */
.dc-donation-form-wrapper *, 
.dc-progress-bar-wrapper *, 
.dc-campaign-ended-wrapper * {
    box-sizing: border-box;
}

/* =========================================
   Main Container Cards
   ========================================= */
.dc-donation-form-wrapper,
.dc-campaign-ended-wrapper {
    max-width: var(--dc-df-max-width, 600px);
    margin: var(--dc-df-margin, 30px) auto;
    padding: var(--dc-df-padding, 30px);
    background: var(--dc-df-bg, #ffffff);
    border-radius: var(--dc-df-radius, 12px);
    box-shadow: var(--dc-df-shadow, 0 4px 12px rgba(0, 0, 0, 0.08));
    border: var(--dc-df-border-width, 1px) solid rgba(0,0,0,0.04);
    font-family: var(--dc-df-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    font-size: var(--dc-df-body-size, 18px);
    line-height: var(--dc-df-line-height, 1.6);
    color: var(--dc-df-text, #2c3338);
}

.dc-progress-bar-wrapper {
    max-width: var(--dc-pb-max-width, 600px);
    margin: var(--dc-pb-margin, 30px) auto;
    padding: var(--dc-pb-padding, 30px);
    background: var(--dc-pb-bg, #ffffff);
    border-radius: var(--dc-pb-radius, 12px);
    box-shadow: var(--dc-pb-shadow, 0 4px 12px rgba(0, 0, 0, 0.08));
    border: 1px solid rgba(0,0,0,0.04);
    font-family: var(--dc-pb-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    color: var(--dc-pb-text, #2c3338);
}

/* =========================================
   Campaign Ended Notice
   ========================================= */
.dc-ended-notice {
    text-align: center;
    padding: 20px;
}
.dc-ended-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 15px;
    opacity: 0.8;
}
.dc-ended-notice h3 {
    margin: 0 0 10px;
    color: var(--dc-df-text, #2c3338);
    font-size: 24px;
    font-weight: var(--dc-df-font-weight-heading, 700);
}
.dc-ended-notice p {
    color: var(--dc-df-label, #646970);
    font-size: var(--dc-df-body-size, 18px);
    line-height: var(--dc-df-line-height, 1.6);
}

/* =========================================
   Donation Form
   ========================================= */

/* Campaign Title - Uses Heading Styles */
.dc-campaign-title,
.dc-donation-form-wrapper h3,
.dc-form-title {
    margin-top: 0;
    margin-bottom: var(--dc-df-gap, 20px);
    color: var(--dc-df-text, #2c3338);
    font-size: var(--dc-df-heading-size, 18px);
    font-weight: var(--dc-df-font-weight-heading, 700);
    text-align: center;
}

/* Section Labels - Uses Body Styles */
.dc-section-label {
    margin: 0 0 15px 0;
    font-size: var(--dc-df-body-size, 18px);
    font-weight: var(--dc-df-font-weight-body, 600);
    color: var(--dc-df-label, #2c3338);
}

/* Legacy h3/h4 selectors - kept for backwards compatibility */
.dc-amount-selector h3,
.dc-amount-selector h4{
    margin: 0 0 15px 0;
    font-size: var(--dc-df-heading-size, 18px);
    font-weight: var(--dc-df-font-weight-heading, 700);
    color: var(--dc-df-text, #2c3338);
}

/* Amount Buttons Grid */
.dc-amount-buttons {
    display: grid;
    grid-template-columns: repeat(var(--dc-df-amount-cols, 4), 1fr);
    gap: 10px;
    margin-bottom: var(--dc-df-gap, 20px);
}

.dc-amount-btn {
    padding: var(--dc-df-amount-btn-padding, 12px) 5px;
    border: var(--dc-df-border-width, 1px) solid var(--dc-df-border, #dae1e7);
    background: #fff;
    color: var(--dc-df-text, #2c3338);
    cursor: pointer;
    border-radius: var(--dc-df-button-radius, 8px);
    font-family: var(--dc-df-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    font-size: var(--dc-df-body-size, 18px);
    font-weight: var(--dc-df-font-weight-body, 600);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

.dc-amount-btn:hover {
    border-color: var(--dc-df-primary, #0073aa);
}

.dc-amount-btn.active {
    background: var(--dc-df-primary, #0073aa);
    color: white;
    border-color: var(--dc-df-primary, #0073aa);
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.25);
}

/* Custom Amount Field */
.dc-custom-amount-input {
    margin-bottom: var(--dc-df-gap, 25px);
}

.dc-custom-amount-input label {
    display: block;
    margin-bottom: 8px;
    font-weight: var(--dc-df-font-weight-body, 600);
    font-size: var(--dc-df-body-size, 18px);
    color: var(--dc-df-label, #2c3338);
}

.dc-amount-field {
    width: 100%;
    padding: var(--dc-df-input-padding, 12px) 16px;
    font-family: var(--dc-df-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    font-size: var(--dc-df-body-size, 18px);
    border: var(--dc-df-border-width, 1px) solid var(--dc-df-border, #dae1e7);
    border-radius: var(--dc-df-input-radius, 8px);
    transition: all 0.2s ease;
    background: var(--dc-df-input-bg, #fcfcfc);
}

.dc-amount-field:focus {
    outline: none;
    background: #fff;
    border-color: var(--dc-df-input-focus, #0073aa);
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* =========================================
   Donate Button
   ========================================= */
.dc-donate-btn {
    width: 100%;
    padding: var(--dc-df-button-padding-y, 18px) var(--dc-df-button-padding-x, 16px);
    background: var(--dc-df-primary, #0073aa);
    color: white;
    border: none;
    border-radius: var(--dc-df-button-radius, 8px);
    font-family: var(--dc-df-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    font-size: var(--dc-df-button-font-size, 18px);
    font-weight: var(--dc-df-font-weight-button, 800);
    cursor: pointer;
    margin-top: var(--dc-df-gap, 25px);
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 115, 170, 0.2);
}

/* =========================================
   Progress Bar
   ========================================= */
.dc-progress-bar-wrapper {
    font-family: var(--dc-pb-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
}

.dc-progress-bar-wrapper h3 {
    margin: 0 0 20px;
    font-size: var(--dc-pb-heading-size, 20px);
    text-align: center;
    color: var(--dc-pb-text, #2c3338);
    font-weight: var(--dc-pb-heading-weight, 600);
}

.dc-progress-bar {
    background: var(--dc-pb-track-bg, #eff1f3);
    border-radius: var(--dc-pb-radius, 12px);
    height: var(--dc-pb-height, 40px);
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
}

.dc-progress-fill {
    background: var(--dc-pb-fill, #0073aa);
    height: 100%;
    transition: width 1s ease-out;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    border-radius: var(--dc-pb-radius, 12px);
}

/* Striped Animation */
.dc-progress-fill::after {
    content: "";
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background-image: linear-gradient(
        45deg, 
        rgba(255, 255, 255, 0.15) 25%, 
        transparent 25%, 
        transparent 50%, 
        rgba(255, 255, 255, 0.15) 50%, 
        rgba(255, 255, 255, 0.15) 75%, 
        transparent 75%, 
        transparent
    );
    background-size: 20px 20px;
    animation: dc-stripes 2s linear infinite;
}

@keyframes dc-stripes {
    0% { background-position: 0 0; }
    100% { background-position: 40px 0; }
}

.dc-progress-text {
    color: var(--dc-pb-percentage-color, white);
    font-weight: var(--dc-pb-percentage-weight, 800);
    font-size: var(--dc-pb-body-size, 14px);
    margin-right: 12px;
    z-index: 2;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    white-space: nowrap;
}

.dc-progress-amounts {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    align-items: center;
    font-size: var(--dc-pb-body-size, 14px);
}

.dc-raised-wrapper,
.dc-goal-wrapper {
    color: var(--dc-pb-text, #2c3338);
    font-size: var(--dc-pb-body-size, 14px);
    font-weight: var(--dc-pb-label-weight, 500);
}

.dc-progress-amounts .dc-amount,
.dc-progress-amounts .dc-amount .woocommerce-Price-amount,
.dc-progress-amounts .dc-amount .amount,
.dc-progress-amounts .dc-amount bdi,
.dc-progress-amounts strong.dc-amount,
.dc-progress-amounts strong.dc-amount * {
    color: var(--dc-pb-text, #2c3338) !important;
    font-weight: var(--dc-pb-amount-weight, 600) !important;
    font-size: var(--dc-pb-amount-size, 16px) !important;
}

/* =========================================
   Mobile Responsiveness
   ========================================= */
@media (max-width: 480px) {
    .dc-amount-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    .dc-donation-form-wrapper,
    .dc-progress-bar-wrapper,
    .dc-campaign-ended-wrapper {
        margin: 20px auto;
        padding: 20px;
    }
}