/* ═══════════════════════════════════════════════════════
   TDF Donation Management — Public Frontend Styles
   ═══════════════════════════════════════════════════════ */

/* ── Donation Form ────────────────────────────────────── */
.tdf-donation-form-wrap {
    --tdf-color: #0d9488;
    --tdf-color-dark: color-mix(in srgb, var(--tdf-color) 80%, #000);
    --tdf-color-light: color-mix(in srgb, var(--tdf-color) 12%, #fff);
    --tdf-radius: 10px;
    --tdf-gray-50: #f9fafb;
    --tdf-gray-100: #f3f4f6;
    --tdf-gray-200: #e5e7eb;
    --tdf-gray-500: #6b7280;
    --tdf-gray-700: #374151;
    --tdf-gray-900: #111827;
    max-width: 520px;
    margin: 0 auto;
}

.tdf-donation-form {
    background: #fff;
    border-radius: var(--tdf-radius);
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--tdf-gray-200);
}

.tdf-field-group {
    margin-bottom: 16px;
}

.tdf-label {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    font-weight: 600;
    color: var(--tdf-gray-700);
    margin-bottom: 6px;
    font-size: 0.875em;
}

.tdf-required {
    color: #dc2626;
}

/* ── Tooltips ─────────────────────────────────────────── */
.tdf-tooltip-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: help;
    color: #0f172a;
    background: #e2e8f0;
    border-radius: 50%;
    padding: 2px;
}
.tdf-tooltip-wrap svg {
    width: 14px;
    height: 14px;
}
.tdf-tooltip-wrap:hover .tdf-tooltip-text {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.tdf-tooltip-text {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    width: 250px;
    background: #1f2937;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 400;
    line-height: 1.5;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 10;
    pointer-events: none;
}
.tdf-tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #1f2937 transparent transparent transparent;
}

.tdf-input, .tdf-select, .tdf-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid var(--tdf-gray-200);
    border-radius: 8px;
    font-size: 0.9375em;
    color: var(--tdf-gray-900);
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    font-family: inherit !important;
}
.tdf-input::placeholder, .tdf-textarea::placeholder {
    font-family: inherit !important;
    color: #9ca3af;
}
.tdf-input:focus, .tdf-select:focus, .tdf-textarea:focus {
    outline: none;
    border-color: var(--tdf-color);
    box-shadow: 0 0 0 3px var(--tdf-color-light);
}

.tdf-input.tdf-error {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* ── Preset Amount Buttons ────────────────────────────── */
.tdf-preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.tdf-preset-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: 2px solid var(--tdf-gray-200);
    border-radius: 8px;
    background: var(--tdf-gray-50);
    font-size: 0.9375em;
    font-weight: 600;
    color: var(--tdf-gray-700);
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 80px;
    text-align: center;
    white-space: nowrap;
}
.tdf-preset-btn:hover {
    border-color: var(--tdf-color);
    color: var(--tdf-color);
    background: var(--tdf-color-light);
}
.tdf-preset-btn.active {
    background: var(--tdf-color);
    color: #fff;
    border-color: var(--tdf-color);
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.3);
}

/* ── Custom Amount Input ──────────────────────────────── */
.tdf-custom-amount {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--tdf-gray-200);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.tdf-custom-amount:focus-within {
    border-color: var(--tdf-color);
    box-shadow: 0 0 0 3px var(--tdf-color-light);
}
.tdf-currency-prefix {
    padding: 8px 12px;
    background: var(--tdf-gray-50);
    color: var(--tdf-gray-500);
    font-weight: 700;
    font-size: 1em;
    border-right: 1px solid var(--tdf-gray-200);
}
.tdf-amount-input {
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    align-items: center;
    flex: 1;
    font-size: 1em;
    font-weight: 600;
    background: transparent;
    font-family: inherit;
}
.tdf-amount-input:focus {
    outline: none;
    box-shadow: none !important;
}
.tdf-custom-amount.is-readonly {
    background: var(--tdf-gray-100);
    cursor: default;
}
.tdf-custom-amount.is-readonly .tdf-amount-input {
    pointer-events: none;
    cursor: default;
}
.tdf-custom-amount.is-readonly .tdf-currency-prefix {
    background: var(--tdf-gray-200);
}

/* ── Gateway Options ──────────────────────────────────── */
.tdf-gateway-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tdf-gateway-option {
    display: block;
    width: 100%;
    cursor: pointer;
}
.tdf-gateway-option input[type="radio"] {
    display: none;
}
.tdf-gateway-label {
    display: block;
    border: 1px solid var(--tdf-gray-200);
    border-radius: 6px;
    background: #fff;
    transition: all 0.2s ease;
    overflow: hidden;
}
.tdf-gateway-label:hover {
    border-color: var(--tdf-color);
}
.tdf-gateway-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: #fff;
    transition: background 0.2s ease;
}
.tdf-gateway-title {
    font-weight: 500;
    font-size: 1em;
    color: var(--tdf-gray-700);
}
.tdf-gateway-desc {
    display: none;
    padding: 12px 16px;
    font-size: 0.85em;
    color: var(--tdf-gray-500);
    border-top: 1px solid var(--tdf-gray-200);
    background: var(--tdf-gray-50);
}
.tdf-gateway-option input:checked + .tdf-gateway-label {
    border-color: var(--tdf-color);
    box-shadow: 0 0 0 1px var(--tdf-color);
}
.tdf-gateway-option input:checked + .tdf-gateway-label .tdf-gateway-header {
    background: #fffcf5;
}
.tdf-gateway-option input:checked + .tdf-gateway-label .tdf-gateway-desc {
    display: block;
}
.tdf-gateway-icon {
    width: 80px;
    height: 36px;
    object-fit: contain;
}

/* ── Manual Gateway Instructions ──────────────────────── */
.tdf-manual-instructions {
    background: var(--tdf-gray-50);
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 5px;
    font-size: 0.8125em;
    color: var(--tdf-gray-500);
    line-height: 1.6;
    white-space: pre-line;
    border: 1px solid var(--tdf-gray-200);
}

/* ── Submit Button ────────────────────────────────────── */
.tdf-submit-btn {
    width: 100%;
    padding: 14px 24px;
    background: var(--tdf-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    gap: 8px;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}
.tdf-submit-btn:hover {
    background: var(--tdf-color-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}
.tdf-submit-btn:active {
    transform: translateY(0);
}
.tdf-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.tdf-spinner {
    width: 20px;
    height: 20px;
    animation: tdf-spin 1s linear infinite;
}
@keyframes tdf-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ── Messages ─────────────────────────────────────────── */
.tdf-form-message {
    margin-top: 15px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
}
.tdf-form-message.tdf-msg-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.tdf-form-message.tdf-msg-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ── Thank You Page ───────────────────────────────────── */
.tdf-thank-you {
    text-align: center;
    max-width: 500px;
    margin: 40px auto;
    font-family: system-ui, -apple-system, sans-serif;
}
.tdf-thank-you-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d9488, #065f46);
    color: #fff;
    font-size: 36px;
    line-height: 70px;
    margin: 0 auto 20px;
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.3);
}
.tdf-thank-you h2 {
    color: #0d9488;
    font-size: 28px;
    margin-bottom: 8px;
}
.tdf-receipt-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin: 25px 0;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
    text-align: left;
}
.tdf-receipt-table {
    width: 100%;
    border-collapse: collapse;
}
.tdf-receipt-table td {
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}
.tdf-receipt-table tr:last-child td {
    border-bottom: none;
}
.tdf-receipt-label {
    color: #6b7280;
    font-weight: 500;
    width: 130px;
}
.tdf-receipt-amount {
    font-size: 22px;
    font-weight: 700;
    color: #0d9488;
}
.tdf-dua {
    color: #6b7280;
    font-style: italic;
    margin-top: 20px;
}

/* ── Status Badges (public) ───────────────────────────── */
.tdf-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.tdf-status-pending   { background: #fef3c7; color: #92400e; }
.tdf-status-completed { background: #d1fae5; color: #065f46; }
.tdf-status-failed    { background: #fee2e2; color: #991b1b; }

/* ── Campaign Progress Widget ─────────────────────────── */
.tdf-progress-widget {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    border: 1px solid #e5e7eb;
    font-family: system-ui, sans-serif;
}
.tdf-progress-title {
    margin: 0 0 12px;
    font-size: 16px;
    color: #111827;
}
.tdf-progress-bar-wrap {
    height: 12px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 10px;
}
.tdf-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #0d9488, #14b8a6);
    border-radius: 6px;
    transition: width 1s ease;
    min-width: 2%;
}
.tdf-progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}
.tdf-progress-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 480px) {
    .tdf-donation-form {
        padding: 20px 16px;
    }
    .tdf-preset-buttons {
        gap: 6px;
    }
    .tdf-preset-btn {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 70px;
    }
    .tdf-gateway-options {
        flex-direction: column;
    }
}

/* ── Dashboard Layout ─────────────────────────────────── */
.tdf-dashboard-wrapper {
    font-family: inherit;
    max-width: 1000px;
    margin: 0 auto;
}
.tdf-dashboard-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}
.tdf-dashboard-sidebar {
    width: 280px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    flex-shrink: 0;
}
.tdf-sidebar-profile {
    padding: 30px 20px;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}
.tdf-profile-avatar {
    width: 64px;
    height: 64px;
    background: var(--tdf-color);
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    line-height: 64px;
    border-radius: 50%;
    margin: 0 auto 12px;
}
.tdf-profile-name {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}
.tdf-profile-phone {
    font-size: 14px;
    color: #64748b;
}
.tdf-dashboard-nav {
    list-style: none;
    margin: 0;
    padding: 15px 0;
}
.tdf-dashboard-nav li {
    margin: 0;
    padding: 0;
}
.tdf-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: #475569;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}
.tdf-nav-link:hover {
    background: #f8fafc;
    color: var(--tdf-color);
}
.tdf-nav-link.active {
    background: #f0fdf4;
    color: var(--tdf-color);
    border-left-color: var(--tdf-color);
}
.tdf-sidebar-footer {
    border-top: 1px solid #e2e8f0;
    padding: 10px 0;
}
.tdf-logout-link {
    color: #ef4444;
}
.tdf-logout-link:hover {
    background: #fef2f2;
    color: #dc2626;
}
.tdf-dashboard-main {
    flex-grow: 1;
    min-width: 0;
}
.tdf-dash-title {
    margin: 0 0 25px;
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
}
.tdf-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.tdf-summary-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    border: 1px solid #e2e8f0;
}
.tdf-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.tdf-card-label {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 4px;
    font-weight: 500;
}
.tdf-card-value {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
}
.tdf-dash-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.04);
    border: 1px solid #e2e8f0;
}
.tdf-table-responsive {
    overflow-x: auto;
}
.tdf-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}
.tdf-table th {
    background: #f8fafc;
    padding: 14px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}
.tdf-table td {
    padding: 16px;
    font-size: 14px;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.tdf-table tr:last-child td {
    border-bottom: none;
}
.tdf-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.tdf-badge-pending { background: #fef3c7; color: #b45309; }
.tdf-badge-completed { background: #dcfce7; color: #15803d; }
.tdf-badge-failed { background: #fee2e2; color: #b91c1c; }
.tdf-badge-active { background: #e0e7ff; color: #4338ca; }
.tdf-badge-cancelled { background: #f1f5f9; color: #64748b; }
.tdf-btn-cancel-sub {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #fee2e2;
    color: #dc2626;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.tdf-btn-cancel-sub:hover {
    background: #fca5a5;
}
@keyframes tdfFadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 768px) {
    .tdf-dashboard-layout {
        flex-direction: column;
    }
    .tdf-dashboard-sidebar {
        width: 100%;
    }
}
