/* Variabel Warna (Sistem Tema) */
:root {
    /* Default: Dark Mode */
    --bg-color: #202124;
    --surface-color: #303134;
    --text-primary: #e8eaed;
    --text-secondary: #9aa0a6;
    --accent-color: #8ab4f8;
    --border-color: #5f6368;
    --nav-bg: #202124;
}

/* Jika ingin toggle ke Light Mode nantinya, ganti class di body */
body.light-mode {
    --bg-color: #f8f9fa;
    --surface-color: #ffffff;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --accent-color: #1a73e8;
    --border-color: #dadce0;
    --nav-bg: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    padding-bottom: 70px; /* Ruang untuk bottom nav di HP */
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- Header / Topbar --- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background-color: var(--bg-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.logo span {
    color: var(--accent-color);
}

.search-bar {
    flex: 1;
    max-width: 400px;
    margin: 0 16px;
    display: flex;
    align-items: center;
    background-color: var(--surface-color);
    border-radius: 24px;
    padding: 8px 16px;
}

.search-bar i {
    color: var(--text-secondary);
    margin-right: 8px;
}

.search-bar input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    width: 100%;
    outline: none;
    font-size: 14px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-actions button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
}

.profile-pic {
    width: 32px;
    height: 32px;
    background-color: var(--surface-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
}

/* --- Kategori Navigasi Horizontal --- */
.category-nav {
    border-bottom: 1px solid var(--surface-color);
}

.category-list {
    display: flex;
    list-style: none;
    padding: 0 16px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none; /* Hide scrollbar Firefox */
}

.category-list::-webkit-scrollbar {
    display: none; /* Hide scrollbar Chrome/Safari */
}

.category-list li {
    padding: 12px 16px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.category-list li.active {
    color: var(--accent-color);
    border-bottom: 3px solid var(--accent-color);
}

/* --- Konten Utama & Grid --- */
.main-content {
    padding: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-size: 18px;
    margin-bottom: 16px;
    font-weight: 500;
}

.news-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

/* --- Card Berita --- */
.news-card {
    background-color: var(--surface-color);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: row; /* Gambar di kiri untuk card standar */
    height: 120px;
}

.news-card.featured {
    flex-direction: column; /* Gambar di atas untuk berita utama */
    height: auto;
}

.news-image {
    width: 120px;
    object-fit: cover;
}

.news-card.featured .news-image {
    width: 100%;
    height: 200px;
}

.news-content {
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
}

.news-meta {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.source {
    display: flex;
    align-items: center;
    font-weight: 500;
    color: var(--text-primary);
    margin-right: 12px;
}

.source-icon {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    margin-right: 6px;
}

.news-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card.featured .news-title {
    font-size: 18px;
}

/* --- Tombol Aksi di Card --- */
.card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.ai-summary-btn {
    background: linear-gradient(45deg, #8ab4f8, #c58af9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    border: none;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ai-summary-btn i {
    -webkit-text-fill-color: #8ab4f8;
}

.right-actions .action-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    margin-left: 16px;
    font-size: 16px;
    cursor: pointer;
}

/* --- Bottom Navigation (Khusus HP) --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    background-color: var(--nav-bg);
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    border-top: 1px solid var(--surface-color);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 10px;
    gap: 4px;
}

.nav-item i {
    font-size: 20px;
    padding: 4px 16px;
    border-radius: 16px;
}

.nav-item.active {
    color: var(--text-primary);
}

.nav-item.active i {
    background-color: rgba(138, 180, 248, 0.2);
    color: var(--accent-color);
}

/* --- RESPONSIVE DESIGN (Tablet & PC) --- */

@media (min-width: 768px) {
    /* Tablet */
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .news-card.featured {
        grid-column: span 2; /* Berita utama memenuhi 2 kolom */
    }

    .bottom-nav {
        display: none; /* Sembunyikan bottom nav di layar besar */
    }

    body {
        padding-bottom: 0;
    }
}

@media (min-width: 1024px) {
    /* PC / Desktop */
    .news-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .news-card.featured {
        grid-column: span 2;
        grid-row: span 2;
    }

    .news-card.featured .news-image {
        height: 100%;
    }
}
