/* -------------------------------------------------------
   Base & typography
------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f7f9fa;
  color: #14171a;
  margin: 0;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }

/* -------------------------------------------------------
   Navbar
------------------------------------------------------- */
#main-nav {
  background: #fff;
  border-bottom: 1px solid #e1e8ed;
  padding: 0;
}

#main-nav .navbar-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: #14171a;
  padding: .6rem 1rem;
}

/* -------------------------------------------------------
   Medio select dropdown
------------------------------------------------------- */
.medio-select {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  border-radius: 20px;
  padding: .25rem .85rem;
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  max-width: 180px;
  appearance: auto;
}
.medio-select:focus { outline: none; border-color: rgba(255,255,255,.5); }
.medio-select option { background: #14171a; color: #fff; }

/* -------------------------------------------------------
   Refresh button
------------------------------------------------------- */
.refresh-btn {
  background: none;
  border: 1px solid #e1e8ed;
  color: #536471;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s, border-color .15s, transform .3s;
  padding: 0;
}
.refresh-btn:hover {
  background: #e8f5fe;
  color: #1d9bf0;
  border-color: #c0dff8;
}
.refresh-btn:active { transform: rotate(360deg); }

/* -------------------------------------------------------
   Category bar
------------------------------------------------------- */
#cat-bar {
  border-top: 1px solid #e1e8ed;
  scrollbar-width: none;
}
#cat-bar::-webkit-scrollbar { display: none; }

.cat-pill {
  display: inline-block;
  padding: .3rem .85rem;
  border-radius: 9999px;
  font-size: .82rem;
  font-weight: 500;
  white-space: nowrap;
  color: #536471;
  background: transparent;
  border: 1px solid #e1e8ed;
  transition: background .15s, color .15s;
}
.cat-pill:hover { background: #e8f5fe; color: #1d9bf0; border-color: #c0dff8; }
.cat-pill.active { background: #1d9bf0; color: #fff; border-color: #1d9bf0; }

/* -------------------------------------------------------
   Timeline
------------------------------------------------------- */
.timeline {
  display: flex;
  flex-direction: column;
}

.tweet-card {
  background: #fff;
  border-bottom: 1px solid #e1e8ed;
  padding: 1rem 1rem .75rem;
  transition: background .1s;
}
.tweet-card:hover { background: #f7f9fa; }
.tweet-card:first-child { border-top: 1px solid #e1e8ed; }

/* Source line */
.tweet-meta {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  color: #536471;
  margin-bottom: .35rem;
  flex-wrap: wrap;
}

.feed-favicon {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  object-fit: contain;
}

.feed-name {
  font-weight: 600;
  color: #536471;
}

.cat-badge {
  font-size: .7rem;
  background: #e8f5fe;
  color: #1d9bf0;
  border-radius: 4px;
  padding: .1rem .4rem;
  font-weight: 500;
}

.tweet-time {
  margin-left: auto;
  font-size: .75rem;
  color: #8899a6;
}

/* Title */
.tweet-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 .4rem;
}
.tweet-title a { color: #14171a; }
.tweet-title a:hover { color: #1d9bf0; }

/* Body */
.tweet-body {
  font-size: .9rem;
  color: #536471;
  line-height: 1.5;
  margin: 0 0 .5rem;
}

/* Actions */
.tweet-actions { display: flex; justify-content: flex-end; }

.read-link {
  font-size: .82rem;
  color: #1d9bf0;
  font-weight: 500;
}
.read-link:hover { text-decoration: underline; }

/* -------------------------------------------------------
   Card media (image in wall)
------------------------------------------------------- */
.card-media {
  margin: .5rem 0 .6rem;
  border-radius: 12px;
  overflow: hidden;
  background: #e1e8ed;
  max-height: 280px;
}
.card-media-img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 280px;
  object-fit: cover;
  transition: opacity .2s;
}
.card-media-img:hover { opacity: .92; }

/* -------------------------------------------------------
   Detail view
------------------------------------------------------- */
.detail-card { border-bottom: none !important; }

.detail-title {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.3;
  margin: .5rem 0 1rem;
}

.detail-image {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 1rem;
  max-height: 360px;
  object-fit: cover;
}

.detail-body {
  font-size: .95rem;
  color: #14171a;
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* -------------------------------------------------------
   Empty state
------------------------------------------------------- */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #536471;
}
.empty-state p:first-child { font-weight: 600; font-size: 1.05rem; }

/* -------------------------------------------------------
   Responsive tweaks
------------------------------------------------------- */
@media (min-width: 480px) {
  .tweet-card { padding: 1.1rem 1.25rem .85rem; }
  .tweet-title { font-size: 1.05rem; }
}

@media (min-width: 768px) {
  .tweet-card {
    border-left: 1px solid #e1e8ed;
    border-right: 1px solid #e1e8ed;
  }
  .tweet-card:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
  }
  .tweet-card:last-of-type {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    border-bottom: 1px solid #e1e8ed;
  }
  .pagination-nav {
    border-left: 1px solid #e1e8ed;
    border-right: 1px solid #e1e8ed;
    border-bottom: 1px solid #e1e8ed;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
  }
}
