/* Custom CSS untuk halaman berita */

/* Animasi loading untuk gambar */
.berita-card-img {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.berita-card-img[src] {
    animation: none;
    background: none;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Hover effects untuk card */
.berita-card {
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.berita-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

/* Parallax effect untuk hero */
.berita-detail-hero {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Responsive typography */
@media (max-width: 576px) {
    .berita-content {
        font-size: 0.95rem;
        line-height: 1.7;
    }
    
    .berita-content h1 {
        font-size: 1.5rem;
    }
    
    .berita-content h2 {
        font-size: 1.3rem;
    }
    
    .berita-content h3 {
        font-size: 1.1rem;
    }
}

/* Print styles */
@media print {
    .navbar,
    .share-section,
    .fab-container,
    .reading-progress {
        display: none !important;
    }
    
    .berita-content-wrapper {
        margin-top: 0;
        box-shadow: none;
    }
    
    .berita-content {
        color: #000 !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .berita-card {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .berita-card-title {
        color: #f7fafc;
    }
    
    .berita-card-text {
        color: #cbd5e0;
    }
    
    .berita-content {
        color: #e2e8f0;
    }
}

/* Accessibility improvements */
.berita-card:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.share-btn:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Loading states */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
}

/* Enhanced mobile experience */
@media (max-width: 768px) {
    .berita-card:hover {
        transform: translateY(-4px);
    }
    
    .share-section {
        position: sticky;
        bottom: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border-top: 1px solid #e2e8f0;
        margin: 0 -1rem;
        padding: 1rem;
        border-radius: 0;
    }
}

/* Performance optimizations */
.berita-card-img {
    will-change: transform;
}

.berita-card {
    will-change: transform, box-shadow;
}

/* Lazy loading placeholder */
.berita-card-img[data-src] {
    background: #f8f9fa;
    position: relative;
}

.berita-card-img[data-src]::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}