/* ===================================================================
   Form Skeleton Loader Styles
   =================================================================== */

/* Shimmer Animation */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* Base Skeleton Element */
.swvt-skeleton-element {
  position: relative;
  background-color: #e0e0e0;
  overflow: hidden;
  border-radius: 4px;
}

.swvt-skeleton-element::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  background-size: 1000px 100%;
  animation: shimmer 1.5s infinite;
}

/* Shared Base Skeleton Card Class - Applied to BOTH skeletons */
/* Top skeleton is reference - Bottom skeleton must match exactly */
.swvt-skeleton-card {
  width: 100%;
  max-width: 293px;
  min-width: 293px; /* desktop */
  box-sizing: border-box;
  background: #ffffff;
  border-radius: 2px !important;
  border: 1px solid #ddd;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  margin-left: auto;
  margin-right: auto;
  /* Prevent parent containers from stretching the skeleton width */
  flex-shrink: 0;
  flex-grow: 0;
}

/* Top Skeleton - Reference size (unchanged) */
.swvt-warsha-skeleton {
  width: 100%;
  max-width: 293px;
  min-width: 293px;
  box-sizing: border-box;
  background: #ffffff;
  border-radius: 2px !important;
  border: 1px solid #ddd;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  margin-left: auto;
  margin-right: auto;
  flex-shrink: 0;
  flex-grow: 0;
}

/* Bottom Skeleton - Must match top exactly */
.swvt-form-skeleton {
  width: 100%;
  max-width: 293px;
  min-width: 293px;
  box-sizing: border-box;
  background: #ffffff;
  border-radius: 2px !important;
  border: 1px solid #ddd;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  margin-left: auto;
  margin-right: auto;
  /* Prevent auto expansion based on content */
  flex-shrink: 0;
  flex-grow: 0;
  /* Remove any rules that allow width: 100vw, flex: 1, grid-column: span */
  grid-column: auto !important;
}

/* Quote Request Skeleton - Match first box style */
.swvt-quote-request-skeleton {
  border-radius: 2px !important;
  border: 1px solid #ddd;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Prevent parent containers from stretching skeleton width */
.custom_third_section .swvt-skeleton-card,
.custom_third_section .swvt-warsha-skeleton,
.custom_third_section .swvt-form-skeleton {
  width: 100% !important;
  max-width: 293px !important;
  min-width: 293px !important;
  flex: 0 0 auto !important;
  flex-grow: 0 !important;
  flex-shrink: 0 !important;
  flex-basis: auto !important;
}

/* Prevent grid or flex parent from expanding skeletons */
.custom_third_section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.custom_third_section > .swvt-skeleton-card,
.custom_third_section > .swvt-warsha-skeleton,
.custom_third_section > .swvt-form-skeleton {
  align-self: center;
}

/* Skeleton Header */
.swvt-form-skeleton-header {
  background: #f0f2f2;
  border-bottom: 1px solid #d5d9d9;
  padding: 16px 24px;
  min-height: 56px;
  border-radius: 12px 12px 0 0;
  display: flex;
  align-items: center;
}

.swvt-form-skeleton-header-line {
  width: 60%;
  height: 1.5rem;
  margin-left: 28px;
  background-color: #e0e0e0;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.swvt-form-skeleton-header-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  background-size: 1000px 100%;
  animation: shimmer 1.5s infinite;
}

/* Skeleton Body - consistent padding for both skeletons */
.swvt-form-skeleton-body,
.swvt-warsha-skeleton .card-body {
  padding: 24px;
  box-sizing: border-box;
}

/* Skeleton Field */
.swvt-form-skeleton-field {
  margin-bottom: 1.25rem;
}

.swvt-form-skeleton-label {
  width: 35%;
  height: 0.875rem;
  background-color: #e0e0e0;
  border-radius: 4px;
  margin-bottom: 0.5rem;
  position: relative;
  overflow: hidden;
}

.swvt-form-skeleton-label::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  background-size: 1000px 100%;
  animation: shimmer 1.5s infinite;
}

.swvt-form-skeleton-input {
  width: 100%;
  height: 2.75rem;
  background-color: #e0e0e0;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.swvt-form-skeleton-input::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  background-size: 1000px 100%;
  animation: shimmer 1.5s infinite;
}

/* Skeleton Button */
.swvt-form-skeleton-button {
  width: calc(100% - 48px);
  height: 2.75rem;
  background-color: #e0e0e0;
  border-radius: 12px;
  margin-top: 1.5rem;
  margin-left: 24px;
  margin-right: 24px;
  position: relative;
  overflow: hidden;
}

.swvt-form-skeleton-button::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  background-size: 1000px 100%;
  animation: shimmer 1.5s infinite;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  /* All skeletons use full width on mobile */
  .swvt-skeleton-card,
  .swvt-warsha-skeleton,
  .swvt-form-skeleton,
  .swvt-quote-request-skeleton,
  .swvt-product-title-rating-skeleton,
  .swvt-product-details-section-skeleton {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Override parent container rules on mobile */
  .custom_third_section .swvt-skeleton-card,
  .custom_third_section .swvt-warsha-skeleton,
  .custom_third_section .swvt-form-skeleton,
  .custom_third_section .swvt-quote-request-skeleton {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .swvt-form-skeleton-body,
  .swvt-warsha-skeleton .card-body {
    padding: 1.25rem;
  }

  .swvt-form-skeleton-header {
    padding: 16px 1rem;
  }

  .swvt-form-skeleton-label {
    width: 45%;
  }

  .swvt-form-skeleton-header-line {
    width: 70%;
    margin-left: 0;
  }

  .swvt-form-skeleton-button {
    width: calc(100% - 2.5rem);
    margin-left: 1.25rem;
    margin-right: 1.25rem;
  }
}

