/* CampusPlug Loading Animations */

/* Pulse Loading Animation */
.loading-pulse {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-radius: 50%;
  border-top: 3px solid #22c55e;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Skeleton Loading Animation */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 4px;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Fade In Animation */
.fade-in {
  animation: fadeIn 0.6s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Bounce Loading Animation */
.loading-bounce {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: #22c55e;
  animation: bounce 1.4s ease-in-out infinite both;
}

.loading-bounce:nth-child(1) { animation-delay: -0.32s; }
.loading-bounce:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Shimmer Loading Effect */
.shimmer {
  background: linear-gradient(90deg, #f0f0f0 0%, #f8f8f8 50%, #f0f0f0 100%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Card Loading Animation */
.card-loading {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  animation: cardPulse 2s ease-in-out infinite;
}

@keyframes cardPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.02); opacity: 0.8; }
}

/* Table Row Loading */
.table-row-loading {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
}

.table-row-loading .skeleton {
  height: 16px;
  margin: 4px 8px;
}

/* Product Card Skeleton */
.product-skeleton {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.product-skeleton .image-skeleton {
  width: 100%;
  height: 200px;
  background: #f3f4f6;
}

.product-skeleton .content-skeleton {
  padding: 16px;
}

.product-skeleton .title-skeleton {
  height: 20px;
  width: 80%;
  margin-bottom: 8px;
}

.product-skeleton .price-skeleton {
  height: 16px;
  width: 60%;
  margin-bottom: 8px;
}

.product-skeleton .meta-skeleton {
  height: 12px;
  width: 40%;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}

.loading-overlay .loading-content {
  text-align: center;
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* Button Loading State */
.btn-loading {
  position: relative;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Page Transition Loading */
.page-loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.page-loading .logo {
  font-size: 2rem;
  color: white;
  font-weight: bold;
  animation: logoPulse 2s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Responsive Loading */
@media (max-width: 768px) {
  .loading-overlay .loading-content {
    padding: 20px;
    margin: 20px;
  }
  
  .page-loading .logo {
    font-size: 1.5rem;
  }
} 