/* Reset dan Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0a;
    color: #ffffff;
    line-height: 1.6;
}

/* Header Bloomberg Style */
.news-header {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    border-bottom: 1px solid #2a2a2a;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.news-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #00d4ff, #0099ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.news-header span {
    color: #ffffff;
    -webkit-text-fill-color: #ffffff;
}

/* Filter Section */
.news-filter {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

#news-search {
    flex: 1;
    padding: 0.8rem 1rem;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    color: #ffffff;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

#news-search:focus {
    outline: none;
    border-color: #0099ff;
    box-shadow: 0 0 0 2px rgba(0, 153, 255, 0.1);
}

#news-search::placeholder {
    color: #666;
}

#news-category {
    padding: 0.8rem 1rem;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    color: #ffffff;
    font-size: 0.9rem;
    min-width: 150px;
    cursor: pointer;
}

#news-category:focus {
    outline: none;
    border-color: #0099ff;
}

/* News Grid - Bloomberg Style */
.news-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.news-card {
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #2a2a2a;
    position: relative;
}

.news-card:hover {
    transform: translateY(-4px);
    border-color: #0099ff;
    box-shadow: 0 8px 25px rgba(0, 153, 255, 0.15);
}

.news-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid #2a2a2a;
}

.news-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: calc(100% - 200px);
}

.news-text {
    flex: 1;
}

.news-card h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    line-height: 1.4;
    color: #ffffff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card p {
    color: #cccccc;
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    color: #0099ff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.read-more:hover {
    color: #00d4ff;
}

/* Loading State */
/* Loading States */
#news-loading {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-size: 1.1rem;
    display: none;
}

#news-loading i {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
}

/* Error States */
#news-error {
    text-align: center;
    padding: 3rem;
    color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
    border-radius: 8px;
    margin: 2rem 0;
    display: none;
}

#news-error i {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
}

/* Market Ticker Animation Fix */
.market-ticker {
    display: flex;
    gap: 2rem;
    padding: 0 2rem;
    animation: ticker 30s linear infinite;
}

@keyframes ticker {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* Ensure news grid is visible by default */
.news-grid {
    display: grid;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

/* Error State */
.error {
    text-align: center;
    padding: 3rem;
    color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
    border-radius: 8px;
    margin: 2rem 0;
}

/* Footer */
.footer {
    background: #0a0a0a;
    border-top: 1px solid #2a2a2a;
    padding: 2rem 0;
    text-align: center;
    color: #666;
    margin-top: 4rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-container {
        padding: 0 1rem;
    }
    
    .news-filter {
        padding: 0 1rem;
        flex-direction: column;
        gap: 0.8rem;
    }
    
    #news-search,
    #news-category {
        width: 100%;
    }
    
    .news-grid {
        padding: 0 1rem 3rem;
        grid-template-columns: 1fr;
    }
    
    .news-card img {
        height: 180px;
    }
}

/* Dark theme scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}



/* news.css */

/* Pengaturan Default (untuk desktop atau layar lebar) */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 kolom di desktop */
    gap: 20px;
    margin-top: 20px;
}

/* Override untuk Tampilan Mobile */
@media (max-width: 600px) {
    .news-grid {
        grid-template-columns: 1fr; /* Berubah menjadi 1 kolom penuh di mobile */
        gap: 15px;
    }

    /* Juga pastikan elemen filter dan header tersusun vertikal di mobile */
    .news-filter {
        flex-direction: column;
        gap: 10px;
    }
}