/* Changelog Widget Styles */
.changelog-widget {
  position: fixed;
  bottom: 150px;
  right: 20px;
  display: flex;
  flex-direction: column;
  background: rgba(15, 32, 39, 0.7);
  backdrop-filter: blur(8px);
  border-radius: 50%;
  border: 1px solid rgba(70, 252, 241, 0.3);
  padding: 0;
  box-shadow: 0 0 15px rgba(70, 252, 241, 0.15);
  transition: all 0.3s ease;
  width: 50px;
  height: 50px;
  z-index: 100;
  cursor: pointer;
  overflow: hidden;
}

.changelog-widget:hover,
.changelog-widget:focus {
  border-color: rgba(70, 252, 241, 0.6);
  box-shadow: 0 0 20px rgba(70, 252, 241, 0.25);
  border-radius: 12px;
  width: 280px;
  height: auto;
  max-height: 450px;
  padding: 12px;
}

.changelog-circle-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(70, 252, 241, 0.9);
  opacity: 0;
  transition: all 0.3s ease;
}

.changelog-circle-icon svg {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 0 3px rgba(70, 252, 241, 0.7));
}

.changelog-count-circle {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
  transform: none;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
  text-align: center;

  /* Consistent text rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* Prevent text selection */
  user-select: none;

  /* Prevent subpixel rendering issues */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;

  /* Transition only opacity, not position or dimensions */
  transition: opacity 0.2s ease;

  /* Glow effect */
  text-shadow: 0 0 8px rgba(70, 252, 241, 0.7);

  /* Ensure the number stays above background but below hover content */
  z-index: 2;

  /* Add a slight offset to adjust for optical centering if needed */
  /* padding-bottom: 1px; */
}

.changelog-widget:hover .changelog-count-circle,
.changelog-widget:focus .changelog-count-circle {
  opacity: 0;
}

.changelog-expanded {
  opacity: 0;
  height: 0;
  width: 100%;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.changelog-widget:hover .changelog-expanded,
.changelog-widget:focus .changelog-expanded {
  opacity: 1;
  height: auto;
}

.changelog-header {
  margin-bottom: 10px;
}

.changelog-title {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 0 8px rgba(70, 252, 241, 0.4);
}

.changelog-subtitle {
  font-size: 12px;
  color: #a9c7fe;
  opacity: 0.8;
}

.changelog-list {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  max-height: 350px;
}

.changelog-list::-webkit-scrollbar {
  display: none;
}

.changelog-list li {
  padding: 8px 0;
  border-bottom: 1px solid rgba(70, 252, 241, 0.1);
  font-size: 13px;
  color: #e0e0ff;
  transition: all 0.2s ease;
}

.changelog-list li:last-child {
  border-bottom: none;
}

.changelog-list li:hover {
  background: rgba(70, 252, 241, 0.05);
}

.changelog-placeholder {
  color: #a9c7fe;
  font-style: italic;
  opacity: 0.7;
  text-align: center;
  padding: 10px 0;
}

.update-header {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}

.update-icon {
  margin-right: 8px;
  opacity: 0.8;
  width: 16px;
  min-width: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.update-title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-grow: 1;
}

.update-tag {
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}

.update-tag-feature {
  background: rgba(70, 207, 252, 0.2);
  color: #70e5ff;
}

.update-tag-fix {
  background: rgba(241, 196, 15, 0.2);
  color: #f1c40f;
}

.update-tag-improvement {
  background: rgba(46, 204, 113, 0.2);
  color: #2ecc71;
}

.update-tag-security {
  background: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
}

.update-description {
  font-size: 12px;
  opacity: 0.85;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.update-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 11px;
  opacity: 0.6;
}

.update-version {
  font-family: monospace;
}

.update-date {
  white-space: nowrap;
}

/* Reveal animation for new update */
@keyframes revealUpdate {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.update-new {
  animation: revealUpdate 0.5s ease forwards;
}

/* Pulse animation when count updates */
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.pulse {
  animation: pulse 0.5s ease-in-out;
}

/* New update indicator */
.new-badge {
  display: inline-block;
  background: rgba(231, 76, 60, 0.3);
  color: #ff8a80;
  border-radius: 4px;
  padding: 1px 4px;
  font-size: 9px;
  font-weight: 700;
  margin-left: 6px;
  animation: pulseNew 2s infinite;
}

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

/* Touch device specific styles */
.changelog-widget.touch-device.expanded {
  border-radius: 12px;
  width: 280px;
  height: auto;
  max-height: 450px;
  padding: 12px;
}

.changelog-widget.touch-device.expanded .changelog-count-circle {
  opacity: 0;
}

.changelog-widget.touch-device.expanded .changelog-expanded {
  opacity: 1;
  height: auto;
}

/* Keyboard focus styles */
.changelog-widget.keyboard-focus {
  border-radius: 12px;
  width: 280px;
  height: auto;
  max-height: 450px;
  padding: 12px;
}

.changelog-widget.keyboard-focus .changelog-count-circle {
  opacity: 0;
}

.changelog-widget.keyboard-focus .changelog-expanded {
  opacity: 1;
  height: auto;
}

/* Type-specific icons */
.icon-feature svg path {
  fill: #70e5ff;
}

.icon-fix svg path {
  fill: #f1c40f;
}

.icon-improvement svg path {
  fill: #2ecc71;
}

.icon-security svg path {
  fill: #e74c3c;
}

@media screen and (max-width: 480px) {
  .changelog-widget {
    bottom: 135px;
    right: 15px;
    width: 45px;
    height: 45px;
  }

  .changelog-widget:hover,
  .changelog-widget:focus,
  .changelog-widget.touch-device.expanded,
  .changelog-widget.keyboard-focus {
    width: 250px;
  }
}
