/* ============================================
   BERITA.CSS - Stylesheet untuk Berita/News Section
   SIMZIS Mobile App - BAZNAS Kota Surakarta
   
   REVISI:
   - FIX: news-detail-header → position:fixed (tidak ikut scroll)
   - FIX: Header dipindahkan KE LUAR content-scroll
   - FIX: .news-detail-scroll padding-top untuk ruang header fixed
   - FIX: .payment-button CSS ditambahkan (QRIS button)
   - Stagger entrance animation
   - Hover/active feedback pada semua interactive element
   ============================================ */

/* ==================== NEWS SECTION ==================== */
.news-section {
    padding-bottom: 160px;
    display: none;
}

/* ==================== NEWS CARDS - STAGGER ANIMATION ==================== */
.news-container {
    padding: 0 20px 20px;
}

.news-card {
    background-color: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    /* Stagger entrance animation */
    animation: newsCardEnter 0.35s ease-out both;
}

/* Stagger delays untuk news cards */
.news-card:nth-child(1) { animation-delay: 0.02s; }
.news-card:nth-child(2) { animation-delay: 0.06s; }
.news-card:nth-child(3) { animation-delay: 0.10s; }
.news-card:nth-child(4) { animation-delay: 0.14s; }
.news-card:nth-child(5) { animation-delay: 0.18s; }
.news-card:nth-child(6) { animation-delay: 0.22s; }
.news-card:nth-child(7) { animation-delay: 0.26s; }
.news-card:nth-child(8) { animation-delay: 0.30s; }
.news-card:nth-child(9) { animation-delay: 0.34s; }
.news-card:nth-child(10) { animation-delay: 0.38s; }

@keyframes newsCardEnter {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.news-card:active {
    transform: scale(0.97);
    transition: transform 0.08s ease;
}

.news-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-card:hover .news-image {
    transform: scale(1.03);
}

.news-content {
    padding: 16px;
}

.news-category {
    display: inline-block;
    padding: 4px 12px;
    background-color: #e8f5e9;
    color: #259148;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.news-category.program { background-color: #e3f2fd; color: #1976d2; }
.news-category.kegiatan { background-color: #fce4ec; color: #c2185b; }
.news-category.berita { background-color: #fff3e0; color: #f57c00; }

.news-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
    line-height: 1.4;
}

.news-excerpt {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.news-date {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #888;
}

.news-date i { font-size: 12px; color: #259148; }

.news-author {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #888;
}

.news-author i { font-size: 12px; color: #259148; }

/* ==================== NEWS FILTER ==================== */
.news-filter {
    display: flex;
    gap: 8px;
    padding: 0 20px 20px;
    overflow-x: auto;
    animation: sectionEnter 0.35s ease-out 0.05s both;
}

.news-filter::-webkit-scrollbar { height: 0; }

.filter-chip {
    padding: 8px 16px;
    background-color: #f5f5f5;
    border-radius: 20px;
    font-size: 12px;
    color: #666;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.2, 0, 0, 1);
    border: 1px solid transparent;
    -webkit-tap-highlight-color: transparent;
}

.filter-chip:hover { background-color: #259148; color: #ffffff; transition: all 0.15s ease; }
.filter-chip:active { transform: scale(0.94); transition: transform 0.08s ease; }

.filter-chip.active { 
    background-color: #259148; 
    color: #ffffff; 
    animation: chipActive 0.25s ease-out;
}

@keyframes chipActive {
    from { transform: scale(0.9); }
    to { transform: scale(1); }
}

/* ============================================ */
/* NEWS DETAIL - HEADER FIXED                   */
/* FIX: position:fixed agar tidak ikut scroll   */
/* ============================================ */
.news-detail-section { padding-bottom: 0; display: none; background-color: #ffffff; }

.news-detail-header {
    /* FIX: position FIXED bukan sticky - agar selalu stay di atas */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    max-width: 480px;
    margin: 0 auto;
    z-index: 100;
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; background-color: #ffffff;
    border-bottom: 1px solid #f0f0f0; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    animation: fadeIn 0.2s ease-out;
}

.news-back-button {
    display: flex; align-items: center; gap: 8px;
    background: none; border: none; cursor: pointer;
    padding: 8px 4px; border-radius: 10px;
    transition: background-color 0.15s ease; -webkit-tap-highlight-color: transparent;
}

.news-back-button:active { background-color: #f0f0f0; }
.news-back-button i { font-size: 18px; color: #259148; transition: transform 0.2s ease; }
.news-back-button:active i { transform: translateX(-3px); }
.news-back-button span { font-size: 14px; font-weight: 500; color: #333; }

.news-detail-header-title { position: absolute; left: 50%; transform: translateX(-50%); }
.news-detail-header-title span { font-size: 15px; font-weight: 600; color: #1a1a1a; }

.news-share-button {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; background: none; border: none;
    cursor: pointer; border-radius: 10px; transition: background-color 0.15s ease, transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.news-share-button:active { background-color: #f0f0f0; }
.news-share-button:active i { transform: scale(0.85); }
.news-share-button i { font-size: 18px; color: #333; transition: transform 0.15s ease; }

.news-detail-page { padding-bottom: 32px; }
.news-detail-loading { padding: 60px 20px; text-align: center; }

/* FIX: padding-top untuk ruang header yang fixed (57px) */
.news-detail-scroll {
    padding-top: 57px;
    padding-bottom: 160px;
}

/* News Detail Body - ANIMASI MASUK */
#newsDetailBodyWrapper {
    animation: newsDetailEnter 0.35s ease-out;
}

@keyframes newsDetailEnter {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.news-detail-hero-image-wrapper { width: 100%; overflow: hidden; background-color: #f5f5f5; }
.news-detail-hero-image { width: 100%; height: 220px; object-fit: cover; display: block; animation: newsImageZoom 0.4s ease-out; }

@keyframes newsImageZoom {
    from { transform: scale(1.05); opacity: 0.8; }
    to { transform: scale(1); opacity: 1; }
}

.news-detail-article { padding: 0 20px; animation: sectionEnter 0.35s ease-out 0.08s both; }

.news-detail-tags-row { display: flex; align-items: center; gap: 12px; padding-top: 20px; margin-bottom: 14px; }

.news-detail-category-badge {
    display: inline-block; padding: 4px 14px; border-radius: 20px;
    font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
    animation: scaleIn 0.25s ease-out;
}
.news-detail-category-badge.program { background-color: #e3f2fd; color: #1976d2; }
.news-detail-category-badge.kegiatan { background-color: #fce4ec; color: #c2185b; }
.news-detail-category-badge.berita { background-color: #fff3e0; color: #f57c00; }

.news-detail-read-time { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #888; }
.news-detail-read-time i { font-size: 12px; color: #259148; }

.news-detail-heading { font-size: 22px; font-weight: 700; color: #1a1a1a; line-height: 1.35; margin-bottom: 16px; letter-spacing: -0.01em; }

.news-detail-author-row { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.news-detail-author-avatar { width: 40px; height: 40px; border-radius: 50%; background-color: #e8f5e9; display: flex; align-items: center; justify-content: center; flex-shrink: 0; animation: scaleIn 0.3s ease-out 0.05s both; }
.news-detail-author-avatar i { font-size: 24px; color: #259148; }
.news-detail-author-info { display: flex; flex-direction: column; gap: 2px; }
.news-detail-author-name { font-size: 13px; font-weight: 600; color: #333; }
.news-detail-date-text { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #888; }
.news-detail-date-text i { font-size: 11px; color: #259148; }

.news-detail-separator { height: 1px; background: linear-gradient(to right, transparent, #e0e0e0, transparent); margin: 20px 0; }

.news-detail-text-content { font-size: 15px; line-height: 1.85; color: #444; }
.news-detail-text-content p { margin-bottom: 18px; text-align: justify; word-break: break-word; }
.news-detail-text-content p:last-child { margin-bottom: 0; }
.news-detail-text-content h3 { font-size: 17px; font-weight: 600; color: #1a1a1a; margin: 24px 0 12px 0; }
.news-detail-text-content ul, .news-detail-text-content ol { padding-left: 20px; margin-bottom: 18px; }
.news-detail-text-content li { margin-bottom: 8px; }
.news-detail-text-content blockquote { border-left: 3px solid #259148; padding: 12px 16px; margin: 16px 0; background-color: #f9fdf9; border-radius: 0 8px 8px 0; font-style: italic; color: #555; }

.news-detail-keywords-section { margin-bottom: 0; }
.news-detail-keywords-label { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.news-detail-keywords-label i { font-size: 14px; color: #259148; }
.news-detail-keywords-label span { font-size: 14px; font-weight: 600; color: #333; }
.news-detail-keywords-list { display: flex; flex-wrap: wrap; gap: 8px; }
.news-detail-keyword-tag { 
    display: inline-block; padding: 5px 14px; background-color: #f0f7f2; color: #259148; 
    border-radius: 20px; font-size: 12px; font-weight: 500; cursor: default; 
    transition: background-color 0.15s ease, transform 0.15s ease; border: 1px solid #d4edda;
    animation: scaleIn 0.2s ease-out both;
}
.news-detail-keyword-tag:nth-child(1) { animation-delay: 0.02s; }
.news-detail-keyword-tag:nth-child(2) { animation-delay: 0.04s; }
.news-detail-keyword-tag:nth-child(3) { animation-delay: 0.06s; }
.news-detail-keyword-tag:nth-child(4) { animation-delay: 0.08s; }
.news-detail-keyword-tag:nth-child(5) { animation-delay: 0.10s; }

.news-detail-suggested-section { margin-bottom: 20px; }
.news-detail-suggested-title { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.news-detail-suggested-title i { font-size: 16px; color: #259148; }
.news-detail-suggested-title span { font-size: 16px; font-weight: 600; color: #1a1a1a; }
.news-detail-suggested-list { display: flex; flex-direction: column; gap: 12px; }
.news-detail-suggested-card { 
    display: flex; gap: 14px; padding: 12px; background-color: #f9fafb; border-radius: 16px; 
    cursor: pointer; transition: background-color 0.15s ease, transform 0.15s ease; 
    -webkit-tap-highlight-color: transparent; border: 1px solid #f0f0f0;
    animation: newsCardEnter 0.3s ease-out both;
}
.news-detail-suggested-card:nth-child(1) { animation-delay: 0.02s; }
.news-detail-suggested-card:nth-child(2) { animation-delay: 0.06s; }
.news-detail-suggested-card:nth-child(3) { animation-delay: 0.10s; }
.news-detail-suggested-card:active { background-color: #f0f0f0; transform: scale(0.97); }
.news-detail-suggested-image { width: 90px; height: 70px; border-radius: 12px; object-fit: cover; flex-shrink: 0; background-color: #e5e5e5; }
.news-detail-suggested-info { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 6px; min-width: 0; }
.news-detail-suggested-category { display: inline-block; width: fit-content; padding: 2px 8px; border-radius: 8px; font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.news-detail-suggested-category.program { background-color: #e3f2fd; color: #1976d2; }
.news-detail-suggested-category.kegiatan { background-color: #fce4ec; color: #c2185b; }
.news-detail-suggested-category.berita { background-color: #fff3e0; color: #f57c00; }
.news-detail-suggested-title-text { font-size: 13px; font-weight: 600; color: #1a1a1a; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-detail-suggested-meta { display: flex; align-items: center; gap: 8px; font-size: 10px; color: #999; }
.news-detail-suggested-meta i { font-size: 10px; color: #259148; }

/* ==================== NEWS NO-IMAGE PLACEHOLDER ==================== */
.news-no-image { width: 100%; height: 180px; background-color: #f5f5f5; display: flex; align-items: center; justify-content: center; }
.news-no-image i { font-size: 48px; color: #ddd; }
body.dark-mode .news-no-image { background-color: #2a2a2a; }
body.dark-mode .news-no-image i { color: #444; }
.news-detail-no-image { width: 100%; height: 220px; background-color: #f5f5f5; display: flex; align-items: center; justify-content: center; }
.news-detail-no-image i { font-size: 48px; color: #ddd; }
body.dark-mode .news-detail-no-image { background-color: #2a2a2a; }
body.dark-mode .news-detail-no-image i { color: #444; }
.news-card-image-wrapper { overflow: hidden; }

/* ==================== BACK ICON (Navigasi Berita) ==================== */
.back-icon { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: none; border: none; cursor: pointer; transition: background-color 0.15s ease, transform 0.15s ease; color: #259148; font-size: 20px; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.back-icon:hover { background-color: rgba(37, 145, 72, 0.1); }
.back-icon:active { transform: scale(0.88); }
body.dark-mode .back-icon { color: #259148; }
body.dark-mode .back-icon:hover { background-color: rgba(37, 145, 72, 0.15); }

/* ============================================ */
/* PAYMENT BUTTON (QRIS) - Bottom Nav            */
/* ============================================ */
.payment-button {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #259148, #34d058);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -20px;
    box-shadow: 0 4px 15px rgba(37, 145, 72, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.payment-button i {
    color: #fff;
    font-size: 24px;
    transition: transform 0.15s ease;
}
.payment-button:hover {
    box-shadow: 0 6px 20px rgba(37, 145, 72, 0.4);
}
.payment-button:active {
    transform: scale(0.9);
}
body.dark-mode .payment-button {
    background: linear-gradient(135deg, #1a7a34, #259148);
    box-shadow: 0 4px 15px rgba(37, 145, 72, 0.2);
}

/* ==================== NEWS DETAIL DARK MODE ==================== */
body.dark-mode .news-detail-section { background-color: #242424; }
body.dark-mode .news-detail-header { background-color: #242424; border-bottom: 1px solid #333; }
body.dark-mode .news-detail-header-title span { color: #ffffff; }
body.dark-mode .news-back-button span { color: #ffffff; }
body.dark-mode .news-back-button i { color: #259148; }
body.dark-mode .news-share-button i { color: #ffffff; }
body.dark-mode .news-detail-article { background-color: #242424; }
body.dark-mode .news-detail-heading { color: #ffffff; }
body.dark-mode .news-detail-author-name { color: #ffffff; }
body.dark-mode .news-detail-date-text span { color: #aaa; }
body.dark-mode .news-detail-date-text i { color: #259148; }
body.dark-mode .news-detail-author-avatar { color: #555; }
body.dark-mode .news-detail-text-content p { color: #cccccc; }
body.dark-mode .news-detail-separator { background: linear-gradient(to right, transparent, #444, transparent); }
body.dark-mode .news-detail-keywords-label span { color: #ffffff; }
body.dark-mode .news-detail-keyword-tag { background-color: #333; color: #cccccc; border: 1px solid #444; }
body.dark-mode .news-detail-suggested-title span { color: #ffffff; }
body.dark-mode .news-detail-suggested-title i { color: #259148; }
body.dark-mode .news-detail-suggested-card { background-color: #333; }
body.dark-mode .news-detail-suggested-card:active { background-color: #444; }
body.dark-mode .news-detail-suggested-title-text { color: #ffffff; }
body.dark-mode .news-detail-suggested-meta span { color: #888; }
body.dark-mode .news-detail-suggested-meta i { color: #259148; }
body.dark-mode .news-detail-read-time span { color: #aaa; }
body.dark-mode .news-detail-read-time i { color: #259148; }
body.dark-mode .news-card { background-color: #2a2a2a; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2); }
body.dark-mode .news-title { color: #ffffff; }
body.dark-mode .news-excerpt { color: #aaa; }
body.dark-mode .news-meta { border-top-color: #333; }
body.dark-mode .filter-chip { background-color: #333; color: #aaa; }
body.dark-mode .filter-chip.active { background-color: #259148; color: #ffffff; }
body.dark-mode .filter-chip:hover { background-color: #259148; color: #ffffff; }

/* ==================== NEWS RESPONSIVE ==================== */
@media (max-width: 420px) {
    .news-detail-hero-image { height: 190px; }
    .news-detail-heading { font-size: 20px; }
    .news-detail-article { padding: 0 16px; }
    .news-detail-text-content { font-size: 14px; line-height: 1.8; }
}

/* ==================== NEWS SECTION EMBEDDED PADDING FIX ==================== */
.news-detail-section .content-scroll { padding-bottom: 0; }
/* FIX: gunakan class khusus news-detail-scroll untuk padding */
#newsListView .content-scroll { padding-bottom: 160px; }
