/* Import Font dan Definisikan Variabel Warna */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

:root {
    --primary-color: #2980b9; /* Biru yang lebih modern */
    --secondary-color: #e74c3c; /* Merah untuk tombol aksi */
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --text-color: #34495e;
    --card-bg: #ffffff;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* --- General Styling --- */
body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    background-color: #f8f9fa; /* Latar belakang lebih lembut */
    color: var(--text-color);
}

/* Style untuk image preview */
#image-preview {
    width: 100%;
    height: 250px;
    object-fit: cover; /* Gambar akan mengisi kotak tanpa distorsi */
    border: 1px solid #ddd;
    background-color: #eee;
}

/* Memberi sedikit efek hover pada card */
.card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border: none;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1) !important;
}

/* Membuat input-group-text lebih serasi */
.input-group-text {
    background-color: #e9ecef;
    border: 1px solid #ced4da;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* --- Header --- */
header {
    background-color: var(--card-bg);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    margin: 0;
}

.logo h1 a {
    text-decoration: none;
    color: var(--primary-color);
    font-size: 1.8rem;
    font-weight: 700;
}

nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    align-items: center;
}

nav ul li {
    margin-left: 2rem;
}

nav ul li a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: var(--primary-color);
}

.btn-donate {
    background-color: var(--secondary-color);
    color: #fff;
    padding: 0.6rem 1.5rem;
    text-decoration: none;
    border-radius: 50px; /* Tombol lebih bulat */
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn-donate:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
}

/* --- Main Content --- */
main {
    padding: 3rem 0;
}

.main-title {
    text-align: center;
    font-size: 2rem;
    color: var(--dark-color);
    margin-bottom: 3rem;
    position: relative;
}
/* Garis bawah judul */
.main-title::after {
    content: '';
    width: 80px;
    height: 4px;
    background: var(--primary-color);
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

.campaign-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

/* --- Kartu Donasi --- */
.campaign-card {
    background-color: var(--card-bg);
    border-radius: 15px; /* Sudut lebih tumpul */
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.campaign-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.card-image img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.campaign-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Membuat konten mengisi sisa ruang */
}

.campaign-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    height: 3.3em; /* 3 baris teks */
    overflow: hidden;
    line-height: 1.1em;
}

.fundraiser {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 1rem;
}

.verified {
    color: var(--primary-color);
    font-weight: bold;
}

.progress-bar {
    background-color: var(--light-color);
    border-radius: 50px;
    height: 10px;
    width: 100%;
    margin-bottom: 1rem;
}

.progress {
    background: linear-gradient(90deg, var(--primary-color), #8e44ad); /* Gradient pada progress bar */
    height: 100%;
    border-radius: 50px;
}

.campaign-stats {
    display: flex;
    justify-content: space-between;
    margin-top: auto; /* Mendorong stats ke bawah kartu */
}

.campaign-stats .label {
    font-size: 0.8rem;
    color: #7f8c8d;
    margin: 0 0 0.2rem 0;
}

.campaign-stats .amount,
.campaign-stats .days {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark-color);
}
.campaign-stats .days {
    text-align: right;
}

/* --- RESPONSIVE DESIGN --- */
/* Tablet */
@media (max-width: 992px) {
    .campaign-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    nav ul {
        display: none; /* Sembunyikan nav untuk simpel, bisa diganti hamburger menu dengan JS */
    }
}

/* Mobile */
@media (max-width: 768px) {
    .campaign-grid {
        grid-template-columns: 1fr;
    }
    .main-title {
        font-size: 2rem;
    }
    header .container {
        flex-direction: column;
        gap: 1rem;
    }
    .btn-donate {
        display: none; /* Sembunyikan tombol di header mobile */
    }
}

/* --- Tombol Donasi di Kartu --- */
.btn-action {
    display: block;
    width: 100%;
    margin-top: 1rem;
    padding: 0.8rem;
    background-color: var(--primary-color);
    color: #fff;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.btn-action:hover {
    background-color: #2c3e50;
}


/* --- Halaman Donasi (donate.php) --- */
.donate-page {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: flex-start;
}

.campaign-summary img {
    width: 100%;
    border-radius: 15px;
    margin-bottom: 1rem;
}

.campaign-summary h2 {
    font-size: 1rem;
    color: #7f8c8d;
    font-weight: 400;
}

.campaign-summary h3 {
    font-size: 1.8rem;
    margin-top: 0.5rem;
    color: var(--dark-color);
}

.donation-form-container {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.donation-form-container h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    color: var(--dark-color);
}
.donation-form-container h3:nth-of-type(2) { /* Target judul kedua */
    margin-top: 2rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box; /* Penting! */
}
.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(41, 128, 185, 0.2);
}

.btn-action.full-width {
    margin-top: 1.5rem;
}

/* --- Responsive untuk Halaman Donasi --- */
@media (max-width: 992px) {
    .donate-page {
        grid-template-columns: 1fr;
    }
}

/* --- Footer --- */
.site-footer {
    background-color: var(--dark-color);
    color: rgba(255, 255, 255, 0.7);
    padding: 3rem 0 0 0;
    font-size: 0.9rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid #4a627a;
}

.footer-widget h4 {
    color: #fff;
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 1rem;
    position: relative;
}

/* Garis bawah judul widget */
.footer-widget h4::after {
    content: '';
    width: 40px;
    height: 2px;
    background: var(--primary-color);
    position: absolute;
    bottom: -5px;
    left: 0;
}

.footer-widget p {
    line-height: 1.7;
}

.footer-widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-widget ul li a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    display: block;
    padding: 0.4rem 0;
    transition: color 0.3s ease, padding-left 0.3s ease;
}

.footer-widget ul li a:hover {
    color: #fff;
    padding-left: 5px;
}

.social-icons {
    display: flex;
    gap: 0.8rem;
}

.social-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 50%;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.2rem; /* Ukuran untuk ikon placeholder (f, t, i) */
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.social-icon:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding: 1.5rem 0;
}

.footer-bottom p {
    margin: 0;
}


/* --- Responsive untuk Footer --- */
@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
    .site-footer {
        text-align: center;
    }
    .footer-widget h4::after {
        left: 50%;
        transform: translateX(-50%);
    }
    .social-icons {
        justify-content: center;
    }
}

.card-action {
    display: flex;
    justify-content: center; /* Ini akan membuat item di dalamnya (tombol) menjadi rata tengah secara horizontal */
}

/* Opsi A: Mengurangi margin atas */
.section-title {
  margin-top: 20px; /* Coba ganti nilainya menjadi lebih kecil atau bahkan 0 */
}

/* Opsi B: Menggunakan margin negatif untuk "menarik" ke atas */
.section-title {
  margin-top: -40px; /* Sesuaikan nilai -20px sesuai kebutuhan */
}