* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary-color: #107950;
    --primary-dark: #076444;
    --success-color: #10b981;
    --error-color: #ef4444;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f3f4f6;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.mobile-container {
    max-width: 480px;
    margin: 0 auto;
    background-color: var(--bg-primary);
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* Header */
.header {
    background: var(--primary-color);
    color: white;
    padding: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: white;
    padding: 4px;
}

.org-name {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Hero Section */
.hero-section {
    position: relative;
    overflow: hidden;
}

.hero-image {
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: 24px 16px;
}

.hero-overlay h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.hero-overlay p {
    font-size: 14px;
    opacity: 0.9;
}

/* Donation Section */
.donation-section {
    padding: 20px 16px;
}

.amount-selection h3,
.form-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.amount-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.amount-option {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 8px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.amount-option:active {
    transform: scale(0.98);
}

.amount-option.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.amount-option .currency {
    font-size: 18px;
    opacity: 0.8;
    color: var(--primary-color);
    margin-top: 10px;
}

.custom-amount-btn {
    font-size: 16px;
}

/* Custom Amount Section */
.custom-amount-section {
    margin-bottom: 24px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix {
    position: absolute;
    left: 16px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-secondary);
}

.input-group input, select {
    width: 100%;
    padding: 16px 16px 16px 40px;
    font-size: 18px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s ease;
}

/* Form Fields */
.form-field {
    margin-bottom: 16px;
}

.form-field input,
.form-field textarea,select {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s ease;
    font-family: inherit;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus,
.input-group input:focus {
    border-color: var(--primary-color);
}

.form-field input::placeholder,
.form-field select::placeholder,
.form-field textarea::placeholder {
    color: var(--text-secondary);
}

/* Submit Button */
.donate-btn {
    width: 100%;
    padding: 18px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    margin-top: 24px;
}

.donate-btn:active {
    transform: scale(0.98);
    background: var(--primary-dark);
}

.donate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-icon {
    width: 20px;
    height: 20px;
}

/* Info Cards */
.info-section {
    padding: 0 16px 24px;
}

.info-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 12px;
    text-align: center;
}

.info-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.info-card h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.info-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    padding: 24px 16px;
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.footer-links {
    margin-top: 8px;
}

.footer-links a {
    color: var(--primary-color);
    text-decoration: none;
    margin: 0 4px;
}

/* Success Page Styles */
.success-container {
    padding: 24px 16px;
    text-align: center;
}

.success-animation {
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
    position: relative;
}

.success-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--success-color);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes checkmark {
    from {
        transform: scale(0) rotate(-45deg);
    }
    to {
        transform: scale(1) rotate(0);
    }
}

.success-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.success-message {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.transaction-details {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    text-align: left;
}

.transaction-details h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.detail-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.share-section {
    margin-bottom: 24px;
}

.share-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.share-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.whatsapp-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #25D366;
    color: white;
    padding: 14px 24px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.whatsapp-btn:active {
    transform: scale(0.98);
    background: #128C7E;
}

.whatsapp-icon {
    width: 24px;
    height: 24px;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-btn {
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.action-btn-primary {
    background: var(--primary-color);
    color: white;
}

.action-btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.action-btn:active {
    transform: scale(0.98);
}

/* Error Page Styles */
.error-animation {
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
    position: relative;
}

.error-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--error-color);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.5s ease;
}

.error-x {
    color: white;
    font-size: 60px;
}

/* Loading States */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive adjustments for very small screens */
@media (max-width: 360px) {
    .amount-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header-content {
        font-size: 18px;
    }
    
    .donate-btn {
        font-size: 16px;
        padding: 16px;
    }
}

/* Landscape mode adjustments */
@media (orientation: landscape) and (max-height: 500px) {
    .hero-image {
        height: 150px;
    }
    
    .amount-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 8px;
    }
}

/* iOS specific fixes */
@supports (-webkit-touch-callout: none) {
    input, textarea, select {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
}

/* Safe area insets for modern phones */
@supports (padding: max(0px)) {
    .mobile-container {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .header {
        padding-top: max(16px, env(safe-area-inset-top));
    }
}

/* Additional Mobile Optimizations */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Prevent text selection on buttons */
button, .amount-option, .action-btn, .whatsapp-btn {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Better touch targets */
button, a, input, textarea, select {
    min-height: 44px; /* Apple's recommended touch target size */
}

/* Improve form usability on mobile */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* Pull-to-refresh indicator */
.mobile-container {
    overscroll-behavior-y: contain;
}

/* Offline indicator */
.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--error-color);
    color: white;
    padding: 8px;
    text-align: center;
    font-size: 14px;
    z-index: 1000;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.offline-banner.show {
    transform: translateY(0);
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

.amount-grid button {
    background-image: url(/images/couponBg-By-2WD0g.png);
    background-position: center bottom;
    background-size: cover;
    background-repeat: no-repeat;
    box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.1);
}

.form-field input{
    box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.1);
}

.amount-grid button.active {
    transition: outline .3s ease-out;
    outline: 3px solid #29a300;
}
.amount-grid button.active .currency {
    color: white;
}

.coupon{
    border-bottom: dashed 2px #000;
    padding-bottom: 4px;
}

.amount-grid button.active .coupon {
    border-bottom: dashed 2px #fff;
}