/**
 * LAWO-Spotlight Frontend Styles
 * Responsive spotlight card navigation
 */

#lawo-spotlight-root {
  position: fixed;
  z-index: 9999;
}

/* Desktop: Right sidebar */
@media (min-width: 400px) {
  #lawo-spotlight-root {
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
  }
}

/* Mobile: Bottom navigation bar */
@media (max-width: 399px) {
  #lawo-spotlight-root {
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 8px;
    padding: 12px 8px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  }

  /* Add padding to body to prevent content overlap */
  body {
    padding-bottom: 80px;
  }
}

/* Spotlight card button */
.lawo-spotlight-card {
  position: relative;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: visible;
  padding: 0;
  outline: none;
}

.lawo-spotlight-card:hover,
.lawo-spotlight-card:focus {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.lawo-spotlight-card:active {
  transform: scale(0.95);
}

/* Icon container */
.lawo-spotlight-card__icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lawo-spotlight-card__icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.lawo-spotlight-card__icon svg {
  width: 100%;
  height: 100%;
}

/* Lottie animation container */
.lawo-spotlight-card__lottie {
  width: 32px;
  height: 32px;
}

/* Label tooltip */
.lawo-spotlight-card__label {
  position: absolute;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10000;
}

/* Desktop: Label appears to the left */
@media (min-width: 400px) {
  .lawo-spotlight-card__label {
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(8px);
  }

  .lawo-spotlight-card:hover .lawo-spotlight-card__label,
  .lawo-spotlight-card:focus .lawo-spotlight-card__label {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

/* Mobile: Label appears above */
@media (max-width: 399px) {
  .lawo-spotlight-card__label {
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
  }

  .lawo-spotlight-card:hover .lawo-spotlight-card__label,
  .lawo-spotlight-card:focus .lawo-spotlight-card__label {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* User info dropdown for auth cards */
.lawo-spotlight-user-info {
  position: absolute;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  padding: 16px;
  min-width: 200px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10001;
}

/* Desktop: User info appears to the left */
@media (min-width: 400px) {
  .lawo-spotlight-user-info {
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(8px);
  }

  .lawo-spotlight-card:hover .lawo-spotlight-user-info,
  .lawo-spotlight-card:focus .lawo-spotlight-user-info {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-50%) translateX(0);
  }
}

/* Mobile: User info appears above */
@media (max-width: 399px) {
  .lawo-spotlight-user-info {
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
  }

  .lawo-spotlight-card:hover .lawo-spotlight-user-info,
  .lawo-spotlight-card:focus .lawo-spotlight-user-info {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
  }
}

.lawo-spotlight-user-info__name {
  font-weight: 600;
  font-size: 14px;
  color: #1f2937;
  margin-bottom: 4px;
}

.lawo-spotlight-user-info__email {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 12px;
}

.lawo-spotlight-user-info__link {
  display: inline-block;
  font-size: 13px;
  color: #0EA5E9;
  text-decoration: none;
  transition: color 0.2s ease;
}

.lawo-spotlight-user-info__link:hover {
  color: #0284c7;
  text-decoration: underline;
}

/* Loading state */
.lawo-spotlight-card--loading {
  pointer-events: none;
  opacity: 0.6;
}

.lawo-spotlight-card__spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: lawo-spotlight-spin 0.8s linear infinite;
}

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

/* Accessibility improvements */
.lawo-spotlight-card:focus-visible {
  outline: 2px solid #0EA5E9;
  outline-offset: 2px;
}

/* Screen reader only text */
.lawo-spotlight-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
