/**
 * Frontend styles for Masjid Donasi plugin
 *
 * @package Masjid_Donasi
 */

/* Modal styles */
.masjid-donasi-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.masjid-donasi-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.masjid-donasi-modal-container {
    position: relative;
    background: #fff;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.masjid-donasi-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s;
}

.masjid-donasi-modal-close:hover {
    background: #e5e7eb;
    color: #374151;
}

.masjid-donasi-modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.masjid-donasi-modal-header h2 {
    margin: 0 0 8px;
    font-size: 24px;
    color: #1f2937;
}

.masjid-donasi-modal-header .donasi-title {
    font-size: 16px;
    color: #0d9488;
    font-weight: 600;
    margin: 0;
}

.masjid-donasi-modal-header .payment-amount {
    font-size: 28px;
    font-weight: 700;
    color: #0d9488;
    margin: 8px 0 0;
}

/* Form styles */
.masjid-donasi-form .form-group {
    margin-bottom: 20px;
}

.masjid-donasi-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
    font-size: 14px;
}

.masjid-donasi-form label .required {
    color: #dc2626;
}

.masjid-donasi-form input[type="text"],
.masjid-donasi-form input[type="email"],
.masjid-donasi-form input[type="number"],
.masjid-donasi-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.masjid-donasi-form input:focus,
.masjid-donasi-form textarea:focus {
    outline: none;
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.masjid-donasi-form textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group-checkbox {
    display: flex;
    align-items: center;
}

.form-group-checkbox label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    cursor: pointer;
    font-weight: 400;
}

.form-group-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #0d9488;
}

/* Donation amount buttons */
.donation-amounts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.donation-amount-btn {
    padding: 12px 8px;
    border: 2px solid #e5e7eb;
    background: #fff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: #374151;
}

.donation-amount-btn:hover {
    border-color: #0d9488;
    background: #f0fdfa;
}

.donation-amount-btn.active {
    border-color: #0d9488;
    background: #0d9488;
    color: #fff;
}

/* Currency input */
.input-currency {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-prefix {
    position: absolute;
    left: 16px;
    font-weight: 600;
    color: #6b7280;
}

.input-currency input {
    padding-left: 42px !important;
}

/* Form actions */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.form-actions.center {
    justify-content: center;
}

.btn-submit-donation,
.btn-close-modal {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-submit-donation {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    color: #fff;
}

.btn-submit-donation:hover {
    background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
    transform: translateY(-1px);
}

.btn-submit-donation:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.btn-close-modal {
    background: #f3f4f6;
    color: #374151;
}

.btn-close-modal:hover {
    background: #e5e7eb;
}

.btn-back {
    padding: 14px 24px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: #374151;
}

.btn-back:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

/* QRIS section */
.qris-container {
    text-align: center;
    padding: 20px;
    background: #f9fafb;
    border-radius: 12px;
    margin-bottom: 24px;
}

.qris-image-wrapper {
    background: #fff;
    padding: 16px;
    border-radius: 8px;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.qris-image {
    max-width: 200px;
    height: auto;
}

.qris-instruction {
    margin-top: 16px;
    font-size: 14px;
    color: #6b7280;
}

/* File upload */
.file-upload-wrapper {
    position: relative;
}

.file-upload-wrapper input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    cursor: pointer;
}

.file-upload-wrapper input[type="file"]:hover {
    border-color: #0d9488;
    background: #f0fdfa;
}

.file-upload-preview {
    margin-top: 12px;
    position: relative;
    display: inline-block;
}

.file-upload-preview img {
    max-width: 150px;
    max-height: 150px;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
}

.remove-preview {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    border: none;
    background: #dc2626;
    color: #fff;
    border-radius: 50%;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.form-help {
    font-size: 12px;
    color: #6b7280;
    margin-top: 8px;
}

/* Thank you section */
.thank-you {
    padding: 40px 0;
}

.thank-you-icon {
    color: #0d9488;
    margin-bottom: 16px;
}

.thank-you .notice {
    font-size: 14px;
    color: #6b7280;
    margin-top: 16px;
}

/* Donation history section */
.donation-history-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid #e5e7eb;
}

.donation-history-section h3 {
    margin: 0 0 24px;
    font-size: 20px;
    color: #1f2937;
}

.donation-history-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.donation-history-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 12px;
}

.donor-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.donor-info {
    flex: 1;
}

.donor-name {
    font-weight: 600;
    color: #1f2937;
    display: block;
}

.donation-amount {
    color: #0d9488;
    font-weight: 600;
    display: block;
    margin-top: 4px;
}

.prayer-message {
    font-style: italic;
    color: #6b7280;
    font-size: 14px;
    margin: 8px 0 0;
}

.donation-date {
    font-size: 12px;
    color: #9ca3af;
    display: block;
    margin-top: 4px;
}

.no-donations {
    text-align: center;
    color: #6b7280;
    padding: 24px;
}

.load-more-container {
    text-align: center;
    margin-top: 24px;
}

.btn-load-more {
    padding: 12px 32px;
    border: 2px solid #0d9488;
    background: #fff;
    color: #0d9488;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-load-more:hover {
    background: #0d9488;
    color: #fff;
}

.btn-load-more:disabled {
    border-color: #9ca3af;
    color: #9ca3af;
    cursor: not-allowed;
}

/* Donor stats in sidebar */
.donation-donor-count {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.donation-donor-count .icon {
    width: 24px;
    height: 24px;
    color: #0d9488;
}

.donation-donor-count span {
    color: #6b7280;
    font-size: 14px;
}

.donation-donor-count strong {
    color: #1f2937;
}

/* Error message */
.form-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 480px) {
    .masjid-donasi-modal-container {
        padding: 24px 20px;
        width: 95%;
    }

    .donation-amounts {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-actions {
        flex-direction: column;
    }

    .btn-back {
        order: 2;
    }
}