/**
 * Donation Form Styles - Baan Maa Brand Colors
 * Clean, modern, and responsive design
 * Brand Colors: Button #090965, Text #383737, Headlines #0E0C6E, Background White
 */

/* Container and Layout */
.donation-form-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.donation-form-container * {
    box-sizing: border-box;
}

/* Loading State */
.donation-loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #090965;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-small {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error State */
.donation-error {
    text-align: center;
    padding: 40px 20px;
    color: #dc3545;
}

/* Header Section */
.donation-header {
    text-align: center;
    margin-bottom: 30px;
}

.donation-image {
    width: 100%;
    max-width: 680px;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin: 0 auto 20px auto;
    display: block;
}

.donation-title {
    font-size: 28px;
    font-weight: 600;
    color: #0E0C6E;
    margin: 0 0 10px 0;
}

.donation-description {
    font-size: 16px;
    color: #383737;
    line-height: 1.5;
    margin: 0;
}

/* Donation Type Toggle */
.donation-type-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    background: #f8f9fa;
    padding: 5px;
    border-radius: 8px;
}

.toggle-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: #383737;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    color: #0E0C6E;
}

.toggle-btn.active {
    background: #090965;
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(9, 9, 101, 0.2);
}

/* Amount Selection */
.donation-amounts {
    margin-bottom: 30px;
}

.preset-amounts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.amount-btn {
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    background: #ffffff;
    color: #383737;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80px;
}

.amount-btn:hover {
    border-color: #090965;
    background: #f8f9ff;
}

.amount-btn.active {
    border-color: #090965;
    background: #090965;
    color: #ffffff;
}

/* Amount value - FIXED to prevent wrapping */
.amount-value {
    font-size: 24px;
    font-weight: 600;
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: baseline !important;
    justify-content: center !important;
    white-space: nowrap !important;
    overflow: visible !important;
    flex-wrap: nowrap !important;
}

.currency-symbol-inline {
    display: inline !important;
    margin-right: 1px;
}

.amount-number {
    display: inline !important;
}

.amount-label {
    font-size: 13px;
    margin-top: 5px;
    opacity: 0.8;
    display: block;
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    text-align: center !important;
    line-height: 1.3 !important;
    max-width: 100% !important;
}

/* Custom Amount Input */
.custom-amount-container {
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.custom-amount-container label {
    display: block;
    margin-bottom: 10px;
    color: #383737;
    font-size: 14px;
}

.custom-amount-input {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 300px;
}

.currency-symbol {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    font-weight: 500;
    color: #383737;
    pointer-events: none;
    z-index: 1;
}

#custom-amount,
[id^="custom-amount-"] {
    width: 100%;
    padding: 12px 12px 12px 45px;
    font-size: 18px;
    font-weight: 500;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: border-color 0.3s ease;
    color: #383737;
}

[id^="custom-amount-"]::placeholder {
    color: #999;
}

[id^="custom-amount-"]:focus {
    outline: none;
    border-color: #090965;
}

/* Remove number input spinners */
[id^="custom-amount-"]::-webkit-inner-spin-button,
[id^="custom-amount-"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

[id^="custom-amount-"][type=number] {
    -moz-appearance: textfield;
}

/* Submit Button */
.donation-submit-btn {
    width: 100%;
    padding: 16px 24px;
    background: #090965;
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.donation-submit-btn:hover:not(:disabled) {
    background: #0E0C6E;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(9, 9, 101, 0.3);
}

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

.btn-loading {
    display: inline-flex;
    align-items: center;
}

/* Stripe Badge */
.stripe-badge {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.stripe-badge p {
    font-size: 12px;
    color: #999;
    margin: 0 0 8px 0;
}

.stripe-badge svg {
    opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 480px) {
    .donation-form-container {
        padding: 15px;
    }

    .donation-title {
        font-size: 24px;
    }

    .donation-image {
        height: 250px;
    }

    .preset-amounts {
        grid-template-columns: 1fr;
    }

    .amount-btn {
        min-height: 60px;
    }

    .amount-value {
        font-size: 20px;
    }

    .donation-submit-btn {
        font-size: 16px;
        padding: 14px 20px;
    }
}

/* Stripe Payment Element Container */
.payment-element-container {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    display: none;
}

.payment-element-container.active {
    display: block;
}

#payment-element {
    min-height: 200px;
}

.payment-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    display: none;
}

.payment-message.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
    display: block;
}

.payment-message.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
    display: block;
}

/* Success State */
.donation-success {
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    background: #4CAF50;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-icon::after {
    content: '✓';
    color: white;
    font-size: 30px;
    font-weight: bold;
}

.success-title {
    color: #0E0C6E;
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 10px 0;
}

.success-message {
    color: #383737;
    font-size: 16px;
    line-height: 1.5;
}
