/* Trending Panel Responsive Behavior */

/* Full desktop and medium desktop - trending panel visible */
@media (min-width: 1000px) {
  .trending-panel {
    display: flex;
    position: fixed;
    top: 110px;
    right: 20px;
    width: 380px;
    height: calc(100vh - 130px);
    background: var(--card-bg);
    border: 1px solid rgba(102, 126, 234, 0.4);
    border-radius: 12px;
    padding: 14px;
    overflow: hidden;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.15);
    backdrop-filter: blur(10px);
    flex-direction: column;
  }
}

/* Small desktop and mobile - trending panel hidden, mobile button shown */
@media (max-width: 999px) {
  .trending-panel {
    display: none;
  }
  
  .mobile-trending-btn {
    display: flex;
  }
}

.trending-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--secondary-border-color);
}

.trending-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.trending-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.trending-period-selector {
  display: flex;
  gap: 2px;
  background: var(--hover-bg);
  border-radius: 6px;
  padding: 2px;
}

.period-btn {
  background: none;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 28px;
}

.period-btn:hover {
  color: var(--text-primary);
  background: rgba(80, 130, 255, 0.1);
}

.period-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.trending-content {
  flex: 1;
  min-height: 0;
}

/* Trending Sections */
.trending-section {
  margin-bottom: 12px;
}

.trending-section:last-child {
  margin-bottom: 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.section-title {
  font-size: 12px;
  font-weight: 600;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.section-title.bullish {
  color: #10b981;
}

.section-title.bearish {
  color: #ef4444;
}

.section-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 400;
}

/* Trending Items */
.trending-items {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.trending-item {
  background: var(--card-bg);
  border: 1px solid transparent;
  border-image: linear-gradient(135deg, #667eea 0%, #764ba2 100%) 1;
  border-radius: 6px;
  padding: 7px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.trending-item:hover {
  background: var(--hover-bg);
  border-color: var(--accent-color);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.trending-item.highlight {
  background: rgba(59, 130, 246, 0.1);
  border-color: var(--accent-color);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
  animation: highlightPulse 2s ease-in-out;
}

@keyframes highlightPulse {
  0%, 100% { 
    background: rgba(59, 130, 246, 0.1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
  }
  50% { 
    background: rgba(59, 130, 246, 0.2);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3);
  }
}

/* HLC flash animation for real-time updates - impactful flash */
.hlc-flash {
  animation: hlcFlashImpact 0.6s ease-out;
}

@keyframes hlcFlashImpact {
  0% {
    background-color: rgba(59, 130, 246, 0.8);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.8), 0 0 40px rgba(59, 130, 246, 0.4);
    color: #ffffff;
  }
  50% {
    background-color: rgba(59, 130, 246, 0.6);
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.6), 0 0 50px rgba(59, 130, 246, 0.3);
    color: #ffffff;
  }
  100% {
    background-color: transparent;
    box-shadow: none;
    color: inherit;
  }
}

.trending-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.token-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.token-symbol {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

.sentiment-badge {
  font-size: 9px;
  font-weight: 500;
  padding: 1px 4px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.sentiment-badge.bullish {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.sentiment-badge.bearish {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.sentiment-badge.neutral {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
}

.hlc-values {
  display: flex;
  gap: 5px;
  font-size: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.hlc-item {
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.hlc-high {
  color: #10b981;
}

.hlc-low {
  color: #ef4444;
}

.hlc-current {
  color: var(--text-primary);
}

/* Light theme adjustments for trending panel H/C/L elements */
html.light .hlc-item {
  color: var(--text-color);
}

html.light .hlc-high {
  color: #059669;
}

html.light .hlc-low {
  color: #dc2626;
}

html.light .hlc-current {
  color: var(--text-color);
}

.trending-item-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.company-name {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* Light theme adjustments for trending panel company names */
html.light .company-name {
  color: var(--text-color);
}

.short-title {
  font-size: 10px;
  color: var(--text-secondary);
  line-height: 1.2;
  opacity: 0.8;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.trending-time {
  font-size: 9px;
  color: var(--accent-color);
  opacity: 0.9;
  font-weight: 500;
  font-style: normal;
  white-space: nowrap;
  background: rgba(59, 130, 246, 0.1);
  padding: 1px 3px;
  border-radius: 2px;
  border: 1px solid rgba(59, 130, 246, 0.2);
  flex-shrink: 0;
}

/* Loading and Error States */
.trending-loading,
.trending-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 150px;
  padding: 18px;
}

.loading-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--secondary-border-color);
  border-top: 2px solid var(--accent-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 10px;
}

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

.error-icon {
  font-size: 28px;
  margin-bottom: 10px;
}

.trending-loading p,
.trending-error p {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.retry-btn {
  margin-top: 10px;
  padding: 7px 14px;
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.retry-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.no-trending-items {
  text-align: center;
  padding: 18px;
  color: var(--text-secondary);
  font-size: 12px;
  font-style: italic;
}

/* Mobile Trending Modal */
.mobile-trending-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: flex-end;
}

.mobile-trending-modal.show {
  display: flex !important;
}

.mobile-trending-content {
  width: 100%;
  max-height: 80vh;
  background: var(--card-bg);
  border-radius: 20px 20px 0 0;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.mobile-trending-modal.show .mobile-trending-content {
  transform: translateY(0);
}

.mobile-trending-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--secondary-border-color);
}

.mobile-trending-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.mobile-trending-controls {
  padding: 16px 20px;
  border-bottom: 1px solid var(--secondary-border-color);
  display: flex;
  justify-content: center;
}

.mobile-trending-controls .trending-period-selector {
  display: flex;
  gap: 2px;
  background: var(--hover-bg);
  border-radius: 8px;
  padding: 3px;
}

.mobile-trending-controls .period-btn {
  background: none;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 40px;
}

.mobile-trending-controls .period-btn:hover {
  color: var(--text-primary);
  background: rgba(80, 130, 255, 0.1);
}

.mobile-trending-controls .period-btn.active {
  background: rgba(80,130,255,.35);
  color: white;
  box-shadow: 0 2px 4px rgba(80, 130, 255, 0.3);
}

.close-mobile-trending {
  background: transparent;
  border: 1px solid var(--secondary-border-color);
  font-size: 1.4em;
  color: var(--text-color);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-mobile-trending:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #ef4444;
}

/* Light theme close button */
html.light .close-mobile-trending {
  border-color: rgba(0, 0, 0, 0.2);
  color: var(--text-color);
}

html.light .close-mobile-trending:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #ef4444;
}

.mobile-trending-body {
  padding: 20px;
  max-height: calc(80vh - 140px);
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

/* Mobile Button Responsive Behavior */

/* Hide mobile trending button when trending panel is visible */
@media (min-width: 1000px) {
  .mobile-trending-btn {
    display: none;
  }
}

/* Show mobile trending button when trending panel is hidden */
@media (max-width: 999px) {
  .mobile-trending-btn {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px 14px;
    background: var(--card-bg);
    border: 1px solid var(--secondary-border-color);
    border-left: 0.5px solid var(--secondary-border-color);
    border-radius: 0;
    color: var(--text-color);
    font-size: 0.8em;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    height: 42px;
    min-height: 42px;
    position: relative;
    z-index: 1000;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
  }
}

[data-theme="dark"] .mobile-trending-btn {
  border-left: 0.5px solid rgba(255, 255, 255, 0.08);
}

/* Responsive Design - Updated for gradual collapse */
@media (max-width: 999px) {
  .trending-panel {
    display: none;
  }
  
  .mobile-trending-btn {
    display: flex;
    background: var(--card-bg);
    border: 1px solid var(--secondary-border-color);
    border-left: 0.5px solid var(--secondary-border-color);
  }
}

@media (min-width: 1000px) {
  .mobile-trending-modal {
    display: none !important;
  }
  
  .mobile-trending-btn {
    display: none;
  }
}

/* Dark theme adjustments */
[data-theme="dark"] .mobile-trending-btn {
  border-left: 0.5px solid rgba(255, 255, 255, 0.08);
}



/* Scrollbar styling - Less visible */
.trending-panel .trending-content::-webkit-scrollbar,
.mobile-trending-body::-webkit-scrollbar {
  width: 3px;
}

.trending-panel .trending-content::-webkit-scrollbar-track,
.mobile-trending-body::-webkit-scrollbar-track {
  background: transparent;
}

.trending-panel .trending-content::-webkit-scrollbar-thumb,
.mobile-trending-body::-webkit-scrollbar-thumb {
  background: rgba(107, 114, 128, 0.3);
  border-radius: 2px;
  transition: background 0.2s ease;
}

.trending-panel .trending-content::-webkit-scrollbar-thumb:hover,
.mobile-trending-body::-webkit-scrollbar-thumb:hover {
  background: rgba(107, 114, 128, 0.5);
}

/* Dark theme scrollbar */
[data-theme="dark"] .trending-panel .trending-content::-webkit-scrollbar-thumb,
[data-theme="dark"] .mobile-trending-body::-webkit-scrollbar-thumb {
  background: rgba(156, 163, 175, 0.3);
}

[data-theme="dark"] .trending-panel .trending-content::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] .mobile-trending-body::-webkit-scrollbar-thumb:hover {
  background: rgba(156, 163, 175, 0.5);
}

/* Dark theme trending time */
[data-theme="dark"] .trending-time {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.15);
  border-color: rgba(96, 165, 250, 0.25);
}

/* Enhanced notification animations and styles */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

@keyframes slideInBounce {
  0% {
    transform: translateX(100%) scale(0.8);
    opacity: 0;
  }
  60% {
    transform: translateX(-10px) scale(1.05);
    opacity: 0.8;
  }
  100% {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

@keyframes slideOutBounce {
  0% {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
  40% {
    transform: translateX(-10px) scale(0.95);
    opacity: 0.8;
  }
  100% {
    transform: translateX(100%) scale(0.8);
    opacity: 0;
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes progressBar {
  0% {
    width: 0%;
  }
  100% {
    width: 100%;
  }
}

/* Enhanced notification styles */
.trending-notification {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 500;
  letter-spacing: 0.025em;
  line-height: 1.4;
  overflow: hidden;
  position: relative;
  transition: top 0.3s cubic-bezier(0.4, 0, 0.2, 1), z-index 0.3s ease;
}

.notification-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  position: relative;
}

.notification-icon {
  font-size: 1.2em;
  flex-shrink: 0;
  animation: pulse 2s infinite;
}

.notification-message {
  flex: 1;
  font-weight: 500;
}

.notification-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.4em;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.notification-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  transform: scale(1.1);
}

/* Loading notification specific styles */
.loading-content {
  flex-direction: column;
  gap: 8px;
  padding: 16px 20px 20px;
}

.loading-spinner-enhanced {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 4px;
}

.loading-progress {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}

.loading-progress::after {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  animation: progressBar 2s infinite;
}

/* Navigation notification specific styles */
.navigation-content {
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  position: relative;
}

.navigation-icon {
  font-size: 1.3em;
  animation: pulse 1.5s infinite;
}

.navigation-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.navigation-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.navigation-progress::after {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
  animation: progressBar 3s infinite;
}

/* Enhanced notification animations */
@keyframes slideInBounce {
  0% {
    transform: translateX(100%) scale(0.8);
    opacity: 0;
  }
  60% {
    transform: translateX(-10px) scale(1.05);
    opacity: 0.8;
  }
  100% {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

@keyframes slideOutBounce {
  0% {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
  40% {
    transform: translateX(-10px) scale(0.95);
    opacity: 0.8;
  }
  100% {
    transform: translateX(100%) scale(0.8);
    opacity: 0;
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes progressBar {
  0% {
    width: 0%;
  }
  100% {
    width: 100%;
  }
}

/* Enhanced notification styles */
.trending-notification {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 500;
  letter-spacing: 0.025em;
  line-height: 1.4;
  overflow: hidden;
  position: relative;
  transition: top 0.3s cubic-bezier(0.4, 0, 0.2, 1), z-index 0.3s ease;
}

.notification-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  position: relative;
}

.notification-icon {
  font-size: 1.2em;
  flex-shrink: 0;
  animation: pulse 2s infinite;
}

.notification-message {
  flex: 1;
  font-weight: 500;
}

.notification-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.4em;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.notification-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  transform: scale(1.1);
}

/* Loading notification specific styles */
.loading-content {
  flex-direction: column;
  gap: 8px;
  padding: 16px 20px 20px;
}

.loading-spinner-enhanced {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 4px;
}

.loading-progress {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}

.loading-progress::after {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  animation: progressBar 2s infinite;
}

/* Navigation notification specific styles */
.navigation-content {
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  position: relative;
}

.navigation-icon {
  font-size: 1.3em;
  animation: pulse 1.5s infinite;
}

.navigation-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.navigation-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.navigation-progress::after {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
  animation: progressBar 3s infinite;
}

/* Filter Mode Indicator Styles */
.filter-mode-indicator {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  padding: 8px 12px;
  margin: 0 -14px 12px -14px;
  border-radius: 0;
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  border-bottom: 1px solid rgba(217, 119, 6, 0.3);
  animation: slideInFromTop 0.3s ease-out;
}

.filter-mode-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.filter-mode-icon {
  font-size: 12px;
  animation: pulse 2s infinite;
}

.filter-mode-text {
  font-weight: 500;
  letter-spacing: 0.025em;
}

@keyframes slideInFromTop {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Filter Mode Disabled State for Trending Items */
.trending-item.filter-mode-disabled {
  cursor: not-allowed !important;
  opacity: 0.6 !important;
  pointer-events: none;
  position: relative;
}

.trending-item.filter-mode-disabled::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  pointer-events: none;
}

.trending-item.filter-mode-disabled:hover {
  transform: none !important;
  box-shadow: none !important;
  background: var(--card-bg) !important;
  border-color: var(--secondary-border-color) !important;
}

/* Dark theme adjustments for filter mode indicator */
[data-theme="dark"] .filter-mode-indicator {
  background: linear-gradient(135deg, #d97706, #b45309);
  border-bottom-color: rgba(185, 83, 9, 0.3);
}

/* Mobile filter mode indicator */
@media (max-width: 999px) {
  .mobile-trending-body .filter-mode-indicator {
    margin: -20px -20px 12px -20px;
    border-radius: 0;
  }
}

/* Light mode spinner fixes */
html.light .loading-spinner-enhanced {
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top: 2px solid #333333;
}

html.light .trending-loading-spinner {
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top: 2px solid #333333;
}

/* Trending Card Loading Indicator */
.trending-card-loading {
  padding: 20px;
  margin: 10px 0;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-in;
}

.trending-card-loading-fullscreen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  padding: 60px 20px;
  animation: fadeIn 0.3s ease-in;
}

.trending-card-loading .loading-content,
.trending-card-loading-fullscreen .loading-content {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-primary);
}

.trending-card-loading-fullscreen .loading-content {
  flex-direction: column;
  text-align: center;
}

.loading-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.loading-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.loading-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

.trending-card-loading .loading-spinner,
.trending-card-loading-fullscreen .loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(102, 126, 234, 0.2);
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Trending Card View Header - Modern Theme */
.trending-card-view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  margin-bottom: 24px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(118, 75, 162, 0.12) 100%);
  border: 1px solid rgba(102, 126, 234, 0.35);
  border-radius: 16px;
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.1);
}

html.light .trending-card-view-header {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
  border-color: rgba(102, 126, 234, 0.25);
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.08);
}

.trending-card-wrapper {
  width: 100%;
}

.trending-card-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.trending-card-notice svg {
  color: #667eea;
  animation: pulse 2s ease-in-out infinite;
  filter: drop-shadow(0 2px 4px rgba(102, 126, 234, 0.3));
}

.back-to-feed-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  letter-spacing: -0.01em;
}

.back-to-feed-btn:hover {
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.back-to-feed-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.back-to-feed-btn svg {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  stroke-width: 2.5;
}

.back-to-feed-btn:hover svg {
  transform: translateX(-3px);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .trending-card-view-header {
    flex-direction: column;
    gap: 14px;
    padding: 18px 20px;
    margin-bottom: 20px;
  }
  
  .trending-card-notice {
    font-size: 15px;
  }
  
  .back-to-feed-btn {
    width: 100%;
    justify-content: center;
    padding: 12px 18px;
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

/* Highlight animation for news cards */
.news-card.highlight {
  animation: highlightPulse 2s ease-in-out;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
}

@keyframes highlightPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.5);
  }
}

/* Trending Card Error State */
.trending-card-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  padding: 60px 20px;
  text-align: center;
  animation: fadeIn 0.3s ease-in;
}

.trending-card-error .error-icon {
  font-size: 48px;
  margin-bottom: 20px;
  opacity: 0.7;
}

.trending-card-error .error-content h3 {
  margin: 0 0 10px 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.trending-card-error .error-content p {
  margin: 0 0 24px 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.error-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.retry-btn {
  padding: 10px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.retry-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}
