/**
 * Component-specific styles
 * Additional styles for the modular component system
 */

/* Remove component-specific imports to avoid conflicts with main CSS */
/* @import url("./components/header.css"); */

/* Component Container Styles */
.component-loading {
  opacity: 0.5;
  pointer-events: none;
}

.component-loaded {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.3s ease-in-out;
}

/* Loading States */
.loading-placeholder {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 4px;
  height: 20px;
  margin: 10px 0;
}

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

/* Component Error States */
.component-error {
  padding: 20px;
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
  margin: 10px 0;
}

.component-error::before {
  content: "⚠️ ";
  font-weight: bold;
}

/* Form Error Styles for Contact Component */
.field-error {
  color: #dc3545;
  font-size: 0.875em;
  margin-top: 0.25rem;
  display: block;
}

.form-control.error {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Responsive Component Adjustments */
@media (max-width: 768px) {
  .component-container {
    padding: 10px;
  }
}

/* Smooth transitions for component loading */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header specific adjustments for modular system */
#header-container {
  position: relative;
  z-index: 1000;
}

/* Ensure proper spacing between components */
.main > div:not(:last-child) {
  margin-bottom: 0;
}

/* Fix for potential layout shifts during component loading */
.main {
  min-height: 100vh;
}

/* Component loading overlay */
.component-overlay {
  position: relative;
}

.component-overlay::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  z-index: 10;
  display: none;
}

.component-overlay.loading::before {
  display: block;
}

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

/* Print styles */
@media print {
  .component-loading,
  .loading-placeholder,
  .component-error {
    display: none;
  }
}
