/* ============================================
   DANA KITA - STYLE
   Warna utama: Emerald / Hijau
   ============================================ */

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #1a1a2e;
    background: #f8fafb;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ============================================
   HEADER
   ============================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #e5e7eb;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: #059669;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-text {
    font-weight: 700;
    font-size: 1.2rem;
    color: #059669;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #333;
}

/* User Menu */
.user-menu { position: relative; }

.user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s;
}
.user-btn:hover { background: #f3f4f6; }

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #d1fae5;
    color: #059669;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 8px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
    min-width: 220px;
    overflow: hidden;
    z-index: 200;
}
.user-dropdown.show { display: block; }

.dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.dropdown-header small { color: #9ca3af; font-size: 0.75rem; }

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: #6b7280;
    font-size: 0.875rem;
    transition: background 0.15s;
}
.dropdown-item:hover { background: #f9fafb; color: #dc2626; }

/* Mobile Menu */
.mobile-menu {
    display: none;
    padding: 12px 20px 16px;
    border-top: 1px solid #e5e7eb;
    background: white;
}
.mobile-menu.show { display: block; }

.mobile-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0 12px;
    border-bottom: 1px solid #f3f4f6;
    margin-bottom: 8px;
}
.mobile-user strong { display: block; font-size: 0.9rem; }
.mobile-user small { color: #9ca3af; font-size: 0.75rem; }
.mobile-user .user-avatar { width: 32px; height: 32px; }

.mobile-link {
    display: block;
    padding: 10px 0;
    color: #374151;
    font-size: 0.9rem;
    border-bottom: 1px solid #f9fafb;
}
.mobile-link:hover { color: #059669; }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-primary {
    background: #059669;
    color: white;
}
.btn-primary:hover { background: #047857; }
.btn-outline {
    background: transparent;
    color: #374151;
    border: 1px solid #d1d5db;
}
.btn-outline:hover { background: #f9fafb; }
.btn-outline-light {
    background: transparent;
    color: white;
    border: 1px solid rgba(255,255,255,0.4);
}
.btn-outline-light:hover { background: rgba(255,255,255,0.1); }
.btn-white {
    background: white;
    color: #059669;
}
.btn-white:hover { background: #f0fdf4; }
.btn-sm { padding: 7px 14px; font-size: 0.85rem; border-radius: 8px; }
.btn-full { width: 100%; }

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
    position: relative;
    background: linear-gradient(135deg, #059669, #10b981, #14b8a6);
    color: white;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 15% 20%, rgba(255,255,255,0.12) 0%, transparent 50%),
                radial-gradient(circle at 85% 80%, rgba(255,255,255,0.1) 0%, transparent 50%);
}

.hero-content {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    padding: 60px 20px 50px;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 20px;
}

.hero-content h1 {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-content > p {
    font-size: 1.05rem;
    color: rgba(255,255,255,0.85);
    max-width: 540px;
    margin: 0 auto 28px;
}

.hero-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
}

.stat-item { text-align: center; }
.stat-number { font-size: 1.8rem; font-weight: 800; }
.stat-label { font-size: 0.85rem; color: rgba(255,255,255,0.7); }

/* ============================================
   CAMPAIGNS SECTION
   ============================================ */
.campaigns-section {
    padding: 40px 0 60px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-header h2 { font-size: 1.5rem; font-weight: 700; }
.section-header p { color: #6b7280; font-size: 0.9rem; margin-top: 2px; }

.search-form input {
    width: 280px;
    padding: 9px 14px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s;
    background: white;
}
.search-form input:focus { border-color: #059669; }

/* Category Tabs */
.category-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 4px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.category-tabs::-webkit-scrollbar { display: none; }

.tab {
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid #e5e7eb;
    background: white;
    color: #374151;
    transition: all 0.2s;
}
.tab:hover { border-color: #a7f3d0; color: #059669; background: #f0fdf4; }
.tab.active {
    background: #059669;
    color: white;
    border-color: #059669;
}

/* Campaign Grid */
.campaign-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.campaign-card {
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}
.campaign-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}

.card-image {
    height: 160px;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 12px;
}

.card-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
}
.badge-red { background: #fee2e2; color: #b91c1c; }
.badge-green { background: #d1fae5; color: #047857; }
.badge-amber { background: #fef3c7; color: #b45309; }
.badge-slate { background: #f1f5f9; color: #475569; }
.badge-purple { background: #f3e8ff; color: #7c3aed; }
.badge-white { background: rgba(255,255,255,0.9); color: #1f2937; }

.card-urgent {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 600;
    background: #dc2626;
    color: white;
}

.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.card-body h3 {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.campaign-card:hover .card-body h3 { color: #047857; }

.card-organizer { font-size: 0.78rem; color: #9ca3af; margin-bottom: 12px; }

/* Progress Bar */
.progress-wrapper { margin-bottom: 10px; }

.progress-bar {
    height: 7px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #059669, #10b981);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
}

.amount-raised { font-weight: 700; color: #047857; }
.amount-goal { color: #9ca3af; }

.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: auto;
    padding-top: 8px;
}
.card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}
.empty-state p { font-weight: 600; font-size: 1rem; margin-top: 12px; }
.empty-state small { font-size: 0.85rem; }

/* ============================================
   CAMPAIGN DETAIL PAGE
   ============================================ */
.campaign-detail-section {
    padding: 24px 0 60px;
}

.back-link {
    display: inline-block;
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 20px;
    transition: color 0.2s;
}
.back-link:hover { color: #059669; }

.detail-hero {
    height: 180px;
    border-radius: 16px;
    padding: 14px;
    position: relative;
    margin-bottom: 28px;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 28px;
}

.detail-main h1 {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 4px;
}
.detail-organizer { color: #6b7280; font-size: 0.9rem; margin-bottom: 20px; }

.detail-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.detail-stat-card {
    text-align: center;
    padding: 14px 10px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.stat-green { background: #ecfdf5; color: #059669; }
.stat-blue { background: #eff6ff; color: #2563eb; }
.stat-amber { background: #fffbeb; color: #d97706; }
.detail-stat-card small { font-size: 0.72rem; opacity: 0.8; }
.detail-stat-card strong { font-size: 0.9rem; }

.detail-progress { margin-bottom: 28px; }

.progress-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 8px;
}
.percentage { font-weight: 700; color: #047857; }
.donor-count {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #6b7280;
}

.detail-description {
    padding-top: 24px;
    border-top: 1px solid #f3f4f6;
}
.detail-description h3 { font-size: 1rem; font-weight: 600; margin-bottom: 10px; }
.detail-description p { color: #4b5563; font-size: 0.9rem; line-height: 1.7; }

/* Sidebar */
.donate-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    position: sticky;
    top: 88px;
}
.donate-card h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.login-prompt {
    text-align: center;
    padding: 20px;
    color: #6b7280;
    font-size: 0.9rem;
}
.login-prompt a { color: #059669; font-weight: 600; }

/* Preset Amounts */
.preset-amounts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.preset-btn {
    padding: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.preset-btn:hover { border-color: #a7f3d0; color: #059669; background: #f0fdf4; }
.preset-btn.selected { background: #059669; color: white; border-color: #059669; }

/* Recent Donations */
.recent-donations {
    margin-top: 20px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px;
}
.recent-donations h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 14px;
}

.donation-list {
    max-height: 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.donation-item {
    display: flex;
    gap: 10px;
}

.donor-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #d1fae5;
    color: #059669;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.donor-info { flex: 1; min-width: 0; }
.donor-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.donor-row strong { font-size: 0.85rem; }
.donor-amount { font-weight: 700; font-size: 0.85rem; color: #059669; }
.donor-message { font-size: 0.78rem; color: #6b7280; margin-top: 2px; line-clamp: 2; overflow: hidden; }
.donor-date { font-size: 0.7rem; color: #c0c0c0; margin-top: 2px; display: block; }

/* ============================================
   CREATE CAMPAIGN PAGE
   ============================================ */
.create-section {
    padding: 40px 0 60px;
}

.create-card {
    max-width: 640px;
    margin: 0 auto;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 32px;
}

.create-header h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 4px; }
.create-header p { color: #6b7280; font-size: 0.9rem; margin-bottom: 24px; }

.create-form { display: flex; flex-direction: column; gap: 18px; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 8px;
}

/* ============================================
   FORMS
   ============================================ */
.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}
.form-group textarea { resize: vertical; }

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #047857; border: 1px solid #bbf7d0; }

.toast-success {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 200;
    background: #f0fdf4;
    color: #047857;
    border: 1px solid #bbf7d0;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ============================================
   AUTH PAGES (Login / Register)
   ============================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4, #f8fafb);
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 420px;
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    margin-bottom: 28px;
}
.auth-logo .logo-icon { width: 40px; height: 40px; }
.auth-logo span { font-size: 1.4rem; font-weight: 700; color: #059669; }

.auth-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.auth-card h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 4px; }
.auth-card > p { color: #6b7280; font-size: 0.9rem; margin-bottom: 20px; }
.auth-card form { display: flex; flex-direction: column; gap: 16px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 0.85rem; color: #6b7280; }
.auth-footer a { color: #059669; font-weight: 600; }

.auth-demo {
    text-align: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
}
.auth-demo small { color: #9ca3af; }

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    margin-top: auto;
    border-top: 1px solid #e5e7eb;
    background: white;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 6px;
}

.footer-text {
    font-size: 0.85rem;
    color: #6b7280;
}

.footer-copy {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .desktop-nav { display: none; }
    .mobile-menu-btn { display: block; }

    .hero-content { padding: 40px 20px 36px; }
    .hero-content h1 { font-size: 1.7rem; }
    .hero-stats { gap: 28px; }
    .stat-number { font-size: 1.4rem; }

    .section-header { flex-direction: column; align-items: flex-start; }
    .search-form input { width: 100%; }

    .campaign-grid { grid-template-columns: 1fr; }

    .detail-grid {
        grid-template-columns: 1fr;
    }
    .detail-hero { height: 140px; }

    .detail-stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .detail-stat-card { padding: 10px 6px; }
    .detail-stat-card strong { font-size: 0.8rem; }

    .donate-card { position: static; }

    .form-row { grid-template-columns: 1fr; }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-content h1 { font-size: 1.4rem; }
    .hero-buttons { flex-direction: column; }
    .hero-buttons .btn { width: 100%; }
    .hero-stats { gap: 20px; }
    .stat-number { font-size: 1.2rem; }
    .preset-amounts { grid-template-columns: repeat(2, 1fr); }
}