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

:root {
    --primary: #16a34a;
    --primary-light: #22c55e;
    --primary-dark: #15803d;
    --blue: #1e3a5f;
    --blue-light: #2563eb;
    --bg-body: #f0fdf4;
    --bg-white: #ffffff;
    --bg-light: #f8fdf9;
    --text-dark: #1a1a2e;
    --text-muted: #6c757d;
    --border: #e8f5e9;
    --shadow: 0 2px 16px rgba(22, 163, 74, 0.08);
    --shadow-lg: 0 8px 32px rgba(22, 163, 74, 0.12);
}

[data-theme="dark"] {
    --bg-body: #0c0a1a;
    --bg-white: #1a1535;
    --bg-light: #231e42;
    --text-dark: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #2d2660;
    --shadow: 0 2px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
}

body {
    font-family: 'Cairo', sans-serif;
    background: var(--bg-body);
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(0, 178, 137, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(0, 178, 137, 0.04) 0%, transparent 50%);
    min-height: 100vh;
    color: var(--text-dark);
    overflow-x: hidden;
}

[data-theme="dark"] body {
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(30, 58, 95, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(22, 163, 74, 0.08) 0%, transparent 50%);
}

.donation-page {
    max-width: 100%;
    min-height: 100vh;
    padding-bottom: 60px;
}

.ad-section {
    padding: 20px 20px 8px;
    display: flex;
    justify-content: center;
}

.ad-container {
    width: 720px;
    max-width: 100%;
    height: 250px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    background: var(--bg-white);
}

.ad-banner {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ad-placeholder {
    width: 100%;
    height: 100%;
    background: var(--bg-light);
    border: 2px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-content {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 14px;
}

.ad-content i {
    font-size: 22px;
    opacity: 0.35;
}

.campaign-section {
    padding: 28px 20px 8px;
    text-align: center;
}

.campaign-container {
    max-width: 800px;
    margin: 0 auto;
}

.title-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    margin-bottom: 14px;
    box-shadow: 0 6px 24px rgba(22, 163, 74, 0.3);
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.campaign-title {
    font-size: clamp(24px, 5vw, 40px);
    font-weight: 900;
    color: var(--text-dark);
    line-height: 1.3;
    margin-bottom: 6px;
}

.campaign-subtitle {
    font-size: 15px;
    color: var(--text-muted);
    font-weight: 400;
}

.progress-section {
    padding: 24px 20px;
}

.progress-container {
    max-width: 800px;
    margin: 0 auto;
}

.progress-card {
    background: var(--bg-white);
    border-radius: 20px;
    padding: 32px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.amounts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 28px;
}

.amount-box {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--bg-light);
    transition: all 0.3s ease;
}

.amount-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.amount-box.collected {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-color: #bbf7d0;
}

.amount-box.target {
    background: linear-gradient(135deg, #f0fdf9, #d1fae5);
    border-color: #a7f3d0;
}

[data-theme="dark"] .amount-box.collected {
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.15), rgba(22, 163, 74, 0.05));
    border-color: rgba(22, 163, 74, 0.3);
}

[data-theme="dark"] .amount-box.target {
    background: linear-gradient(135deg, rgba(21, 128, 61, 0.15), rgba(21, 128, 61, 0.05));
    border-color: rgba(21, 128, 61, 0.3);
}

.amount-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    flex-shrink: 0;
}

.collected .amount-icon {
    background: linear-gradient(135deg, #16a34a, #22c55e);
}

.target .amount-icon {
    background: linear-gradient(135deg, #15803d, #16a34a);
}

.amount-data {
    display: flex;
    flex-direction: column;
}

.amount-label {
    font-size: 12px;
    color: var(--text-dark);
    margin-bottom: 3px;
    font-weight: 600;
}

.amount-value {
    font-size: 20px;
    font-weight: 800;
    direction: ltr;
    text-align: right;
    line-height: 1.2;
    color: var(--text-dark);
}

.collected .amount-value {
    color: var(--text-dark);
}

.amount-currency {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 1px;
}

.progress-wrapper {
    margin-bottom: 24px;
}

.progress-track {
    position: relative;
    height: 32px;
    background: #e8f5e9;
    border-radius: 16px;
    overflow: visible;
    border: 1px solid #c8e6c9;
}

[data-theme="dark"] .progress-track {
    background: var(--bg-light);
    border-color: var(--border);
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    min-width: 0;
    background: linear-gradient(90deg, #15803d 0%, #16a34a 40%, #22c55e 70%, #4ade80 100%);
    border-radius: 16px;
    transition: width 1.8s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
}

.progress-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: glowSlide 2.5s ease-in-out infinite;
}

@keyframes glowSlide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-shimmer {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(90deg, transparent, transparent 12px, rgba(255, 255, 255, 0.15) 12px, rgba(255, 255, 255, 0.15) 24px);
    animation: shimmerScroll 1.2s linear infinite;
}

@keyframes shimmerScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(24px); }
}

.progress-milestones {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.milestone {
    position: absolute;
    top: 50%;
    transform: translateX(-50%);
}

.milestone[data-value="25"] { left: 25%; }
.milestone[data-value="50"] { left: 50%; }
.milestone[data-value="75"] { left: 75%; }
.milestone[data-value="100"] { left: 100%; transform: translateX(-100%); }

.milestone-dot {
    width: 14px;
    height: 14px;
    background: rgba(22, 163, 74, 0.3);
    border-radius: 50%;
    margin: 0 auto 6px;
    border: 2px solid #a7f3d0;
    transition: all 0.4s ease;
}

.milestone.reached .milestone-dot {
    background: var(--primary-light);
    border-color: var(--primary);
    box-shadow: 0 0 12px rgba(22, 163, 74, 0.5);
    transform: scale(1.3);
}

.milestone span {
    font-size: 13px;
    color: var(--primary-dark);
    display: block;
    text-align: center;
    font-weight: 700;
}

.percentage-badge {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 2px;
    margin-top: 14px;
}

.percentage-number {
    font-size: 50px;
    font-weight: 900;
    color: var(--primary);
    direction: ltr;
    line-height: 1;
}

.percentage-symbol {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-light);
}

.stats-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.stat-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
}

.stat-icon.remaining {
    background: linear-gradient(135deg, #15803d, #16a34a);
}

.stat-data {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 16px;
    font-weight: 800;
    direction: ltr;
    text-align: right;
    line-height: 1.2;
    color: var(--text-dark);
}

.stat-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dark);
}

.stat-divider {
    width: 1px;
    height: 34px;
    background: var(--border);
}

.success-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s ease;
    backdrop-filter: blur(6px);
}

.success-overlay.active {
    opacity: 1;
    visibility: visible;
}

.success-content {
    text-align: center;
    transform: scale(0.85);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.success-overlay.active .success-content {
    transform: scale(1);
}

.success-icon {
    width: 88px;
    height: 88px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 40px;
    color: white;
    animation: successPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 32px rgba(22, 163, 74, 0.35);
}

@keyframes successPop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

.success-content h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-dark);
}

.success-content p {
    color: var(--text-muted);
    font-size: 14px;
}

.amount-float {
    position: fixed;
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    pointer-events: none;
    animation: floatAway 2s ease-out forwards;
    z-index: 1001;
    left: 50%;
    top: 55%;
}

@keyframes floatAway {
    0% { opacity: 1; transform: translate(-50%, 0) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -80px) scale(1.4); }
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
    animation: particleBurst 0.8s ease-out forwards;
}

@keyframes particleBurst {
    0% { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0); }
}

.confetti-piece {
    position: fixed;
    top: -12px;
    z-index: 1002;
    animation: confettiDrop 3s linear forwards;
}

@keyframes confettiDrop {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

@media (max-width: 640px) {
    .progress-card {
        padding: 22px 16px;
    }

    .amounts-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

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

    .percentage-number {
        font-size: 38px;
    }

    .stats-row {
        gap: 14px;
    }

    .stat-divider {
        display: none;
    }

    .stat-box {
        min-width: 90px;
        justify-content: center;
    }
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}
