@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.4;
}

.donation-container {
    max-width: 420px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-top: 20px;
    margin-bottom: 20px;
}

/* Header Section */
.donation-header {
    padding: 24px 24px 0;
    text-align: center;
}

.donation-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    text-align: center;
}

/* Your contribution section */
.contribution-section {
    padding: 20px 24px;
}

.contribution-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.contribution-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.edit-icon {
    width: 32px;
    height: 32px;
    background: #ffd700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    font-size: 16px;
}

/* Frequency Toggle */
.frequency-toggle {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: visible; /* Changed from hidden to visible for dropdown */
    margin-bottom: 60px; /* Increased margin to make room for dropdown */
    background: white;
    position: relative;
    z-index: 10;
}

.frequency-option {
    flex: 1;
    position: relative;
}

.frequency-option input[type="radio"] {
    display: none;
}

.frequency-option label {
    display: block;
    padding: 12px 16px;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-right: 1px solid #ddd;
    background: white;
    transition: all 0.2s ease;
}

.frequency-option:last-child label {
    border-right: none;
}

.frequency-option input[type="radio"]:checked + label {
    background: #e3f2fd;
    color: #1565c0;
    font-weight: 600;
}

/* Recurring frequency dropdown */
.frequency-option.recurring {
    position: relative;
}

.frequency-option.recurring label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.frequency-text {
    flex: 1;
}

.dropdown-arrow {
    font-size: 12px;
    transition: transform 0.2s ease;
    margin-left: 8px;
}

.frequency-option.recurring input[type="radio"]:checked + label .dropdown-arrow {
    transform: rotate(180deg);
}

.frequency-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 6px 6px;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    min-height: 80px;
}

/* Show dropdown when open class is added */
.frequency-dropdown.open {
    display: block !important;
}

.dropdown-option {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    transition: background-color 0.2s ease;
}

.dropdown-option:hover {
    background: #f5f5f5;
}

.dropdown-option.selected {
    background: #e3f2fd;
    color: #1565c0;
    font-weight: 600;
}

.dropdown-option:first-child {
    border-radius: 0;
}

.dropdown-option:last-child {
    border-radius: 0 0 6px 6px;
}

/* Amount Grid */
.amount-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.amount-btn {
    padding: 16px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 18px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.amount-btn:hover {
    border-color: #e3f2fd;
    background: #f3f9ff;
}

.amount-btn.selected {
    background: #e3f2fd;
    border-color: #90caf9;
    color: #1565c0;
    font-weight: 600;
}

/* Other Amount */
.other-amount {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 16px 12px;
    background: white;
    font-size: 18px;
    font-weight: 500;
    color: #666;
    text-align: center;
    cursor: pointer;
    margin-bottom: 16px;
    transition: all 0.2s ease;
}

.other-amount:hover {
    border-color: #e3f2fd;
    background: #f3f9ff;
}

.other-amount.active {
    background: #e3f2fd;
    border-color: #90caf9;
    color: #1565c0;
}

/* Custom Amount Input */
.custom-amount-input {
    width: 100%;
    padding: 16px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 500;
    text-align: center;
    background: white;
    margin-bottom: 16px;
    display: none;
}

.custom-amount-input.active {
    display: block;
}

.custom-amount-input:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

/* Currency Note */
.currency-note {
    text-align: center;
    font-size: 14px;
    color: #666;
    margin-bottom: 24px;
}

/* Give Button */
.give-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #1976d2, #1565c0);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 87, 34, 0.3);
}

.give-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 87, 34, 0.4);
}

.give-btn:active {
    transform: translateY(0);
}

/* Security Notice */
.security-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

.security-icon {
    font-size: 12px;
}

/* Step Content */
.step-content {
    display: none;
}

.step-content.active {
    display: block;
}

/* Personal Details Form */
.form-section {
    padding: 20px 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    background: white;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

/* Checkbox */
.checkbox-group {
    margin-bottom: 20px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

/* Summary Section */
.summary-section {
    padding: 20px 24px;
    background: #f9f9f9;
    border-top: 1px solid #eee;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 16px;
}

.summary-row.total {
    font-weight: 600;
    padding-top: 8px;
    border-top: 1px solid #ddd;
    margin-top: 8px;
}

/* Fee Explanation */
.fee-explanation {
    margin-top: 16px;
    padding: 12px;
    background: #e8f4fd;
    border: 1px solid #e3f2fd;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.4;
}

.fee-explanation p {
    margin: 0;
    color: #1565c0;
}

.fee-explanation strong {
    color: #0d47a1;
}

/* Navigation Buttons */
.nav-buttons {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #eee;
}

.btn-secondary {
    flex: 1;
    padding: 12px 20px;
    background: white;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.btn-primary {
    flex: 2;
    padding: 12px 20px;
    background: linear-gradient(135deg, #1976d2, #1565c0);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 87, 34, 0.3);
}

/* Hide progress bar for FundRazr style */
.progress-bar {
    display: none;
}

/* Success Message */
.success-message {
    text-align: center;
    padding: 40px 24px;
}

.success-icon {
    width: 60px;
    height: 60px;
    background: #2196f3;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin: 0 auto 20px;
}

.success-message h2 {
    color: #2196f3;
    margin-bottom: 12px;
    font-size: 24px;
}

.success-message p {
    color: #666;
    font-size: 16px;
    line-height: 1.4;
}

/* Payment Section */
.payment-section {
    padding: 20px 24px;
    border-top: 1px solid #eee;
}

.payment-header h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.payment-request-wrapper {
    margin-bottom: 16px;
}

.or-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.or-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #ddd;
}

.or-divider span {
    background: white;
    padding: 0 16px;
    color: #666;
    font-size: 14px;
    position: relative;
}

.card-input-wrapper {
    margin-bottom: 20px;
}

.card-element {
    padding: 16px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    min-height: 48px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.card-element:hover {
    border-color: #e3f2fd;
}

.card-element.StripeElement--focus {
    border-color: #2196f3;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.card-element.StripeElement--invalid {
    border-color: #e74c3c;
}

.card-errors {
    color: #e74c3c;
    font-size: 14px;
    min-height: 20px;
    line-height: 1.4;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .donation-container {
        margin: 10px;
        border-radius: 8px;
    }
    
    .contribution-section,
    .form-section,
    .nav-buttons {
        padding: 16px 20px;
    }
    
    .amount-grid {
        gap: 6px;
    }

    .amount-btn {
        padding: 14px 8px;
        font-size: 16px;
    }

    .give-btn {
        font-size: 16px;
        padding: 14px;
    }

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

/* Payment Method Selector Styles */
.payment-method-section {
    padding: 20px 24px;
    border-top: 1px solid #e5e5e5;
}

.payment-method-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #333;
}

.payment-methods {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.payment-method-option {
    flex: 1 1 calc(50% - 6px);
    min-width: 200px;
}

.payment-method-option:first-child {
    flex: 1 1 100%;
}

@media (min-width: 768px) {
    .payment-method-option {
        flex: 1 1 calc(33.333% - 8px);
        min-width: 0;
    }

    .payment-method-option:first-child {
        flex: 1 1 calc(33.333% - 8px);
    }
}

.payment-method-option {
    position: relative;
}

.payment-method-option input[type="radio"] {
    position: absolute !important;
    opacity: 0 !important;
    cursor: pointer;
    pointer-events: none !important;
}

.payment-method-option label {
    display: flex;
    flex-direction: column;
    padding: 16px;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.payment-method-option input[type="radio"]:checked + label {
    border-color: #0d6efd;
    background-color: #f0f7ff;
}

.payment-method-option label:hover {
    border-color: #0d6efd;
}

.method-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.method-subtitle {
    font-size: 13px;
    color: #666;
}

/* Payment Interfaces */
.payment-interface {
    padding: 20px 24px;
}

#interface-credit-card {
    padding: 20px 0;
}

.payment-interface.hidden {
    display: none !important;
}

.hidden {
    display: none !important;
}

/* Crypto Payment Interface */
.crypto-instructions h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
}

.crypto-instructions p {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}

.wallet-address {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.wallet-address input {
    flex: 1;
    padding: 12px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    background-color: #f8f9fa;
}

.copy-btn {
    padding: 12px 20px;
    background-color: #0d6efd;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.copy-btn:hover {
    background-color: #0b5ed7;
}

.instruction-note {
    font-size: 13px;
    color: #856404;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
}

/* Wire Payment Interface */
.wire-instructions h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
}

.wire-instructions p {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}

#wire-email {
    color: #0d6efd;
    font-weight: 500;
}

/* Hide fee row for crypto and wire */
.hide-fee #processing-fee-row,
.hide-fee #fee-explanation {
    display: none;
}