/* DonorDesk WP Plugin v2 — Frontend */
:root { --ddc: #10b981; }

/* ── Floating Button ── */
#dd-float-btn {
    position: fixed; bottom: 28px; z-index: 9998;
    display: flex; align-items: center; gap: 8px;
    padding: 14px 22px; color: #fff; border: none; cursor: pointer;
    border-radius: 50px; font-size: 15px; font-weight: 700;
    box-shadow: 0 4px 20px rgba(0,0,0,.25); transition: transform .2s, box-shadow .2s;
    font-family: -apple-system, sans-serif;
}
#dd-float-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,.3); }
.dd-float-right { right: 28px; }
.dd-float-left  { left: 28px; }
.dd-float-icon  { font-size: 18px; }

/* ── Popup Modal ── */
#dd-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.6);
    z-index: 9999; align-items: center; justify-content: center; padding: 16px;
}
#dd-modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 500px;
    max-height: 90vh; overflow-y: auto; position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
#dd-modal-close {
    position: sticky; top: 0; float: right; margin: 10px 10px 0 0;
    background: rgba(0,0,0,.1); border: none; border-radius: 50%;
    width: 30px; height: 30px; cursor: pointer; font-size: 16px;
    display: flex; align-items: center; justify-content: center; z-index: 1;
}
#dd-modal-content { clear: both; }

/* ── Donation Form ── */
.dd-form-wrap {
    max-width: 500px; margin: 0 auto; background: #fff;
    border-radius: 12px; box-shadow: 0 4px 24px rgba(0,0,0,.08);
    overflow: hidden; font-family: -apple-system, sans-serif;
}
.dd-fh { padding: 20px 24px; color: #fff; }
.dd-fh h3 { margin: 0 0 4px; font-size: 20px; font-weight: 800; }
.dd-fh-sub { margin: 0; font-size: 12px; opacity: .85; }

/* Type Toggle */
.dd-type-toggle {
    display: flex; border-bottom: 1px solid #f3f4f6; padding: 0 16px;
}
.dd-type-btn {
    flex: 1; padding: 12px; border: none; background: none;
    font-size: 14px; font-weight: 600; cursor: pointer; color: #6b7280;
    border-bottom: 2px solid transparent; transition: all .2s; margin-bottom: -1px;
}
.dd-type-btn.dd-type-active { color: var(--ddc); border-bottom-color: var(--ddc); }
.dd-type-btn.dd-type-locked { opacity: .5; cursor: not-allowed; }

/* Frequency Buttons */
.dd-freq-row { display: flex; gap: 6px; padding: 10px 16px; flex-wrap: wrap; }
.dd-freq-btn {
    padding: 6px 12px; border: 1.5px solid #e5e7eb; border-radius: 20px;
    background: #fff; cursor: pointer; font-size: 12px; font-weight: 600;
    color: #374151; transition: all .2s;
}
.dd-freq-btn.dd-freq-active { border-color: var(--ddc); color: var(--ddc); background: rgba(16,185,129,.06); }

/* Form Sections */
.dd-pub-form { padding: 0; }
.dd-fs { padding: 16px 20px 0; }
.dd-fs-title {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: #9ca3af; margin-bottom: 10px;
}
.dd-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dd-f { display: flex; flex-direction: column; margin-bottom: 10px; }
.dd-f label { font-size: 12px; font-weight: 600; color: #374151; margin-bottom: 3px; }
.dd-req { color: #ef4444; }
.dd-pan-note { font-size: 11px; color: #f59e0b; font-weight: 400; margin-left: 4px; }
.dd-f input, .dd-f textarea, .dd-f select {
    padding: 9px 11px; border: 1.5px solid #e5e7eb; border-radius: 7px;
    font-size: 14px; outline: none; transition: border-color .2s;
    font-family: inherit;
}
.dd-f input:focus, .dd-f textarea:focus { border-color: var(--ddc); }
.dd-words { font-size: 11px; color: var(--ddc); font-style: italic; margin-top: 3px; min-height: 16px; }
.dd-recurring-calc { padding: 0 20px; }
.dd-calc-text { font-size: 12px; color: #6b7280; background: #f0fdf4; padding: 6px 10px; border-radius: 6px; display: inline-block; }

/* Amount Presets */
.dd-presets { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.dd-preset {
    padding: 8px 14px; border: 1.5px solid #e5e7eb; border-radius: 6px;
    background: #fff; cursor: pointer; font-size: 13px; font-weight: 600;
    color: #374151; transition: all .2s;
}
.dd-preset:hover, .dd-preset.dd-p-active {
    border-color: var(--ddc); color: var(--ddc); background: rgba(16,185,129,.06);
}

/* Payment Methods */
.dd-pm-opt { display: flex; align-items: center; cursor: pointer; margin-bottom: 8px; }
.dd-pm-opt input[type=radio] { margin-right: 10px; flex-shrink: 0; }
.dd-pm-lbl {
    display: flex; align-items: center; gap: 10px; flex: 1;
    padding: 10px 12px; border: 1.5px solid #e5e7eb;
    border-radius: 8px; transition: border-color .2s;
}
.dd-pm-opt input:checked + .dd-pm-lbl { border-color: var(--ddc); background: rgba(16,185,129,.04); }
.dd-pm-icon { font-size: 20px; }
.dd-pm-lbl strong { font-size: 13px; display: block; line-height: 1.3; }
.dd-pm-lbl small { font-size: 11px; color: #9ca3af; }
.dd-pm-badge { margin-left: auto; font-size: 10px; background: #d1fae5; color: #065f46; padding: 2px 7px; border-radius: 10px; font-weight: 700; }

/* Submit */
.dd-submit {
    display: block; width: calc(100% - 40px); margin: 16px 20px 4px;
    padding: 14px; color: #fff; border: none; cursor: pointer;
    border-radius: 8px; font-size: 16px; font-weight: 800;
    transition: opacity .2s; font-family: inherit;
}
.dd-submit:hover { opacity: .9; }
.dd-sub-note { text-align: center; font-size: 11px; color: #9ca3af; margin: 0 0 16px; }
.dd-err { margin: 0 20px 10px; padding: 10px; background: #fef2f2; border-left: 3px solid #ef4444; border-radius: 6px; font-size: 13px; color: #b91c1c; }
.dd-ok  { margin: 0 20px 10px; padding: 20px; text-align: center; background: #f0fdf4; border-radius: 8px; }
.dd-ok h4 { font-size: 22px; margin: 0 0 8px; }

/* Stats widget */
.dd-stats-widget {
    display: flex; gap: 20px; flex-wrap: wrap; justify-content: center;
    padding: 20px; background: #f0fdf4; border-radius: 12px; border: 2px solid #a7f3d0;
}
.dd-sw-item { text-align: center; }
.dd-sw-num { font-size: 28px; font-weight: 800; color: var(--ddc); }
.dd-sw-lbl { font-size: 12px; color: #6b7280; }

/* Donor wall */
.dd-donor-wall { display: flex; flex-wrap: wrap; gap: 10px; }
.dd-donor-chip {
    display: flex; align-items: center; gap: 8px; padding: 8px 12px;
    background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 20px;
}
.dd-chip-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--ddc); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700;
}
.dd-chip-amt { font-size: 12px; color: var(--ddc); font-weight: 700; }

.dd-notice { padding: 10px 14px; background: #fffbeb; border-left: 3px solid #f59e0b; border-radius: 6px; font-size: 14px; }

@media(max-width:600px){
    .dd-row-2 { grid-template-columns: 1fr; }
    .dd-presets { gap: 5px; }
    .dd-preset { padding: 6px 10px; font-size: 12px; }
    #dd-modal-box { max-height: 95vh; border-radius: 12px 12px 0 0; }
    #dd-modal-overlay { align-items: flex-end; padding: 0; }
}
