/* ===== ENHANCED BERITA PAGE STYLES ===== */


/* Global Resets & Typography */

* {
    scroll-behavior: smooth;
}

body {
    font-feature-settings: "kern" 1, "liga" 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


/* ===== COMMODITY FILTER STYLES ===== */

.commodity-filter-card {
    animation: fadeInUp 0.4s ease-out;
}

.commodity-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #4b5563;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.commodity-filter-btn:hover {
    background: #f0f4f8;
    border-color: #9ca3af;
    color: #1f2937;
}

.commodity-filter-btn.active {
    background: #374151;
    border-color: #374151;
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.commodity-filter-btn.active.commodity-lobster {
    background: #dc2626;
    border-color: #dc2626;
}

.commodity-filter-btn.active.commodity-udang {
    background: #be185d;
    border-color: #be185d;
}

.commodity-filter-btn.active.commodity-rumput-laut {
    background: #047857;
    border-color: #047857;
}

.commodity-filter-btn.active.commodity-rajungan-kepiting {
    background: #0284c7;
    border-color: #0284c7;
}

.commodity-filter-btn.active.commodity-tilapia {
    background: #0d9488;
    border-color: #0d9488;
}


/* Shine effect animation */

@keyframes shine {
    from {
        left: -100%;
    }
    to {
        left: 100%;
    }
}


/* Ripple effect */

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}


/* ===== ANIMATIONS ===== */


/* Fade In Up Animation */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}


/* Slide In Right Animation */

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slideInRight {
    animation: slideInRight 0.7s ease-out forwards;
}


/* Scale Fade In Animation */

@keyframes scaleFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-scaleFadeIn {
    animation: scaleFadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}


/* Pulse Animation for Live Indicators */

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.15);
    }
}

.animate-pulse-custom {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}


/* Blob Animation */

@keyframes blob {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(30px, -50px) scale(1.1);
    }
    50% {
        transform: translate(-30px, 30px) scale(0.9);
    }
    75% {
        transform: translate(50px, 50px) scale(1.05);
    }
}

.animate-blob {
    animation: blob 7s infinite;
}

.animation-delay-2000 {
    animation-delay: 2s;
}

.animation-delay-4000 {
    animation-delay: 4s;
}


/* Float Animation */

@keyframes float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}


/* Shimmer Loading Animation */

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.skeleton {
    background: linear-gradient( 90deg, #f3f4f6 0%, #e5e7eb 20%, #f3f4f6 40%, #f3f4f6 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
    border-radius: 12px;
}


/* ===== HERO SECTION ===== */

.hero-news {
    position: relative;
    overflow: hidden;
}

.hero-news::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(59, 130, 246, 0.1) 0%, transparent 50%), radial-gradient(circle at 70% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
}


/* ===== CARDS & COMPONENTS ===== */


/* News Cards */

.news-card,
.news-card-enhanced {
    position: relative;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid #f1f5f9;
}

.news-card::before,
.news-card-enhanced::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
}


/* Image Containers */

.featured-image,
.card-image-container {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    /* Maintain 16:9 aspect ratio for consistency */
    aspect-ratio: 16 / 9;
}

.featured-image::after,
.card-image-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient( 180deg, transparent 0%, rgba(0, 0, 0, 0.1) 50%, rgba(0, 0, 0, 0.3) 100%);
    opacity: 0;
}

.featured-image img,
.card-image-container img {
    object-fit: cover;
    object-position: center;
    width: 100%;
    height: 100%;
}


/* Badges */

.category-badge,
.card-source-badge,
.news-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 10px;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.badge-international {
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
    color: white;
}

.badge-domestic {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.badge-analysis {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

.badge-trending {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.news-badge::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    background: inherit;
    filter: blur(10px);
    opacity: 0.5;
    z-index: -1;
}


/* Sidebar Widgets */

.sidebar-widget {
    background: white;
    border-radius: 20px;
    border: 2px solid #f1f5f9;
    overflow: hidden;
}

.sidebar-widget-header {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    padding: 1.25rem;
    color: white;
    font-weight: 800;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.5px;
}

.sidebar-news-item {
    padding: 1.25rem;
    border-bottom: 2px solid #f9fafb;
    cursor: pointer;
    position: relative;
}

.sidebar-news-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #3b82f6, #8b5cf6);
    transform: scaleY(0);
}

.sidebar-news-item:last-child {
    border-bottom: none;
}

.sidebar-news-item .thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6 0%, #1e3a8a 100%);
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sidebar-news-item .thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* Category List */

.category-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-radius: 12px;
    color: #4b5563;
    font-size: 0.9rem;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.category-list a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #3b82f6, #8b5cf6);
    transform: scaleY(0);
}

.category-list a.active {
    background: linear-gradient(90deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    font-weight: 800;
    padding-left: 1.5rem;
}

.category-list a.active::before {
    transform: scaleY(1);
}

.category-count {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}


/* Article Cards */

.article-card-horizontal {
    display: flex;
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.1);
    border: 2px solid #f1f5f9;
}

.article-thumb {
    position: relative;
    width: 300px;
    min-height: 220px;
    flex-shrink: 0;
    overflow: hidden;
}

.article-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* ===== INTERACTIVE ELEMENTS ===== */


/* Buttons */

button,
.btn {
    position: relative;
    overflow: hidden;
}

button::before,
.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
}


/* Links */

a {}


/* ===== UTILITY CLASSES ===== */


/* Line Clamp */

.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-4 {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* Glass Effect */

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}


/* Gradient Text */

.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}


/* Shadow Utilities */

.shadow-soft {
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.1);
}

.shadow-3xl {
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.3);
}

.shadow-4xl {
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.4);
}


/* ===== SCROLLBAR ===== */


/* Custom Scrollbar */

::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #3b82f6, #8b5cf6);
    border-radius: 10px;
    border: 2px solid #f1f5f9;
}


/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 1024px) {
    .hero-news {
        min-height: 350px;
    }
    .article-card-horizontal {
        flex-direction: column;
    }
    .article-thumb {
        width: 100%;
        height: 220px;
    }
    .sidebar-news-item .thumbnail {
        width: 70px;
        height: 70px;
    }
}

@media (max-width: 768px) {
    .hero-news {
        min-height: 300px;
    }
    .sidebar-news-item {
        padding: 1rem;
    }
    .sidebar-news-item .thumbnail {
        width: 60px;
        height: 60px;
    }
    .news-card,
    .news-card-enhanced {
        border-radius: 16px;
    }
    .category-list a {
        font-size: 0.85rem;
        padding: 0.875rem;
    }
}

@media (max-width: 480px) {
    .hero-news {
        min-height: 250px;
    }
    .sidebar-widget-header {
        padding: 1rem;
        font-size: 0.875rem;
    }
    .news-badge {
        font-size: 0.65rem;
        padding: 6px 12px;
    }
}


/* ===== STAGGERED ANIMATIONS ===== */

.news-card:nth-child(1),
.news-card-enhanced:nth-child(1) {
    animation-delay: 0.1s;
}

.news-card:nth-child(2),
.news-card-enhanced:nth-child(2) {
    animation-delay: 0.2s;
}

.news-card:nth-child(3),
.news-card-enhanced:nth-child(3) {
    animation-delay: 0.3s;
}

.news-card:nth-child(4),
.news-card-enhanced:nth-child(4) {
    animation-delay: 0.4s;
}

.news-card:nth-child(5),
.news-card-enhanced:nth-child(5) {
    animation-delay: 0.5s;
}

.news-card:nth-child(6),
.news-card-enhanced:nth-child(6) {
    animation-delay: 0.6s;
}


/* ===== DARK MODE SUPPORT (Optional) ===== */

@media (prefers-color-scheme: dark) {
    /* Add dark mode styles here if needed */
}


/* ===== PRINT STYLES ===== */

@media print {
    .sidebar-widget,
    .category-list,
    button,
    .btn {
        display: none;
    }
    .news-card,
    .news-card-enhanced {
        break-inside: avoid;
    }
}
