/* =====================================
   BERBAGI KEBAIKAN - PREMIUM DONATION PAGE
   Version 2.0 - Enhanced & Optimized
   ===================================== */

/* =====================================
   RESET & BASE STYLES
   ===================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =====================================
   1. HERO SECTION
   ===================================== */
.hero-section {
    background: linear-gradient(135deg, #1a3d33 0%, #2C5F50 50%, #25D366 100%);
    padding: 120px 20px 80px;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(37, 211, 102, 0.15) 0%, transparent 50%);
    animation: heroGlow 8s ease-in-out infinite;
}

@keyframes heroGlow {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, 30px) scale(1.1); }
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.hero-section h1 {
    font-size: 64px;
    font-weight: 900;
    color: #FFFFFF;
    margin: 0 0 25px 0;
    letter-spacing: -0.03em;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 40px rgba(37, 211, 102, 0.4);
    animation: titleFloat 3s ease-in-out infinite;
}

@keyframes titleFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.hero-section p {
    font-size: 22px;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.7;
    font-weight: 300;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* =====================================
   2. DONATION SECTIONS
   ===================================== */
.donation-section {
    padding: 80px 20px;
    position: relative;
}

.individual-section {
    background: linear-gradient(180deg, #F8FFFE 0%, #FFFFFF 100%);
}

.project-section {
    background: linear-gradient(180deg, #FFFFFF 0%, #F0F7F4 100%);
}

.section-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 60px;
}

.section-header h2 {
    font-size: 48px;
    font-weight: 800;
    color: #1a3d33;
    margin: 0 0 20px 0;
    letter-spacing: -0.02em;
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 5px;
    background: linear-gradient(90deg, transparent 0%, #25D366 50%, transparent 100%);
    border-radius: 3px;
}

.section-header p {
    font-size: 19px;
    color: #5a7a6f;
    line-height: 1.7;
    margin: 0;
}

.text-center {
    text-align: center;
    padding: 50px 20px;
    color: #6c757d;
    font-size: 18px;
}

/* =====================================
   3. DONATION GRID
   ===================================== */
.donation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 35px;
    max-width: 1400px;
    margin: 0 auto;
}

/* =====================================
   4. DONATION CARDS - ENHANCED
   ===================================== */
.donation-card {
    background: #FFFFFF;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
}

.donation-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.05) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
    z-index: 1;
}

@media (hover: hover) {
    .donation-card:hover {
        transform: translateY(-12px) scale(1.02);
        box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15), 0 5px 20px rgba(37, 211, 102, 0.2), inset 0 0 0 2px rgba(37, 211, 102, 0.3);
    }
    
    .donation-card:hover::before {
        opacity: 1;
    }
}

/* =====================================
   5. IMAGE CONTAINER - CLEAN & CLEAR
   ===================================== */
.card-image {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    background: linear-gradient(135deg, #e0f2e9 0%, #c8e6d7 100%);
    display: block;
    flex-shrink: 0;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    filter: brightness(0.98);
    display: block;
}

/* Fallback for other image structures */
.donation-card > img:first-child,
.donation-card > a:first-child,
.donation-card > div:first-child:not(.card-image),
[class*="image"]:not(.card-image),
[class*="photo"],
[class*="picture"],
.donation-card figure {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    background: linear-gradient(135deg, #e0f2e9 0%, #c8e6d7 100%);
    display: block;
    flex-shrink: 0;
}

.donation-card > img:first-child,
.donation-card > a:first-child img,
.donation-card > div:first-child:not(.card-image) img,
[class*="image"]:not(.card-image) img,
[class*="photo"] img,
[class*="picture"] img,
.donation-card figure img,
.donation-card img:not(.icon):not([class*="badge"]):not(.card-image img) {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    filter: brightness(0.98);
    display: block;
}

@media (hover: hover) {
    .donation-card:hover .card-image img {
        transform: scale(1.05);
        filter: brightness(1);
    }
    
    .donation-card:hover > img:first-child,
    .donation-card:hover > a:first-child img,
    .donation-card:hover > div:first-child:not(.card-image) img,
    .donation-card:hover [class*="image"]:not(.card-image) img,
    .donation-card:hover figure img,
    .donation-card:hover img:not(.icon):not([class*="badge"]):not(.card-image img) {
        transform: scale(1.05);
        filter: brightness(1);
    }
}

/* =====================================
   6. URGENCY BADGES
   ===================================== */
.urgency-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    animation: pulse 2s ease-in-out infinite;
    z-index: 2;
}

.urgency-mendesak, .urgency-MENDESAK {
    background: linear-gradient(135deg, #FF6B6B 0%, #E63946 100%);
    color: #FFFFFF;
}

.urgency-kritis, .urgency-KRITIS {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: #FFFFFF;
}

.urgency-normal, .urgency-NORMAL {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: #FFFFFF;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* =====================================
   7. CARD CONTENT
   ===================================== */
.card-content {
    padding: 35px 30px;
    position: relative;
    z-index: 2;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.child-name, .project-name {
    font-size: 26px;
    font-weight: 800;
    color: #1a3d33;
    margin: 0 0 15px 0;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.child-story, .project-description {
    font-size: 16px;
    color: #5a7a6f;
    line-height: 1.8;
    margin: 0 0 20px 0;
    min-height: 90px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.child-need {
    background: linear-gradient(135deg, #F0F7F4 0%, #E8F5EF 100%);
    padding: 18px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    border-left: 4px solid #25D366;
}

.child-need strong {
    display: block;
    font-size: 14px;
    color: #2C5F50;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.child-need p {
    font-size: 15px;
    color: #1a3d33;
    margin: 0;
    line-height: 1.6;
    font-weight: 600;
}

/* =====================================
   8. PROGRESS BAR
   ===================================== */
.donation-progress {
    margin-bottom: 30px;
    margin-top: auto;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    flex-wrap: wrap;
    gap: 8px;
}

.collected {
    color: #25D366;
    font-weight: 700;
}

.target {
    color: #5a7a6f;
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: linear-gradient(90deg, #E8F5EF 0%, #F0F7F4 100%);
    border-radius: 50px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #25D366 0%, #20BA5A 100%);
    border-radius: 50px;
    position: relative;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 15px rgba(37, 211, 102, 0.5);
}

.progress-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.status-info {
    color: #17a2b8;
    font-weight: 700;
    font-size: 14px;
}

.status-success {
    color: #28a745;
    font-weight: 700;
    font-size: 14px;
}

.status-danger {
    color: #dc3545;
    font-weight: 700;
    font-size: 14px;
}

/* =====================================
   9. BUTTONS
   ===================================== */
.btn-donate {
    display: block;
    width: 100%;
    padding: 18px 30px;
    background: linear-gradient(135deg, #25D366 0%, #20BA5A 100%);
    color: #FFFFFF;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.35), 0 0 30px rgba(37, 211, 102, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-donate::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

@media (hover: hover) {
    .btn-donate:hover {
        transform: translateY(-3px) scale(1.02);
        box-shadow: 0 15px 40px rgba(37, 211, 102, 0.45), 0 0 50px rgba(37, 211, 102, 0.4);
    }
    
    .btn-donate:hover::before {
        width: 300px;
        height: 300px;
    }
}

.btn-donate:active {
    transform: translateY(-1px) scale(1);
}

.card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn-primary {
    grid-column: 1 / -1;
}

.btn-admin {
    background: linear-gradient(135deg, #2C5F50 0%, #1a3d33 100%);
    font-size: 14px;
    padding: 16px 20px;
    box-shadow: 0 6px 20px rgba(44, 95, 80, 0.3), 0 0 20px rgba(44, 95, 80, 0.15);
}

@media (hover: hover) {
    .btn-admin:hover {
        box-shadow: 0 12px 30px rgba(44, 95, 80, 0.4), 0 0 35px rgba(44, 95, 80, 0.3);
    }
}

/* =====================================
   10. INFO SECTION
   ===================================== */
.info-section {
    padding: 80px 20px;
    background: linear-gradient(135deg, #1a3d33 0%, #2C5F50 100%);
    position: relative;
    overflow: hidden;
}

.info-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.info-section h2 {
    text-align: center;
    font-size: 42px;
    font-weight: 800;
    color: #FFFFFF;
    margin: 0 0 60px 0;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.info-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.step {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 35px 25px;
    border-radius: 20px;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.15);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

@media (hover: hover) {
    .step:hover {
        transform: translateY(-8px);
        border-color: rgba(37, 211, 102, 0.5);
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    }
}

.step-number {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #25D366 0%, #20BA5A 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 900;
    color: #FFFFFF;
    margin: 0 auto 20px;
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4), 0 0 30px rgba(37, 211, 102, 0.3);
}

.step h3 {
    font-size: 22px;
    font-weight: 700;
    color: #FFFFFF;
    margin: 0 0 12px 0;
}

.step p {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.7;
    margin: 0;
}

.contact-admin {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(15px);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    border: 2px solid rgba(37, 211, 102, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.contact-admin p {
    font-size: 20px;
    font-weight: 700;
    color: #FFFFFF;
    margin: 0 0 25px 0;
}

.btn-wa-admin {
    display: inline-block;
    padding: 18px 45px;
    background: linear-gradient(135deg, #25D366 0%, #20BA5A 100%);
    color: #FFFFFF;
    border-radius: 50px;
    font-size: 17px;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.4s ease;
    box-shadow: 0 10px 30px rgba(37, 211, 102, 0.4), 0 0 40px rgba(37, 211, 102, 0.3);
}

@media (hover: hover) {
    .btn-wa-admin:hover {
        transform: translateY(-5px) scale(1.05);
        box-shadow: 0 15px 45px rgba(37, 211, 102, 0.5), 0 0 60px rgba(37, 211, 102, 0.5);
    }
}

/* =====================================
   11. TRANSPARENCY SECTION
   ===================================== */
.transparency-section {
    padding: 80px 20px;
    background: #FFFFFF;
}

.transparency-container {
    max-width: 1200px;
    margin: 0 auto;
}

.transparency-section h2 {
    text-align: center;
    font-size: 42px;
    font-weight: 800;
    color: #1a3d33;
    margin: 0 0 60px 0;
}

.transparency-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 30px;
}

.transparency-item {
    background: linear-gradient(135deg, #F0F7F4 0%, #E8F5EF 100%);
    padding: 40px 30px;
    border-radius: 20px;
    text-align: center;
    border: 2px solid #E0F2E9;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

@media (hover: hover) {
    .transparency-item:hover {
        transform: translateY(-8px);
        border-color: #25D366;
        box-shadow: 0 15px 40px rgba(37, 211, 102, 0.2);
    }
}

.transparency-item .icon {
    font-size: 56px;
    display: block;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 10px rgba(37, 211, 102, 0.3));
}

.transparency-item h3 {
    font-size: 22px;
    font-weight: 700;
    color: #1a3d33;
    margin: 0 0 12px 0;
}

.transparency-item p {
    font-size: 15px;
    color: #5a7a6f;
    line-height: 1.7;
    margin: 0;
}

/* =====================================
   12. RESPONSIVE DESIGN
   ===================================== */
@media (max-width: 1024px) {
    .donation-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 25px;
    }
    
    .hero-section h1 {
        font-size: 52px;
    }
    
    .section-header h2 {
        font-size: 42px;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 80px 20px 60px;
    }
    
    .hero-section h1 {
        font-size: 42px;
    }
    
    .hero-section p {
        font-size: 18px;
    }
    
    .donation-section {
        padding: 60px 15px;
    }
    
    .section-header h2 {
        font-size: 36px;
    }
    
    .section-header p {
        font-size: 17px;
    }
    
    .donation-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .card-image {
        height: 350px;
    }
    
    .donation-card > img:first-child,
    .donation-card > a:first-child,
    .donation-card > div:first-child:not(.card-image),
    [class*="image"]:not(.card-image),
    .donation-card figure {
        height: 350px;
    }
    
    .card-content {
        padding: 25px 20px;
    }
    
    .child-name, .project-name {
        font-size: 22px;
    }
    
    .child-story, .project-description {
        font-size: 15px;
        min-height: 80px;
    }
    
    .card-actions {
        grid-template-columns: 1fr;
    }
    
    .btn-admin {
        grid-column: 1 / -1;
    }
    
    .info-section h2,
    .transparency-section h2 {
        font-size: 32px;
        margin-bottom: 40px;
    }
    
    .info-steps,
    .transparency-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .contact-admin {
        padding: 30px 20px;
    }
    
    .urgency-badge {
        top: 15px;
        right: 15px;
        padding: 6px 16px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .hero-section h1 {
        font-size: 32px;
    }
    
    .hero-section p {
        font-size: 16px;
    }
    
    .section-header h2 {
        font-size: 28px;
    }
    
    .donation-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .card-image,
    .donation-card > img:first-child,
    .donation-card > a:first-child,
    .donation-card > div:first-child,
    [class*="image"],
    .donation-card figure {
        height: 250px;
    }
    
    .btn-donate {
        padding: 16px 24px;
        font-size: 15px;
    }
}

/* =====================================
   13. ANIMATIONS & LOADING STATES
   ===================================== */
@keyframes fadeIn {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.donation-card {
    animation: fadeIn 0.6s ease-out both;
}

.donation-card:nth-child(1) { animation-delay: 0.1s; }
.donation-card:nth-child(2) { animation-delay: 0.2s; }
.donation-card:nth-child(3) { animation-delay: 0.3s; }
.donation-card:nth-child(4) { animation-delay: 0.4s; }
.donation-card:nth-child(5) { animation-delay: 0.5s; }
.donation-card:nth-child(6) { animation-delay: 0.6s; }
.donation-card:nth-child(7) { animation-delay: 0.7s; }
.donation-card:nth-child(8) { animation-delay: 0.8s; }
.donation-card:nth-child(9) { animation-delay: 0.9s; }

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(37, 211, 102, 0.3);
    border-top-color: #25D366;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* =====================================
   14. UTILITY CLASSES
   ===================================== */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

/* =====================================
   15. PRINT STYLES
   ===================================== */
@media print {
    .hero-section,
    .info-section,
    .btn-donate,
    .btn-admin,
    .urgency-badge {
        display: none;
    }
    
    .donation-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}