/**
 * Styles for the git user info display component.
 */

/* Main container for user info display */
.git-lock-sign-user-info-widget {
  display: flex;
  align-items: center;
  padding: 4px 8px;
  margin: 0 8px 0 4px;
  background-color: var(--jp-layout-color2);
  border: 1px solid var(--jp-border-color1);
  border-radius: 3px;
  font-size: var(--jp-ui-font-size1);
  min-height: 24px;
  min-width: 200px;
}

.git-user-info-display {
  display: flex;
  align-items: center;
  width: 100%;
}

.git-user-info-content {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

/* Icon styling */
.git-user-info-content .jp-Icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Text styling */
.git-user-text {
  font-size: var(--jp-ui-font-size1);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.git-user-text strong {
  font-weight: 600;
}

/* Refresh button styling */
.git-user-refresh-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  margin-left: 8px;
  border: 1px solid var(--jp-border-color1);
  border-radius: 3px;
  background: var(--jp-layout-color1);
  color: var(--jp-ui-font-color1);
  font-size: var(--jp-ui-font-size1);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.git-user-refresh-btn:hover {
  background: var(--jp-layout-color2);
  border-color: var(--jp-border-color2);
}

.git-user-refresh-btn:active {
  background: var(--jp-layout-color3);
}

.git-user-refresh-btn .jp-Icon {
  width: 16px;
  height: 16px;
}

.git-user-refresh-btn .refresh-text {
  font-weight: 500;
}

/* State-specific styling */
.git-user-info-content.loading {
  color: var(--jp-ui-font-color2);
}

.git-user-info-content.loading .jp-CircularProgressIcon {
  animation: jp-spinner 1s linear infinite;
}

.git-user-info-content.error {
  color: var(--jp-error-color1);
}

.git-user-info-content.error .jp-ErrorIcon {
  color: var(--jp-error-color1);
}

.git-user-info-content.success {
  color: var(--jp-ui-font-color1);
}

.git-user-info-content.success .jp-UserIcon {
  color: var(--jp-brand-color1);
}

/* Responsive behavior */
@media (max-width: 768px) {
  .git-lock-sign-user-info-widget {
    max-width: 200px;
  }
  
  .git-user-text {
    font-size: var(--jp-ui-font-size0);
  }
}

/* Dark theme adjustments */
[data-jp-theme-light="false"] .git-lock-sign-user-info-widget {
  background-color: var(--jp-layout-color1);
  border-color: var(--jp-border-color2);
}

[data-jp-theme-light="false"] .git-user-refresh-btn:hover {
  background-color: var(--jp-layout-color2);
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .git-lock-sign-user-info-widget {
    border-width: 2px;
  }
  
  .git-user-info-content.error {
    font-weight: 600;
  }
  
  .git-user-info-content.success .jp-UserIcon {
    filter: contrast(1.5);
  }
}

/* Animation for spinner */
@keyframes jp-spinner {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Tooltip styling for truncated text */
.git-user-text[title] {
  cursor: help;
}

/* Focus styling for accessibility */
.git-user-refresh-btn:focus {
  outline: 2px solid var(--jp-brand-color1);
  outline-offset: 1px;
}

/* Compact mode for smaller screens */
.git-lock-sign-user-info-widget.compact {
  padding: 2px 6px;
  margin: 0 2px;
}

.git-lock-sign-user-info-widget.compact .git-user-text {
  font-size: var(--jp-ui-font-size0);
}

.git-lock-sign-user-info-widget.compact .jp-Icon {
  width: 14px;
  height: 14px;
}
