/* ==========================================================================
   Aikido Directory Theme - Placeholder & Loading Styles
   Professional SVG-based placeholder system
   ========================================================================== */

/* ==========================================================================
   Image Placeholders
   ========================================================================== */

/* Default placeholder for listing images */
.placeholder-image {
  background: url('../images/placeholder-dojo.svg') center/cover;
  background-color: var(--background);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.placeholder-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255,255,255,0.1) 50%,
    transparent 70%
  );
  animation: placeholder-shimmer 2s infinite;
}

/* Avatar placeholders */
.avatar-placeholder {
  background: url('../images/avatar-placeholder.svg') center/cover;
  background-color: var(--primary);
  border-radius: var(--radius-full);
  position: relative;
  overflow: hidden;
}

/* Instructor avatar specific styling */
.instructor-avatar.placeholder {
  background: url('../images/avatar-placeholder.svg') center/cover;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
}

/* Reviewer avatar for Google Reviews */
.reviewer-avatar.placeholder {
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: var(--font-size-sm);
}

/* ==========================================================================
   Loading States
   ========================================================================== */

/* Enhanced loading spinner using our custom SVG */
.loading-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  background: url('../images/loading-spinner.svg') center/contain no-repeat;
}

.loading-spinner.large {
  width: 48px;
  height: 48px;
}

.loading-spinner.small {
  width: 16px;
  height: 16px;
}

/* Loading overlay for sections */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: inherit;
}

.loading-overlay .loading-spinner {
  width: 32px;
  height: 32px;
}

/* Card loading state */
.directory-card.loading {
  position: relative;
  pointer-events: none;
}

.directory-card.loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(1px);
  border-radius: inherit;
  z-index: 1;
}

.directory-card.loading .card-image {
  background: var(--background);
  animation: placeholder-pulse 1.5s ease-in-out infinite;
}

/* Skeleton loading for text content */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--border-light) 25%,
    var(--background) 50%,
    var(--border-light) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius);
}

.skeleton-text {
  height: 1em;
  margin: 0.5em 0;
}

.skeleton-text.title {
  height: 1.5em;
  width: 70%;
}

.skeleton-text.description {
  height: 1em;
  width: 90%;
}

.skeleton-text.short {
  width: 60%;
}

/* ==========================================================================
   No Results State
   ========================================================================== */

.no-results-container {
  text-align: center;
  padding: var(--space-12) var(--space-4);
  max-width: 400px;
  margin: 0 auto;
}

.no-results-illustration {
  width: 200px;
  height: 200px;
  margin: 0 auto var(--space-6);
  background: url('../images/no-results.svg') center/contain no-repeat;
  opacity: 0.8;
}

.no-results-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-3);
}

.no-results-message {
  color: var(--text-muted);
  margin-bottom: var(--space-6);
  line-height: var(--line-height-relaxed);
}

.no-results-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
  margin-top: var(--space-6);
}

.suggestion-chip {
  padding: var(--space-2) var(--space-3);
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  color: var(--text-light);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.suggestion-chip:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  transform: translateY(-1px);
  text-decoration: none;
}

/* ==========================================================================
   Icon System Integration
   ========================================================================== */

/* SVG icon base styles */
.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  fill: currentColor;
  stroke: currentColor;
  vertical-align: middle;
}

.icon.sm {
  width: 0.875rem;
  height: 0.875rem;
}

.icon.lg {
  width: 1.25rem;
  height: 1.25rem;
}

.icon.xl {
  width: 1.5rem;
  height: 1.5rem;
}

/* Icon usage for contact items */
.contact-icon::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.contact-icon.phone::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E");
}

.contact-icon.email::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z'/%3E%3Cpolyline points='22,6 12,13 2,6'/%3E%3C/svg%3E");
}

.contact-icon.website::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='2' y1='12' x2='22' y2='12'/%3E%3Cpath d='M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z'/%3E%3C/svg%3E");
}

.contact-icon.address::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
}

/* ==========================================================================
   Empty State Animations
   ========================================================================== */

/* Subtle floating animation for no-results illustration */
.no-results-illustration {
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Placeholder shimmer effect */
@keyframes placeholder-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Skeleton loading animation */
@keyframes skeleton-loading {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Pulse animation for loading states */
@keyframes placeholder-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* ==========================================================================
   Error States
   ========================================================================== */

.error-state {
  text-align: center;
  padding: var(--space-8);
  color: var(--text-muted);
}

.error-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-4);
  opacity: 0.5;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E74C3C' stroke-width='2'%3E%3Cpath d='M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E") center/contain no-repeat;
}

.error-message {
  font-weight: 500;
  margin-bottom: var(--space-2);
  color: var(--text);
}

.error-description {
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-4);
}

.error-retry {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.error-retry:hover {
  background: var(--secondary);
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 640px) {
  .no-results-illustration {
    width: 150px;
    height: 150px;
  }
  
  .no-results-container {
    padding: var(--space-8) var(--space-4);
  }
  
  .suggestion-chip {
    font-size: var(--font-size-xs);
    padding: var(--space-1) var(--space-2);
  }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
  .loading-overlay,
  .loading-spinner,
  .skeleton {
    display: none !important;
  }
  
  .placeholder-image::before {
    display: none;
  }
} 