/* WooDonate Frontend - Full Featured, No Button Interference */

/* ============================================
   DONATION/CROWDFUNDING FORM - NORMAL SIZE
   ============================================ */

.woodonate-donation-box {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.woodonate-label {
    display: block;
    font-weight: 600;
    font-size: 15px;
    color: inherit;
    margin-bottom: 12px;
}

/* Amount Suggestion Buttons - NORMAL SIZE */
.woodonate-amount-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.woodonate-btn-amount {
    flex: 1;
    min-width: 90px;
    padding: 10px 15px;
    border: 2px solid currentColor;
    background: transparent;
    border-radius: inherit;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    color: inherit;
    opacity: 0.7;
}

.woodonate-btn-amount:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.woodonate-btn-amount.active {
    background: var(--theme-primary-color, #000);
    color: #fff;
    border-color: var(--theme-primary-color, #000);
    opacity: 1;
}

.woodonate-or {
    text-align: center;
    font-size: 13px;
    color: inherit;
    opacity: 0.6;
    margin: 12px 0;
    font-style: italic;
}

/* Price Input Group */
.woodonate-input-group {
    position: relative;
    margin-bottom: 8px;
}

.woodonate-currency {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    color: inherit;
    opacity: 0.6;
    font-size: 15px;
    pointer-events: none;
    z-index: 2;
    width: 45px;
    text-align: center;
    padding-left: 15px;
}

.woodonate-input {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    border: 2px solid rgba(0,0,0,0.1);
    border-radius: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
    color: inherit;
    font-family: inherit;
}

.woodonate-input:focus {
    outline: none;
    border-color: var(--theme-primary-color, #000);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

.woodonate-hint {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: inherit;
    opacity: 0.6;
}

/* ============================================
   INPUT VALIDATION STYLING (NEW!)
   ============================================ */

/* Error state for input */
.woodonate-input-error {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
}

/* Shake animation */
@keyframes woodonate-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.woodonate-shake {
    animation: woodonate-shake 0.5s ease-in-out;
}

/* Validation error message */
.woodonate-validation-error {
    display: block;
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(220, 38, 38, 0.1);
    border-left: 3px solid #dc2626;
    color: #dc2626;
    font-size: 13px;
    font-weight: 500;
    border-radius: 4px;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   FORCE VERTICAL LAYOUT (Fix Quick View)
   ============================================ */

/* Target WooCommerce form wrapper */
.single-product div.product form.cart,
.quick-view-content form.cart,
.product-quick-view form.cart,
.mfp-content form.cart,
.pp-modal form.cart,
.elementor-lightbox form.cart,
.pafe-quick-view form.cart {
    display: flex !important;
    flex-direction: column !important;
    gap: 15px;
}

/* Ensure donation box stays full width */
.woodonate-donation-box {
    width: 100% !important;
    max-width: 100% !important;
    order: -1; /* Always show first, before quantity */
}

/* Quantity selector - HIDE for custom price donation/crowdfunding */
.woodonate-product-donation.woodonate-custom-price .quantity,
.woodonate-product-crowdfunding .quantity {
    display: none !important;
}

/* Show quantity only for fixed price donation */
.woodonate-product-donation.woodonate-fixed-price .quantity {
    display: block !important;
}

.single-product div.product form.cart .quantity,
.quick-view-content form.cart .quantity,
.product-quick-view form.cart .quantity {
    width: 100% !important;
    max-width: 150px;
    margin: 0 !important;
}

/* ============================================
   NO BUTTON STYLING - LET THEME HANDLE IT
   ============================================ */
/* Completely removed - zero CSS for add to cart button */

/* ============================================
   CROWDFUNDING PROGRESS BAR - FULL VERSION
   ============================================ */

.woodonate-crowdfunding-stats {
    margin: 25px 0;
    padding: 0;
    background: transparent;
}

.woodonate-simple-stats {
    display: flex;
    gap: 15px;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.woodonate-simple-stats .woodonate-stat-item {
    text-align: left;
    padding: 15px 20px;
    background: rgba(0,0,0,0.02);
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.05);
    flex: 1;
    min-width: 120px;
}

.woodonate-progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(0,0,0,0.05);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 20px;
    position: relative;
}

.woodonate-progress-fill {
    height: 100%;
    background: var(--theme-primary-color, linear-gradient(90deg, #667eea 0%, #764ba2 100%));
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.woodonate-progress-text {
    position: absolute;
    right: 10px;
    top: -20px;
    font-size: 12px;
    font-weight: 700;
    color: inherit;
    opacity: 0.8;
}

.woodonate-campaign-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 12px;
}

.woodonate-stat {
    text-align: center;
    padding: 12px;
    background: rgba(0,0,0,0.02);
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.05);
}

.woodonate-stat-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: inherit;
    margin-bottom: 4px;
}

.woodonate-stat-label {
    display: block;
    font-size: 11px;
    color: inherit;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.woodonate-campaign-ended {
    margin-top: 12px;
    padding: 10px;
    background: rgba(255, 0, 0, 0.05);
    color: #c62828;
    text-align: center;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid rgba(255, 0, 0, 0.1);
}

/* ============================================
   PROGRESS BAR - MINI VERSION FOR QUICK VIEW
   ============================================ */

.woodonate-progress-mini {
    margin: 15px 0;
    padding: 15px;
    background: rgba(0,0,0,0.02);
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.05);
}

.woodonate-progress-mini .woodonate-progress-bar {
    height: 8px;
    margin-bottom: 10px;
}

.woodonate-progress-mini .woodonate-progress-text {
    position: static;
    display: block;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    opacity: 1;
}

.woodonate-progress-mini-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    margin-top: 8px;
}

.woodonate-progress-mini-stats .raised {
    font-weight: 700;
    color: var(--theme-primary-color, #667eea);
}

.woodonate-progress-mini-stats .goal {
    color: inherit;
    opacity: 0.7;
}

/* ============================================
   QUICK VIEW - NORMAL SIZE (NOT COMPACT)
   ============================================ */

/* Hide detailed stats in quick view, show mini progress only */
.mfp-content .woodonate-campaign-stats,
.pp-modal .woodonate-campaign-stats,
.elementor-lightbox .woodonate-campaign-stats,
.quick-view-content .woodonate-campaign-stats,
.pafe-quick-view .woodonate-campaign-stats {
    display: none !important;
}

/* Show mini progress in quick view */
.mfp-content .woodonate-crowdfunding-stats,
.pp-modal .woodonate-crowdfunding-stats,
.elementor-lightbox .woodonate-crowdfunding-stats,
.quick-view-content .woodonate-crowdfunding-stats,
.pafe-quick-view .woodonate-crowdfunding-stats {
    margin: 15px 0;
}

/* ============================================
   ULTRA COMPACT PROGRESS BAR - QUICK VIEW (NEW!)
   ============================================ */

/* Override mini version in quick view with ultra compact */
.pafe-quick-view .woodonate-progress-mini,
.mfp-content .woodonate-progress-mini,
.quick-view-content .woodonate-progress-mini {
    margin: 8px 0;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    cursor: help;
    position: relative;
}

/* Ultra compact progress bar */
.pafe-quick-view .woodonate-progress-bar,
.mfp-content .woodonate-progress-bar,
.quick-view-content .woodonate-progress-bar {
    height: 5px;
    margin-bottom: 6px;
    border-radius: 3px;
    background: rgba(0,0,0,0.08);
}

/* Percentage and stats below bar - very small */
.pafe-quick-view .woodonate-progress-text,
.mfp-content .woodonate-progress-text,
.quick-view-content .woodonate-progress-text {
    position: static;
    display: inline-block;
    font-size: 9px;
    font-weight: 600;
    margin-bottom: 0;
    margin-right: 8px;
    opacity: 0.7;
}

/* Ultra compact stats */
.pafe-quick-view .woodonate-progress-mini-stats,
.mfp-content .woodonate-progress-mini-stats,
.quick-view-content .woodonate-progress-mini-stats {
    display: inline-block;
    font-size: 9px;
    margin-top: 0;
    opacity: 0.6;
}

.pafe-quick-view .woodonate-progress-mini-stats .raised,
.mfp-content .woodonate-progress-mini-stats .raised,
.quick-view-content .woodonate-progress-mini-stats .raised {
    font-weight: 600;
    margin-right: 4px;
}

.pafe-quick-view .woodonate-progress-mini-stats .goal,
.mfp-content .woodonate-progress-mini-stats .goal,
.quick-view-content .woodonate-progress-mini-stats .goal {
    font-weight: normal;
}

/* Tooltip on hover */
.pafe-quick-view .woodonate-progress-mini:hover::after,
.mfp-content .woodonate-progress-mini:hover::after,
.quick-view-content .woodonate-progress-mini:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.9);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Tooltip arrow */
.pafe-quick-view .woodonate-progress-mini:hover::before,
.mfp-content .woodonate-progress-mini:hover::before,
.quick-view-content .woodonate-progress-mini:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0,0,0,0.9);
    z-index: 9999;
}

/* ============================================
   REGULAR PRODUCT PRICE DISPLAY
   ============================================ */

.woodonate-regular-price {
    margin-bottom: 15px;
    padding: 15px 20px;
    background: rgba(0,0,0,0.02);
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.woodonate-regular-price .price-label {
    font-size: 14px;
    font-weight: 600;
    color: inherit;
    opacity: 0.7;
}

.woodonate-regular-price .price-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--theme-primary-color, #000);
}

/* ============================================
   DONOR WALL
   ============================================ */

.woodonate-donor-wall {
    margin: 35px 0;
    padding: 25px;
    background: rgba(0,0,0,0.01);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 10px;
}

.woodonate-donor-wall-title {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(0,0,0,0.08);
}

.woodonate-donor-wall-title .dashicons {
    color: var(--theme-primary-color, #667eea);
    font-size: 26px;
    width: 26px;
    height: 26px;
}

.woodonate-donor-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.woodonate-donor-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    margin-bottom: 10px;
    background: #fff;
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.woodonate-donor-item:hover {
    transform: translateX(5px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.woodonate-donor-item.anonymous {
    opacity: 0.85;
}

.woodonate-donor-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--theme-primary-color, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.woodonate-donor-avatar .dashicons {
    color: #fff;
    font-size: 22px;
    width: 22px;
    height: 22px;
}

.woodonate-donor-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.woodonate-donor-name {
    font-weight: 600;
    font-size: 15px;
    color: inherit;
}

.woodonate-donor-amount {
    font-weight: 700;
    font-size: 16px;
    color: var(--theme-primary-color, #667eea);
}

.woodonate-donor-date {
    font-size: 12px;
    color: inherit;
    opacity: 0.5;
}

/* ============================================
   ANONYMOUS CHECKBOX AT CHECKOUT
   ============================================ */

.woodonate-anonymous-field {
    margin: 20px 0;
    padding: 15px 20px;
    background: rgba(0, 115, 170, 0.05);
    border: 1px solid rgba(0, 115, 170, 0.2);
    border-radius: 8px;
}

.woodonate-anonymous-field label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: inherit;
    margin: 0;
}

.woodonate-anonymous-field input[type="checkbox"] {
    margin: 0 !important;
    width: 18px;
    height: 18px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 782px) {
    .woodonate-amount-buttons {
        flex-direction: column;
    }

    .woodonate-btn-amount {
        width: 100%;
        min-width: auto;
    }

    .woodonate-simple-stats {
        flex-direction: column;
    }

    .woodonate-campaign-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .woodonate-donor-item {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .woodonate-donor-info {
        align-items: center;
    }

    .woodonate-regular-price {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .woodonate-campaign-stats {
        grid-template-columns: 1fr;
    }

    .woodonate-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* ============================================
   THEME COMPATIBILITY VARIABLES
   ============================================ */

:root {
    --woodonate-primary-color: inherit;
    --woodonate-border-radius: 6px;
    --woodonate-button-padding: 12px 24px;
}

/* Apply theme variables if set */
.woodonate-btn-amount.active,
.woodonate-progress-fill,
.woodonate-donor-avatar {
    background: var(--woodonate-primary-color, var(--theme-primary-color, #667eea));
}

.woodonate-input,
.woodonate-btn-amount,
.woodonate-donor-item,
.woodonate-stat {
    border-radius: var(--woodonate-border-radius, 6px);
}

/* ============================================
   ULTRA SIMPLE PROGRESS BAR - QUICK VIEW
   ============================================ */

.woodonate-progress-ultra-simple {
    margin: 12px 0;
    padding: 0;
    background: transparent;
    cursor: help;
    position: relative;
}

.woodonate-progress-ultra-simple .woodonate-progress-bar {
    height: 5px;
    background: rgba(0,0,0,0.08);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.woodonate-progress-ultra-simple .woodonate-progress-fill {
    height: 100%;
    background: var(--theme-primary-color, linear-gradient(90deg, #667eea 0%, #764ba2 100%));
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.woodonate-progress-ultra-simple .woodonate-progress-goal-text {
    font-size: 11px;
    font-weight: 600;
    color: inherit;
    opacity: 0.7;
    text-align: right;
}

/* Tooltip on hover */
.woodonate-progress-ultra-simple:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.95);
    color: #fff;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: pre-line;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    min-width: 180px;
    text-align: left;
    line-height: 1.6;
}

/* Tooltip arrow */
.woodonate-progress-ultra-simple:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0,0,0,0.95);
    z-index: 9999;
}

/* Hide grey background in quick view completely */
.pafe-quick-view .woodonate-progress-mini,
.mfp-content .woodonate-progress-mini,
.quick-view-content .woodonate-progress-mini {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

/* Center goal text with info icon */
.woodonate-progress-ultra-simple .woodonate-progress-goal-text {
    font-size: 11px;
    font-weight: 600;
    color: inherit;
    opacity: 0.7;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.woodonate-progress-goal-text .goal-label {
    font-weight: 500;
}

.woodonate-progress-goal-text .goal-value {
    font-weight: 700;
}

/* Info icon styling */
.woodonate-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 13px;
    color: var(--theme-primary-color, #667eea);
    cursor: help;
    opacity: 0.8;
    transition: opacity 0.2s ease, transform 0.2s ease;
    font-style: normal;
    font-weight: bold;
}

.woodonate-info-icon:hover {
    opacity: 1;
    transform: scale(1.15);
}
