/**
 * Utility Classes
 * High-priority utility classes and overrides
 */

/* Text utilities */
.text-center {
  text-align: center;
}

/* Image loading states */
img[data-src] {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

img.loaded {
  opacity: 1;
}

img.error {
  opacity: 0.5;
  filter: grayscale(100%);
}

img[data-src]::before {
  content: '';
  display: block;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Layout utilities */
.back-button-container {
  text-align: center;
  margin-top: 30px;
  margin-bottom: 40px;
}

/* Status indicators */
.offline-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: #b71c1c;
  color: white;
  text-align: center;
  padding: 8px;
  z-index: 1000;
  transform: translateY(-100%);
  transition: transform 0.3s ease-out;
  font-weight: 500;
}

.offline-indicator.visible {
  transform: translateY(0);
}

.sw-update-notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #3498db;
  color: white;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgb(0 0 0 / 20%);
  z-index: 1000;
  transform: translateY(150%);
  transition: transform 0.3s ease-out;
}

.sw-update-notification.visible {
  transform: translateY(0);
}

.sw-update-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sw-update-button {
  background-color: white;
  color: #3498db;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 15px;
  font-weight: 700;
}

.sw-update-button:hover {
  background-color: #f5f5f5;
}

.online-toast {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background-color: #2ecc71;
  color: white;
  padding: 10px 15px;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgb(0 0 0 / 20%);
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.5s;
}

.online-toast.fade-out {
  opacity: 0;
}

/* Container query utilities */
@container (min-width: 320px) {
  .container-sm-up {
    display: block;
  }
}

@container (min-width: 768px) {
  .container-md-up {
    display: block;
  }
}

@container (min-width: 1024px) {
  .container-lg-up {
    display: block;
  }
}

/* Responsive text utilities using container queries */
@container (min-width: 320px) {
  .text-responsive {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
  }
}