/**
 * Frontend Styles for Unipads Donation Management System
 */

/* Amount Presets */
.unipads-amount-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 5px;
}

.unipads-preset-btn {
    background: #f0f3ff;
    border: 1px solid #d3d9f3;
    color: #2b357f;
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    user-select: none;
}

.unipads-preset-btn:hover {
    background: #e1e6fc;
    border-color: #2b357f;
    color: #2b357f;
}

.unipads-preset-btn.active {
    background: #c61c53;
    border-color: #c61c53;
    color: #ffffff;
    box-shadow: 0 3px 8px rgba(198, 28, 83, 0.3);
}

/* Form Messages */
.donation-alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 15px;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: fadeIn 0.3s ease;
}

.donation-alert-error {
    background-color: #fde8e8;
    border: 1px solid #f8b4b4;
    color: #9b1c1c;
}

.donation-alert-success {
    background-color: #def7ec;
    border: 1px solid #bcf0da;
    color: #03543f;
}

.donation-alert-warning {
    background-color: #fdf6b2;
    border: 1px solid #fce96b;
    color: #723b13;
}

.donation-alert-icon {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Button Loading State */
.btn_theme.is-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.85;
}

.btn_theme .btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

.btn_theme:disabled,
.btn_theme.disabled {
    opacity: 0.7;
    cursor: not-allowed !important;
    pointer-events: none;
    background-color: #94a3b8 !important;
    border-color: #94a3b8 !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

/* Test Payment Gateway Modal */
.unipads-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.25s ease;
}

.unipads-payment-dialog {
    background: #ffffff;
    width: 100%;
    max-width: 520px;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    position: relative;
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.unipads-payment-header {
    background: #2b357f;
    color: #ffffff;
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.unipads-payment-header h4 {
    margin: 0;
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
}

.unipads-modal-close-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.unipads-modal-close-btn:hover {
    opacity: 1;
}

.unipads-payment-body {
    padding: 24px;
}

.unipads-order-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.unipads-order-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 14px;
    color: #4b5563;
}

.unipads-order-row:last-child {
    margin-bottom: 0;
}

.unipads-order-row.amount-row {
    border-top: 1px dashed #cbd5e1;
    padding-top: 8px;
    margin-top: 8px;
    font-size: 18px;
    font-weight: 700;
    color: #c61c53;
}

.unipads-attempt-counter {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    color: #3730a3;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.unipads-attempt-counter.has-retries {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.unipads-attempt-counter.is-last-attempt {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.unipads-gateway-badge {
    display: inline-block;
    background: #2b357f;
    color: #ffffff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.unipads-payment-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.unipads-btn-pay {
    background: #c61c53;
    color: #ffffff;
    border: none;
    padding: 13px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.unipads-btn-pay:hover {
    background: #a81645;
    color: #ffffff;
    transform: translateY(-1px);
}

.unipads-simulate-failure-box {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #e2e8f0;
}

.unipads-simulate-failure-box label {
    font-size: 12px;
    color: #6b7280;
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
}

.unipads-btn-fail {
    background: #f3f4f6;
    color: #4b5563;
    border: 1px solid #d1d5db;
    padding: 9px 15px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.unipads-btn-fail:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

.unipads-payment-footer {
    padding: 14px 24px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    font-size: 12px;
    color: #64748b;
}

/* 80G Receipt Container & Responsiveness */
.unipads-receipt-wrapper {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    padding: 30px;
    margin: 30px auto;
    max-width: 760px;
    width: 100%;
    box-sizing: border-box;
}

.unipads-receipt {
    max-width: 700px;
    margin: 0 auto;
    background: #ffffff;
    border: 2px solid #2b357f;
    border-radius: 8px;
    padding: 30px;
    font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #333333;
    box-sizing: border-box;
    width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
}

.unipads-receipt * {
    box-sizing: border-box;
}

.unipads-receipt-header {
    border-bottom: 2px solid #c61c53;
    padding-bottom: 15px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.unipads-receipt-ngo {
    flex: 1 1 280px;
    min-width: 0;
}

.unipads-receipt-ngo h2 {
    margin: 0;
    color: #2b357f;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
}

.unipads-receipt-ngo p {
    margin: 4px 0 0;
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

.unipads-receipt-badge-wrap {
    flex-shrink: 0;
    align-self: flex-start;
}

.unipads-receipt-badge {
    display: inline-block;
    background: #c61c53;
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    text-transform: uppercase;
}

.unipads-receipt-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 14px;
    gap: 15px;
    flex-wrap: wrap;
}

.unipads-receipt-meta-left {
    flex: 1 1 240px;
    min-width: 0;
}

.unipads-receipt-meta-right {
    flex: 1 1 200px;
    min-width: 0;
    text-align: right;
}

.unipads-receipt-meta p {
    margin: 4px 0 0;
    word-break: break-all;
    overflow-wrap: anywhere;
}

.unipads-receipt-meta p:first-child {
    margin-top: 0;
}

.unipads-receipt-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
}

.unipads-receipt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    table-layout: auto;
}

.unipads-receipt-table th,
.unipads-receipt-table td {
    padding: 10px 12px;
    border: 1px solid #dddddd;
    text-align: left;
    vertical-align: middle;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.unipads-receipt-table th {
    width: 35%;
    font-weight: 600;
    color: #333333;
}

.unipads-receipt-table td {
    width: 65%;
}

.unipads-receipt-table tr.row-alt {
    background: #f0f3ff;
}

.unipads-receipt-table tr.row-amount {
    background: #fff5f7;
}

.unipads-receipt-table tr.row-amount th {
    font-size: 15px;
    color: #c61c53;
}

.unipads-receipt-table tr.row-amount td {
    font-size: 19px;
    font-weight: 700;
    color: #c61c53;
}

.unipads-receipt-80g-box {
    background: #edf0ff;
    border-left: 4px solid #2b357f;
    padding: 12px 15px;
    margin-bottom: 25px;
    font-size: 13px;
    line-height: 1.5;
    border-radius: 0 4px 4px 0;
}

.unipads-receipt-80g-box p {
    margin: 0;
}

.unipads-receipt-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-top: 15px;
    border-top: 1px dashed #cccccc;
    font-size: 12px;
    color: #777777;
    gap: 12px;
    flex-wrap: wrap;
}

.unipads-receipt-footer p {
    margin: 2px 0 0;
}

.unipads-receipt-footer p:first-child {
    margin-top: 0;
}

.unipads-receipt-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 25px;
    flex-wrap: wrap;
}

.unipads-receipt-btn {
    padding: 10px 24px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-sizing: border-box;
}

.unipads-btn-print {
    background: #2b357f;
    color: #ffffff;
    border: 1px solid #2b357f;
}

.unipads-btn-print:hover {
    background: #1f275e;
    color: #ffffff;
}

.unipads-btn-home {
    background: #c61c53;
    color: #ffffff;
    border: 1px solid #c61c53;
}

.unipads-btn-home:hover {
    background: #a81645;
    color: #ffffff;
}

/* Tablet Media Query (max-width: 768px) */
@media screen and (max-width: 768px) {
    .unipads-receipt-wrapper {
        padding: 20px 16px;
        margin: 20px auto;
    }

    .unipads-receipt {
        padding: 22px 18px;
    }

    .unipads-receipt-ngo h2 {
        font-size: 20px;
    }

    .unipads-receipt-table th {
        width: 38%;
    }

    .unipads-receipt-table td {
        width: 62%;
    }
}

/* Mobile Media Query (max-width: 576px) */
@media screen and (max-width: 576px) {
    .unipads-receipt-wrapper {
        padding: 12px 8px;
        margin: 15px auto;
        border-radius: 8px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    }

    .unipads-receipt {
        padding: 16px 12px;
        border-width: 1.5px;
        border-radius: 6px;
    }

    .unipads-receipt-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding-bottom: 12px;
        margin-bottom: 15px;
    }

    .unipads-receipt-ngo h2 {
        font-size: 18px;
    }

    .unipads-receipt-ngo p {
        font-size: 12px;
    }

    .unipads-receipt-badge {
        font-size: 11px;
        padding: 4px 10px;
    }

    .unipads-receipt-meta {
        flex-direction: column;
        gap: 8px;
        margin-bottom: 15px;
        font-size: 13px;
    }

    .unipads-receipt-meta-right {
        text-align: left;
    }

    .unipads-receipt-table th,
    .unipads-receipt-table td {
        padding: 8px 9px;
        font-size: 12.5px;
    }

    .unipads-receipt-table th {
        width: 40%;
        font-size: 12px;
    }

    .unipads-receipt-table td {
        width: 60%;
    }

    .unipads-receipt-table tr.row-amount th {
        font-size: 13px;
    }

    .unipads-receipt-table tr.row-amount td {
        font-size: 16px;
    }

    .unipads-receipt-80g-box {
        padding: 10px 12px;
        font-size: 12px;
        margin-bottom: 18px;
    }

    .unipads-receipt-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        font-size: 11px;
        padding-top: 12px;
    }

    .unipads-receipt-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        width: 100%;
    }

    .unipads-receipt-btn,
    .unipads-receipt-actions .btn,
    .unipads-receipt-actions a,
    .unipads-receipt-actions a button {
        width: 100% !important;
        margin-right: 0 !important;
        text-align: center;
        justify-content: center;
        padding: 12px 18px !important;
        font-size: 14px;
        display: block !important;
        box-sizing: border-box !important;
    }
}

/* Extra Small Mobile (max-width: 380px) */
@media screen and (max-width: 380px) {
    .unipads-receipt {
        padding: 12px 8px;
    }

    .unipads-receipt-ngo h2 {
        font-size: 17px;
    }

    .unipads-receipt-table th,
    .unipads-receipt-table td {
        padding: 7px 6px;
        font-size: 12px;
    }
}

/* Print CSS */
@media print {
    body * {
        visibility: hidden;
    }
    #unipads-printable-receipt,
    #unipads-printable-receipt * {
        visibility: visible;
    }
    #unipads-printable-receipt {
        position: absolute;
        left: 0;
        top: 0;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 20px !important;
        border: none !important;
        box-shadow: none !important;
    }
    .unipads-receipt-actions,
    nav,
    footer,
    header {
        display: none !important;
    }
}

