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

:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-section: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Poppins', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-main);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
    background-image:
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.08) 0%, transparent 50%);
}

.container {
    max-width: 580px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    padding: 45px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
}

.profile-image {
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.avatar {
    width: 110px;
    height: 110px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    margin: 0 auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    color: var(--primary);
}

.hero h1 {
    font-size: 1.9rem;
    margin-bottom: 8px;
    font-weight: 700;
    color: #ffffff;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tagline {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    position: relative;
    z-index: 1;
    font-weight: 400;
}

/* Story Section */
.story {
    padding: 30px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.story h2 {
    color: var(--text-primary);
    margin-bottom: 16px;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.story h2::before {
    content: '';
    width: 4px;
    height: 22px;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

.story p {
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

/* Progress Section */
.progress-section {
    padding: 28px 30px;
    background: var(--bg-section);
    border-bottom: 1px solid var(--border-color);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}

.raised {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary);
}

.goal {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.progress-bar {
    height: 12px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 10px;
    transition: width 0.6s ease;
    position: relative;
}

.donors-count {
    text-align: center;
    color: var(--text-muted);
    margin-top: 12px;
    font-size: 0.85rem;
}

/* Donation Section */
.donation-section {
    padding: 30px;
}

.donation-section h2 {
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 25px;
    font-size: 1.3rem;
    font-weight: 600;
}

/* Amount Presets */
.amount-presets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.amount-btn {
    padding: 16px 12px;
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.amount-btn:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.amount-btn.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #ffffff;
}

.amount-btn span {
    display: block;
}

/* Custom Amount */
.custom-amount-wrapper {
    margin-bottom: 20px;
}

.custom-amount-wrapper label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

.custom-amount-wrapper input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1.1rem;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.custom-amount-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.custom-amount-wrapper input::placeholder {
    color: var(--text-muted);
}

/* Donor Info */
.donor-info {
    margin-bottom: 25px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

/* Payment Methods */
.payment-methods {
    text-align: center;
}

.payment-methods h3 {
    color: var(--text-secondary);
    margin-bottom: 18px;
    font-size: 0.95rem;
    font-weight: 500;
}

.payment-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pay-btn {
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.pay-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.stripe-btn {
    background: linear-gradient(135deg, #635bff 0%, #7c3aed 100%);
    color: white;
    flex-wrap: wrap;
}

.stripe-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 91, 255, 0.35);
}

.stripe-btn .payment-note {
    width: 100%;
    font-size: 0.75rem;
    opacity: 0.85;
    font-weight: 400;
    margin-top: 2px;
}

.card-icon {
    width: 22px;
    height: 22px;
}

#paypal-button-container {
    min-height: 50px;
}

/* Recent Donations */
.recent-donations {
    padding: 28px 30px;
    background: var(--bg-section);
}

.recent-donations h2 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.recent-donations h2::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

.donations-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.donation-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: 14px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.donation-item:hover {
    box-shadow: var(--shadow-md);
}

.donor-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    flex-shrink: 0;
    font-size: 1rem;
}

.donation-details {
    flex: 1;
    min-width: 0;
}

.donor-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.donation-amount {
    color: var(--primary);
    font-weight: 700;
    margin-left: 8px;
}

.donation-message {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 4px;
    font-style: italic;
}

/* Footer */
footer {
    padding: 25px 30px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
}

footer p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.secure-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
    color: var(--success);
    font-weight: 500;
}

.lock-icon {
    width: 15px;
    height: 15px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 1000;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-overlay p {
    color: var(--text-primary);
    margin-top: 20px;
    font-size: 1rem;
    font-weight: 500;
}

/* Success Page */
.success-page,
.cancel-page {
    padding: 50px 30px;
    text-align: center;
}

.success-icon svg {
    width: 90px;
    height: 90px;
    color: var(--success);
}

.cancel-icon svg {
    width: 90px;
    height: 90px;
    color: var(--danger);
}

.success-page h1,
.cancel-page h1 {
    color: var(--text-primary);
    margin: 20px 0 12px;
    font-size: 1.8rem;
}

.success-message {
    color: var(--success);
    font-size: 1.05rem;
    margin-bottom: 30px;
    font-weight: 500;
}

.cancel-message {
    color: var(--danger);
    font-size: 1.05rem;
    margin-bottom: 30px;
    font-weight: 500;
}

.donation-receipt {
    background: var(--bg-section);
    padding: 25px;
    border-radius: 16px;
    margin-bottom: 30px;
    text-align: left;
    border: 1px solid var(--border-color);
}

.donation-receipt h3 {
    color: var(--text-primary);
    margin-bottom: 18px;
    text-align: center;
    font-size: 1.05rem;
}

.receipt-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.receipt-item:last-child {
    border-bottom: none;
}

.receipt-item span:first-child {
    color: var(--text-secondary);
}

.receipt-item span:last-child {
    color: var(--text-primary);
    font-weight: 600;
}

.thank-you-message {
    margin: 30px 0;
    padding: 24px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(236, 72, 153, 0.08) 100%);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.thank-you-message p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 8px;
}

.share-section {
    margin: 30px 0;
}

.share-section h3 {
    color: var(--text-primary);
    margin-bottom: 16px;
    font-size: 1rem;
}

.share-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.share-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-btn:hover {
    transform: translateY(-2px);
}

.share-btn.twitter {
    background: #1da1f2;
    color: white;
}

.share-btn.facebook {
    background: #4267b2;
    color: white;
}

.share-btn.copy {
    background: var(--bg-section);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.back-btn,
.try-again-btn {
    display: inline-block;
    padding: 14px 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.back-btn:hover,
.try-again-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.action-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 30px 0;
}

.cancel-info,
.encouragement {
    color: var(--text-secondary);
    margin: 20px 0;
}

.cancel-info p,
.encouragement p {
    margin-bottom: 8px;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 480px) {
    body {
        padding: 12px;
    }

    .hero {
        padding: 35px 20px;
    }

    .hero h1 {
        font-size: 1.6rem;
    }

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

    .story,
    .progress-section,
    .donation-section,
    .recent-donations {
        padding: 22px 20px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .share-buttons {
        flex-direction: column;
    }

    .share-btn {
        width: 100%;
    }
}
