/* ==========================================================================
   HV LinkedIn Feed Widget - Non-Intrusive Professional Activity Layout
   Curated for Harsh Verma's AI & Systems Engineering Portfolio
   ========================================================================== */

:root {
  --li-primary: #0a66c2;
  --li-primary-hover: #004182;
  --li-bg-light: #f3f6f8;
  --li-card-bg: #ffffff;
  --li-border: #e2e8f0;
  --li-text-main: #0f172a;
  --li-text-sub: #475569;
  --li-accent-soft: rgba(10, 102, 194, 0.08);
  --li-badge-soft: #e0f2fe;
}

/* Widget Main Container */
.hv-linkedin-widget {
  background: var(--li-card-bg);
  border: 1px solid var(--li-border);
  border-radius: 16px;
  box-shadow: 0 4px 20px -4px rgba(15, 23, 42, 0.06), 0 2px 6px -2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  margin-bottom: 2rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.hv-linkedin-widget:hover {
  box-shadow: 0 10px 28px -6px rgba(10, 102, 194, 0.12), 0 4px 10px -2px rgba(15, 23, 42, 0.05);
  border-color: rgba(10, 102, 194, 0.3);
}

/* Top Accent Bar */
.hv-li-accent-stripe {
  height: 4px;
  background: linear-gradient(90deg, #0a66c2 0%, #2563eb 50%, #38bdf8 100%);
  width: 100%;
}

/* Widget Header */
.hv-li-header {
  padding: 1.15rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--li-border);
  background: #ffffff;
  gap: 12px;
}

.hv-li-brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.hv-li-logo-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #0a66c2;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(10, 102, 194, 0.25);
  position: relative;
}

.hv-li-live-pulse {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 11px;
  height: 11px;
  background: #10b981;
  border: 2px solid #ffffff;
  border-radius: 50%;
  animation: hvPulseDot 2s infinite;
}

@keyframes hvPulseDot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.hv-li-title-box {
  min-width: 0;
}

.hv-li-main-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--li-text-main);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.25;
}

.hv-li-verified-badge {
  color: #0a66c2;
  font-size: 16px;
  line-height: 1;
}

.hv-li-sub-title {
  font-size: 0.8rem;
  color: var(--li-text-sub);
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hv-li-stat-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #94a3b8;
  display: inline-block;
}

/* Header Action Controls */
.hv-li-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.hv-li-btn-sync {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #475569;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hv-li-btn-sync:hover {
  background: var(--li-accent-soft);
  color: var(--li-primary);
  border-color: rgba(10, 102, 194, 0.4);
}

.hv-li-btn-sync.is-syncing i {
  animation: hvSpin 0.9s linear infinite;
}

@keyframes hvSpin {
  100% { transform: rotate(360deg); }
}

.hv-li-btn-follow {
  background: #0a66c2;
  color: #ffffff !important;
  border: 1px solid #0a66c2;
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none !important;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(10, 102, 194, 0.2);
}

.hv-li-btn-follow:hover {
  background: #004182;
  border-color: #004182;
  color: #ffffff;
  transform: translateY(-1px);
}

.hv-li-btn-toggle-view {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hv-li-btn-toggle-view:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Category Filter Bar */
.hv-li-filter-bar {
  display: flex;
  align-items: center;
  padding: 0.65rem 1.4rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--li-border);
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.hv-li-filter-bar::-webkit-scrollbar {
  height: 4px;
}

.hv-li-filter-bar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.hv-li-filter-pill {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.hv-li-filter-pill:hover {
  color: var(--li-primary);
  border-color: rgba(10, 102, 194, 0.35);
  background: #f0f7ff;
}

.hv-li-filter-pill.is-active {
  background: #0a66c2;
  color: #ffffff;
  border-color: #0a66c2;
  box-shadow: 0 2px 6px rgba(10, 102, 194, 0.25);
}

/* Non-Intrusive Collapsed State Ticker Bar */
.hv-li-collapsed-bar {
  display: none;
  padding: 0.85rem 1.4rem;
  background: #f8fafc;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.hv-li-collapsed-bar:hover {
  background: #f1f5f9;
}

.hv-li-collapsed-text {
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hv-li-collapsed-badge {
  background: #0a66c2;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 12px;
  text-transform: uppercase;
}

/* Activity Items Stream */
.hv-li-stream {
  padding: 1.2rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-height: 580px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.hv-li-stream::-webkit-scrollbar {
  width: 6px;
}

.hv-li-stream::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 6px;
}

/* Individual Activity Card */
.hv-li-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.1rem;
  transition: all 0.22s ease;
  position: relative;
}

.hv-li-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.hv-li-card-author-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 0.75rem;
}

.hv-li-author-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.hv-li-author-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #e2e8f0;
  flex-shrink: 0;
}

.hv-li-author-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--li-text-main);
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 4px;
}

.hv-li-author-subline {
  font-size: 0.73rem;
  color: #64748b;
  margin-top: 1px;
  line-height: 1.2;
}

.hv-li-category-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #0284c7;
  border: 1px solid #e0f2fe;
  white-space: nowrap;
}

/* Post Headline / Title */
.hv-li-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.45rem;
  line-height: 1.35;
}

/* Post Body Text */
.hv-li-card-body {
  font-size: 0.85rem;
  color: #334155;
  line-height: 1.55;
  margin-bottom: 0.75rem;
  word-break: break-word;
}

.hv-li-card-body.is-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hv-li-btn-expand-text {
  background: none;
  border: none;
  padding: 0;
  color: #0a66c2;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: -0.35rem;
  margin-bottom: 0.75rem;
  display: inline-block;
}

.hv-li-btn-expand-text:hover {
  text-decoration: underline;
}

/* Hashtag styling */
.hv-li-tag {
  color: #0a66c2;
  font-weight: 600;
  margin-right: 4px;
  display: inline-block;
}

/* Media Attachment Preview */
.hv-li-media-preview {
  margin-bottom: 0.85rem;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  max-height: 230px;
  background: #f8fafc;
}

.hv-li-media-img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.hv-li-media-preview:hover .hv-li-media-img {
  transform: scale(1.02);
}

/* Card Footer & Social Reactions */
.hv-li-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f5f9;
  gap: 8px;
}

.hv-li-reactions-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hv-li-reaction-btn {
  background: none;
  border: none;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.hv-li-reaction-btn:hover {
  color: #0a66c2;
  background: rgba(10, 102, 194, 0.06);
}

.hv-li-reaction-btn.has-liked {
  color: #e11d48;
}

.hv-li-reaction-btn.has-liked i {
  color: #e11d48;
}

.hv-li-btn-view-post {
  color: #0a66c2 !important;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none !important;
  transition: all 0.2s ease;
}

.hv-li-btn-view-post:hover {
  color: #004182 !important;
  transform: translateX(2px);
}

/* Compact Digest View Mode */
.hv-linkedin-widget.mode-compact .hv-li-stream {
  padding: 0.75rem 1.25rem;
  gap: 0.65rem;
}

.hv-linkedin-widget.mode-compact .hv-li-card {
  padding: 0.85rem;
  border-radius: 8px;
}

.hv-linkedin-widget.mode-compact .hv-li-media-preview {
  display: none;
}

.hv-linkedin-widget.mode-compact .hv-li-card-body.is-clamped {
  -webkit-line-clamp: 2;
}

/* Widget Footer Status */
.hv-li-footer {
  padding: 0.75rem 1.4rem;
  background: #f8fafc;
  border-top: 1px solid var(--li-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #64748b;
}

.hv-li-status-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hv-li-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
}

.hv-li-footer-link {
  color: #0a66c2;
  font-weight: 600;
  text-decoration: none;
}

.hv-li-footer-link:hover {
  text-decoration: underline;
}

/* Skeleton Loading State */
.hv-li-skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: hvShimmer 1.5s infinite;
  border-radius: 6px;
}

@keyframes hvShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==========================================================================
   Dark Mode Support
   ========================================================================== */
html.dark-mode .hv-linkedin-widget,
body.dark-mode .hv-linkedin-widget {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.4);
}

html.dark-mode .hv-li-header,
body.dark-mode .hv-li-header {
  background: #0f172a;
  border-color: #334155;
}

html.dark-mode .hv-li-main-title,
body.dark-mode .hv-li-main-title {
  color: #f8fafc;
}

html.dark-mode .hv-li-sub-title,
body.dark-mode .hv-li-sub-title {
  color: #94a3b8;
}

html.dark-mode .hv-li-btn-sync,
body.dark-mode .hv-li-btn-sync {
  background: #1e293b;
  border-color: #475569;
  color: #cbd5e1;
}

html.dark-mode .hv-li-btn-sync:hover,
body.dark-mode .hv-li-btn-sync:hover {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border-color: #38bdf8;
}

html.dark-mode .hv-li-btn-toggle-view,
body.dark-mode .hv-li-btn-toggle-view {
  background: #1e293b;
  border-color: #475569;
  color: #cbd5e1;
}

html.dark-mode .hv-li-filter-bar,
body.dark-mode .hv-li-filter-bar {
  background: #0f172a;
  border-color: #334155;
}

html.dark-mode .hv-li-filter-pill,
body.dark-mode .hv-li-filter-pill {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}

html.dark-mode .hv-li-filter-pill:hover,
body.dark-mode .hv-li-filter-pill:hover {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border-color: #0284c7;
}

html.dark-mode .hv-li-filter-pill.is-active,
body.dark-mode .hv-li-filter-pill.is-active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

html.dark-mode .hv-li-collapsed-bar,
body.dark-mode .hv-li-collapsed-bar {
  background: #0f172a;
  color: #f8fafc;
}

html.dark-mode .hv-li-collapsed-text,
body.dark-mode .hv-li-collapsed-text {
  color: #e2e8f0;
}

html.dark-mode .hv-li-card,
body.dark-mode .hv-li-card {
  background: #1e293b;
  border-color: #334155;
}

html.dark-mode .hv-li-card:hover,
body.dark-mode .hv-li-card:hover {
  border-color: #475569;
  box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.3);
}

html.dark-mode .hv-li-author-name,
body.dark-mode .hv-li-author-name {
  color: #f8fafc;
}

html.dark-mode .hv-li-author-subline,
body.dark-mode .hv-li-author-subline {
  color: #94a3b8;
}

html.dark-mode .hv-li-category-tag,
body.dark-mode .hv-li-category-tag {
  background: #0f172a;
  color: #38bdf8;
  border-color: #1e3a8a;
}

html.dark-mode .hv-li-card-title,
body.dark-mode .hv-li-card-title {
  color: #f1f5f9;
}

html.dark-mode .hv-li-card-body,
body.dark-mode .hv-li-card-body {
  color: #cbd5e1;
}

html.dark-mode .hv-li-media-preview,
body.dark-mode .hv-li-media-preview {
  border-color: #334155;
  background: #0f172a;
}

html.dark-mode .hv-li-card-footer,
body.dark-mode .hv-li-card-footer {
  border-color: #334155;
}

html.dark-mode .hv-li-reaction-btn,
body.dark-mode .hv-li-reaction-btn {
  color: #94a3b8;
}

html.dark-mode .hv-li-reaction-btn:hover,
body.dark-mode .hv-li-reaction-btn:hover {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
}

html.dark-mode .hv-li-footer,
body.dark-mode .hv-li-footer {
  background: #0f172a;
  border-color: #334155;
  color: #94a3b8;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .hv-li-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .hv-li-actions {
    width: 100%;
    justify-content: space-between;
    margin-top: 6px;
  }
  .hv-li-stream {
    padding: 1rem;
    max-height: 480px;
  }
  .hv-li-card {
    padding: 0.9rem;
  }
  .hv-li-media-img {
    height: 160px;
  }
}
