/* ====================================================
   LIVENEWS PREMIUM LIVE UPDATES TIMELINE STYLE
   ==================================================== */

.live-timeline-section {
  margin: 0;
  animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  height: 100%;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.live-timeline-card {
  background: rgba(30, 41, 59, 0.45);
  border: 1.5px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 24px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  flex-grow: 1;
}

/* Background ambient light */
.live-timeline-card::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* Header Container */
.live-timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.live-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.live-badge-glow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.12);
  border: 1.5px solid rgba(239, 68, 68, 0.25);
  padding: 4px 10px;
  border-radius: 20px;
  color: #ef4444;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.live-pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #ef4444;
  border-radius: 50%;
  box-shadow: 0 0 8px #ef4444;
  animation: pulse-live 1.5s infinite;
}

.live-timeline-title {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Live Controls (Refresh & Toggle) */
.live-controls {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

/* iOS Style Switch */
.auto-update-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
}

.switch-label {
  cursor: pointer;
}

.ios-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.ios-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-switch {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 34px;
}

.slider-switch:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #cbd5e1;
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}

.ios-switch input:checked + .slider-switch {
  background-color: #10b981;
  border-color: rgba(16, 185, 129, 0.2);
}

.ios-switch input:checked + .slider-switch:before {
  transform: translateX(20px);
  background-color: #ffffff;
}

.ios-switch input:focus-visible + .slider-switch {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* Refresh Button */
.live-refresh-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-smooth);
}

.live-refresh-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  transform: translateY(-1px);
}

.live-refresh-btn:active {
  transform: translateY(1px);
}

.live-refresh-btn svg {
  transition: transform 0.6s ease;
}

.live-refresh-btn.spinning svg {
  transform: rotate(360deg);
}

/* Timeline Feed Container */
.live-timeline-feed {
  position: relative;
  padding-left: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 336px;
  flex-grow: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 8px;
}

/* Custom scrollbar for live updates timeline */
.live-timeline-feed::-webkit-scrollbar {
  width: 6px;
}

.live-timeline-feed::-webkit-scrollbar-track {
  background: transparent;
}

.live-timeline-feed::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.live-timeline-feed::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

body.light-theme .live-timeline-feed::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.15);
}

body.light-theme .live-timeline-feed::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 23, 42, 0.3);
}

/* Vertical Dotted Timeline Line */
.live-timeline-feed::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.12) 60%, transparent 40%);
  background-size: 2px 10px;
  pointer-events: none;
}

/* Individual Timeline Item */
.timeline-item {
  position: relative;
  background: rgba(15, 23, 42, 0.2);
  border: 1.5px solid rgba(255, 255, 255, 0.03);
  border-radius: 14px;
  padding: 16px 20px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  cursor: pointer;
}

.timeline-item:hover {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.08);
}

.timeline-item.new-update-highlight {
  animation: slideInNewUpdate 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  border-color: rgba(251, 191, 36, 0.3) !important;
  background: rgba(251, 191, 36, 0.02) !important;
}

/* Timeline Node circle */
.timeline-node {
  position: absolute;
  left: -32px;
  top: 22px;
  width: 20px;
  height: 20px;
  background-color: var(--bg-secondary);
  border: 3.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 2;
}

.timeline-item:hover .timeline-node {
  border-color: var(--accent-color);
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

.timeline-item.new-update-highlight .timeline-node {
  border-color: #fbbf24 !important;
  background-color: #fbbf24 !important;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.6);
}

/* Timeline Node Pulse for very latest */
.timeline-item:first-child .timeline-node::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: inherit;
  border: 1px solid inherit;
  animation: pulse-node 1.5s infinite;
}

/* Timeline Item Header */
.timeline-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  user-select: none;
}

.timeline-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.timeline-time {
  font-family: 'Outfit', sans-serif;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--accent-color);
}

.timeline-category {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Category Badge variations */
.timeline-category.cat-breaking { background: rgba(239, 68, 68, 0.12); color: #ef4444; border-color: rgba(239, 68, 68, 0.2); }
.timeline-category.cat-tech { background: rgba(59, 130, 246, 0.12); color: #60a5fa; border-color: rgba(59, 130, 246, 0.2); }
.timeline-category.cat-finance { background: rgba(16, 185, 129, 0.12); color: #34d399; border-color: rgba(16, 185, 129, 0.2); }
.timeline-category.cat-general { background: rgba(148, 163, 184, 0.12); color: #cbd5e1; border-color: rgba(148, 163, 184, 0.2); }

.timeline-title-text {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.4;
  margin: 0;
  flex-grow: 1;
}

.timeline-chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.timeline-item.expanded .timeline-chevron {
  transform: rotate(180deg);
  color: var(--accent-color);
}

/* Timeline Item Body (Accordion panel) */
.timeline-item-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0, 1, 0, 1); /* CSS transition hack for smooth height */
  margin-top: 0;
  opacity: 0;
}

.timeline-item.expanded .timeline-item-body {
  max-height: 1000px; /* Big enough for expand */
  transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  opacity: 1;
}

.timeline-details {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 10px 0;
}

.timeline-expand-img {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: 8px;
  margin-top: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Animations */
@keyframes pulse-live {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

@keyframes pulse-node {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

@keyframes slideInNewUpdate {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Light Theme tweaks */
body.light-theme .live-timeline-card {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(15, 23, 42, 0.06);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

body.light-theme .timeline-item {
  background: rgba(241, 245, 249, 0.5);
  border-color: rgba(15, 23, 42, 0.02);
}

body.light-theme .timeline-item:hover {
  background: rgba(241, 245, 249, 0.9);
}

body.light-theme .timeline-node {
  background-color: #ffffff;
  border-color: rgba(15, 23, 42, 0.1);
}

body.light-theme .timeline-title-text {
  color: #0f172a;
}

body.light-theme .timeline-item.expanded .timeline-item-body {
  border-top-color: rgba(15, 23, 42, 0.04);
}
