/**
 * PulseVerify Frontend Styles - Streamlined version without overlay
 * Enhanced CSS isolation for close button and apply link
 */

/* Modal container with positioning (combines previous overlay and container styles) */
.pulseverify-modal-container {
  position: fixed;
  bottom: 12px;
  left: 12px;
  background: white;
  border-radius: 12px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease-out, visibility 0.2s ease-out;
  transform: translateY(calc(100% + 20px));
  opacity: 1;
  visibility: visible;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Reset only within our container */
.pulseverify-modal-container * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.pulseverify-modal-container.visible {
  transform: translateY(0);
}

.pulseverify-modal-container.hidden {
  opacity: 0;
  visibility: hidden;
}

.pulseverify-modal-content {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px;
  gap: 12px;
}

.pulseverify-user-info {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
}

.pulseverify-profile-image-container {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.pulseverify-profile-image-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #E8E8E8;
  background-size: cover;
  background-position: center;
}

.pulseverify-verified-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
}

.pulseverify-content-wrapper {
  flex: 1;
  min-width: 0;
}

.pulseverify-user-name-wrapper {
  font-size: 14px;
  line-height: 1.4;
  color: #1a1a1a;
  margin-bottom: 2px;
}

.pulseverify-name {
  font-weight: 600;
}

.pulseverify-publication {
  font-weight: 500;
}

.pulseverify-time-info {
  font-size: 13px;
  color: #737373;
  display: flex;
  align-items: center;
  gap: 4px;
}

.pulseverify-separator {
  color: #737373;
}

/* Enhanced isolation for Apply Here link */
.pulseverify-apply-link,
.pulseverify-modal-container .pulseverify-apply-link {
  color: #0095F6 !important;
  text-decoration: none !important;
  font-weight: 500 !important;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 13px !important;
  line-height: normal !important;
  display: inline-block !important;
}

.pulseverify-apply-link:hover,
.pulseverify-apply-link:focus,
.pulseverify-apply-link:active,
.pulseverify-modal-container .pulseverify-apply-link:hover,
.pulseverify-modal-container .pulseverify-apply-link:focus,
.pulseverify-modal-container .pulseverify-apply-link:active {
  text-decoration: underline !important;
  color: #0095F6 !important;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Enhanced isolation for close button */
.pulseverify-close-button,
.pulseverify-modal-container .pulseverify-close-button {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  cursor: pointer !important;
  padding: 4px !important;
  color: #737373 !important;
  line-height: 0 !important;
  margin: -4px -4px 0 0 !important;
  width: auto !important;
  height: auto !important;
  min-width: auto !important;
  min-height: auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.pulseverify-close-button:hover,
.pulseverify-close-button:focus,
.pulseverify-close-button:active,
.pulseverify-modal-container .pulseverify-close-button:hover,
.pulseverify-modal-container .pulseverify-close-button:focus,
.pulseverify-modal-container .pulseverify-close-button:active {
  color: #1a1a1a !important;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.pulseverify-close-button svg {
  width: 16px !important;
  height: 16px !important;
  display: block !important;
  fill: none !important;
}

.pulseverify-close-button path {
  stroke: currentColor !important;
  stroke-width: 2 !important;
}

/* Only apply dark mode when setting is enabled */
.pulseverify-dark-mode.pulseverify-modal-container {
  background: #1a1a1a;
}

.pulseverify-dark-mode .pulseverify-user-name-wrapper {
  color: #ffffff;
}

.pulseverify-dark-mode .pulseverify-time-info,
.pulseverify-dark-mode .pulseverify-separator {
  color: #a0a0a0;
}

.pulseverify-dark-mode .pulseverify-close-button {
  color: #a0a0a0 !important;
}

.pulseverify-dark-mode .pulseverify-close-button:hover {
  color: #ffffff !important;
}

.pulseverify-dark-mode .pulseverify-profile-image-placeholder {
  background-color: #2a2a2a;
}

@media (max-width: 480px) {
  .pulseverify-modal-container {
    bottom: 8px;
    left: 8px;
    right: 8px;
    width: auto;
    max-width: none;
    border-radius: 10px;
  }
  
  .pulseverify-modal-content {
    padding: 10px;
  }
  
  /* Prevent wrapping on mobile */
  .pulseverify-time-info {
    flex-wrap: nowrap;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}