/**
 * Stone Soup Donation Form Styles
 */

/* Override Elementor widget spacing */
.elementor-widget-shortcode .stonesoup-donation-form {
    margin: 0 auto;
}

.stonesoup-donation-form {
    max-width: 700px;
    margin: 3rem auto;
    padding: 3rem;
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

/* Ensure form elements aren't squished */
.stonesoup-donation-form * {
    box-sizing: border-box;
}

.donation-description {
    margin-bottom: 3rem;
    text-align: center;
}

.donation-description p {
    font-size: 1.125rem;
    color: #666;
    line-height: 1.6;
    margin: 0;
}

/* Amount Selection */
.donation-amounts {
    margin-bottom: 2.5rem;
}

.donation-amount-label {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 1.5rem;
    text-align: center;
}

.donation-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.donation-button {
    position: relative;
    cursor: pointer;
    margin: 0;
    display: block;
}

.donation-button input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.donation-button .amount-label {
    display: block;
    padding: 1.25rem 0.75rem;
    background: #fafafa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
    transition: all 0.2s ease;
    cursor: pointer;
    user-select: none;
}

.donation-button:hover .amount-label {
    background: #f0f0f0;
    border-color: #60a672;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(96, 166, 114, 0.2);
}

.donation-button input[type="radio"]:checked + .amount-label {
    background: #60a672;
    border-color: #60a672;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(96, 166, 114, 0.4);
}

.donation-button input[type="radio"]:focus + .amount-label {
    outline: 3px solid #4a90d9;
    outline-offset: 2px;
}

/* Custom Amount */
.custom-amount-wrapper {
    display: none;
    margin: 2rem 0;
    padding: 2rem;
    background: #f8f8f8;
    border-radius: 8px;
}

.custom-amount-wrapper.show {
    display: block;
}

.custom-amount-wrapper label {
    display: block;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 1rem;
}

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

.custom-amount-input .currency-symbol {
    position: absolute;
    left: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #666;
    pointer-events: none;
}

.custom-amount-input input[type="number"] {
    width: 100%;
    padding: 1rem 1.25rem 1rem 2.75rem;
    font-size: 1.375rem;
    font-weight: 600;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #ffffff;
    transition: border-color 0.2s ease;
}

.custom-amount-input input[type="number"]:focus {
    outline: none;
    border-color: #60a672;
    box-shadow: 0 0 0 3px rgba(96, 166, 114, 0.1);
}

.amount-note {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #666;
    font-style: italic;
}

/* Submit Button */
.donation-submit-button {
    width: 100%;
    padding: 1.5rem 2.5rem;
    background: #60a672;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 1.375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2.5rem;
}

.donation-submit-button:hover {
    background: #4f8a5e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(96, 166, 114, 0.3);
}

.donation-submit-button:active {
    transform: translateY(0);
}

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

.donation-submit-button.loading {
    position: relative;
}

.donation-submit-button.loading::after {
    content: '';
    position: absolute;
    right: 1.5rem;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Security Note */
.donation-security {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #666;
    margin: 0;
}

.security-note svg {
    color: #60a672;
}

/* Messages */
.donation-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
}

.donation-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.donation-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive */
@media (max-width: 768px) {
    .stonesoup-donation-form {
        padding: 2rem 1.5rem;
        margin: 1.5rem auto;
    }

    .donation-buttons {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }

    .donation-button .amount-label {
        padding: 1rem 0.5rem;
        font-size: 1.125rem;
    }
}

@media (max-width: 600px) {
    .stonesoup-donation-form {
        padding: 1.5rem;
        margin: 1rem;
    }

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

    .donation-button .amount-label {
        padding: 0.875rem 0.5rem;
        font-size: 1rem;
    }

    .donation-submit-button {
        font-size: 1.125rem;
        padding: 1rem 1.5rem;
    }

    .custom-amount-wrapper {
        padding: 1.5rem;
    }
}

@media (max-width: 400px) {
    .donation-buttons {
        grid-template-columns: 1fr;
    }
}
