/* ==========================================================================
   AKHBAR OMAN & TIMUR TENGAH - SCROLLABLE LIVE NEWS FEED
   Matches Portal Literasi Islam Clean Modern Blue/Slate Aesthetic
   ========================================================================== */

.news-feed-stream {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 315px;
  max-height: 315px;
  border-radius: 14px;
  overflow: hidden;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body.dark .news-feed-stream {
  background: #0f172a;
  border-color: #1e293b;
  color: #f8fafc;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

/* Header bar inside stream */
.news-feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

body.dark .news-feed-header {
  background: #1e293b;
  border-bottom-color: #334155;
}

.news-feed-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 10.5px;
  font-weight: 700;
  color: #2563eb;
  letter-spacing: 0.5px;
}

body.dark .news-feed-live-badge {
  background: rgba(37, 99, 235, 0.2);
  border-color: rgba(96, 165, 250, 0.35);
  color: #93c5fd;
}

.news-feed-pulse {
  width: 7px;
  height: 7px;
  background: #ef4444;
  border-radius: 50%;
  box-shadow: 0 0 8px #ef4444;
  animation: newsPulse 1.8s infinite;
}

@keyframes newsPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.5; }
}

.news-feed-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.news-feed-refresh-btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #64748b;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: all 0.2s ease;
}

.news-feed-refresh-btn:hover {
  background: #e2e8f0;
  color: #1e293b;
  transform: rotate(180deg);
}

body.dark .news-feed-refresh-btn {
  background: #334155;
  border-color: #475569;
  color: #94a3b8;
}

body.dark .news-feed-refresh-btn:hover {
  background: #475569;
  color: #f8fafc;
}

.news-feed-ona-brand {
  font-size: 11px;
  font-weight: 700;
  color: #2563eb;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s ease;
}

.news-feed-ona-brand:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

body.dark .news-feed-ona-brand {
  color: #60a5fa;
}

/* Category Filter Chips */
.news-feed-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #f1f5f9;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex-shrink: 0;
  border-bottom: 1px solid #e2e8f0;
}

body.dark .news-feed-chips {
  background: #0f172a;
  border-bottom-color: #1e293b;
}

.news-feed-chips::-webkit-scrollbar {
  display: none;
}

.news-chip-btn {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 9999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.news-chip-btn:hover {
  background: #f8fafc;
  color: #1e293b;
}

.news-chip-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

body.dark .news-chip-btn {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}

body.dark .news-chip-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

/* Scrollable News List Container */
.news-feed-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(37, 99, 235, 0.3) transparent;
}

.news-feed-list::-webkit-scrollbar {
  width: 5px;
}

.news-feed-list::-webkit-scrollbar-track {
  background: transparent;
}

.news-feed-list::-webkit-scrollbar-thumb {
  background: rgba(37, 99, 235, 0.25);
  border-radius: 4px;
}

.news-feed-list::-webkit-scrollbar-thumb:hover {
  background: rgba(37, 99, 235, 0.5);
}

/* Individual News Feed Item Card */
.news-feed-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.news-feed-item:hover {
  background: #f0f7ff;
  border-color: #bfdbfe;
  transform: translateY(-1.5px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}

body.dark .news-feed-item {
  background: #1e293b;
  border-color: #334155;
  box-shadow: none;
}

body.dark .news-feed-item:hover {
  background: #26334d;
  border-color: #3b82f6;
}

.news-feed-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.news-item-tag {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  padding: 2px 7px;
  border-radius: 4px;
}

body.dark .news-item-tag {
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.18);
  border-color: rgba(96, 165, 250, 0.3);
}

.news-item-time {
  font-size: 10px;
  color: #64748b;
}

body.dark .news-item-time {
  color: #94a3b8;
}

.news-item-title-ar {
  font-family: 'Amiri', serif;
  font-size: 14px;
  font-weight: 700;
  color: #1e3a8a;
  line-height: 1.45;
  direction: rtl;
  text-align: right;
  margin-top: 2px;
}

body.dark .news-item-title-ar {
  color: #fde047;
}

.news-item-title-id {
  font-size: 11.5px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.4;
}

body.dark .news-item-title-id {
  color: #f8fafc;
}

.news-item-desc {
  font-size: 11px;
  color: #475569;
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.dark .news-item-desc {
  color: #cbd5e1;
}

.news-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 3px;
  padding-top: 6px;
  border-top: 1px solid #f1f5f9;
  font-size: 10px;
  color: #2563eb;
  font-weight: 600;
}

body.dark .news-item-footer {
  border-top-color: #334155;
  color: #60a5fa;
}

.news-item-footer span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Modal Popup for Reading Details */
.news-detail-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.news-detail-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.news-detail-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  max-width: 520px;
  width: 100%;
  padding: 24px;
  color: #0f172a;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  position: relative;
  transform: translateY(20px);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 85vh;
  overflow-y: auto;
}

body.dark .news-detail-box {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.news-detail-modal.active .news-detail-box {
  transform: translateY(0);
}

.news-detail-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #f1f5f9;
  border: none;
  color: #64748b;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s ease;
}

.news-detail-close:hover {
  background: #fee2e2;
  color: #ef4444;
}

body.dark .news-detail-close {
  background: #334155;
  color: #94a3b8;
}

body.dark .news-detail-close:hover {
  background: #7f1d1d;
  color: #fca5a5;
}

/* RTL Support for News Feed & Modal */
html[dir="rtl"] .news-feed-stream,
body.rtl-ui .news-feed-stream {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] .news-feed-header,
body.rtl-ui .news-feed-header {
  flex-direction: row-reverse;
}

html[dir="rtl"] .news-feed-item,
body.rtl-ui .news-feed-item {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] .news-feed-item-top,
body.rtl-ui .news-feed-item-top {
  flex-direction: row-reverse;
}

html[dir="rtl"] .news-item-footer,
body.rtl-ui .news-item-footer {
  flex-direction: row-reverse;
}

html[dir="rtl"] .news-detail-close,
body.rtl-ui .news-detail-close {
  right: auto;
  left: 16px;
}

