/**
 * Printive AI — Universal Loader & Spinner Component Styles
 * Version: 1.0.0
 * Description: Standalone, reusable loader animation with spinning gradient orb,
 *              bouncing dots, smooth text transitions, and educational tip boxes.
 * ==========================================================================
 */

/* =====================================================
   ⏳ MAIN LOADER CONTAINER
   ===================================================== */
.printive-loader,
.printive-loader-component {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 32px 24px;
  margin: 16px auto;
  max-width: 540px;
  background: var(--pv-card, #ffffff);
  border: 1px solid var(--pv-border, #e2e8f0);
  border-radius: var(--pv-radius-lg, 16px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
  text-align: center;
  box-sizing: border-box;
  transition: opacity 0.3s ease;
}

.printive-loader.visible,
.printive-loader-component.visible {
  display: flex !important;
}

/* =====================================================
   🔮 SPINNING GRADIENT ORB
   ===================================================== */
.loader-orb {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0%, var(--pv-primary, #334155) 50%, var(--pv-accent, #045cb4) 100%);
  animation: pv-orb-spin 1.1s linear infinite;
  position: relative;
  flex-shrink: 0;
}

.loader-orb::after {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--pv-card, #ffffff);
}

/* Orb Size Modifiers */
.loader-orb.sm {
  width: 36px;
  height: 36px;
}
.loader-orb.sm::after {
  inset: 4px;
}

.loader-orb.lg {
  width: 68px;
  height: 68px;
}
.loader-orb.lg::after {
  inset: 6px;
}

/* =====================================================
   📝 TYPOGRAPHY: TITLE & SUBTITLE
   ===================================================== */
.loader-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--pv-text, #1e293b);
  margin: 0;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.loader-subtitle-box {
  min-height: 48px;
  max-width: 460px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  text-align: center;
}

.loader-subtitle,
.loader-status-text {
  font-size: 13px;
  color: var(--pv-text-muted, #64748b);
  line-height: 1.5;
  margin: 0;
  font-weight: 500;
  transition: opacity 0.4s ease-in-out;
}

.loader-subtitle.fade-out,
.loader-status-text.fade-out {
  opacity: 0;
}

/* =====================================================
   ⚪ BOUNCING DOTS
   ===================================================== */
.loader-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.loader-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pv-primary, #334155);
  animation: pv-dot-bounce 1.2s ease infinite;
}

.loader-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.loader-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

/* =====================================================
   💡 EDUCATIONAL TIP BOX (MOCKUP & PRODUCT KNOWLEDGE)
   ===================================================== */
.loader-educational-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
  padding: 12px 16px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  font-size: 12px;
  color: #166534;
  line-height: 1.5;
  max-width: 420px;
  text-align: left;
  box-sizing: border-box;
  transition: all 0.3s ease;
}

.loader-educational-box .edu-icon {
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.loader-educational-box .edu-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.loader-educational-box .edu-heading {
  font-weight: 700;
  color: #14532d;
  font-size: 12px;
}

.loader-educational-box .edu-desc {
  color: #166534;
  font-size: 12px;
  line-height: 1.45;
  transition: opacity 0.4s ease;
}

.loader-educational-box .edu-desc.fade-out {
  opacity: 0;
}

/* Neutral Variant for Editor & Admin contexts */
.loader-educational-box.neutral {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #475569;
}
.loader-educational-box.neutral .edu-heading {
  color: #1e293b;
}
.loader-educational-box.neutral .edu-desc {
  color: #475569;
}

/* =====================================================
   📊 PROGRESS BAR
   ===================================================== */
.loader-progress-container {
  width: 100%;
  max-width: 320px;
  height: 6px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
  margin: 4px auto 0;
}

.loader-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--pv-primary, #334155), var(--pv-accent, #045cb4));
  border-radius: 9999px;
  transition: width 0.4s ease;
}

/* =====================================================
   🔄 ANIMATION KEYFRAMES
   ===================================================== */
@keyframes pv-orb-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pv-dot-bounce {
  0%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-6px);
  }
}

/* =====================================================
   📱 MOBILE RESPONSIVENESS
   ===================================================== */
@media (max-width: 480px) {
  .printive-loader,
  .printive-loader-component {
    padding: 24px 16px;
    gap: 12px;
  }

  .loader-orb {
    width: 48px;
    height: 48px;
  }

  .loader-title {
    font-size: 15px;
  }

  .loader-subtitle,
  .loader-status-text {
    font-size: 12px;
  }

  .loader-educational-box {
    padding: 10px 12px;
    font-size: 11.5px;
    max-width: 100%;
  }

  .loader-educational-box .edu-desc,
  .loader-educational-box .edu-heading {
    font-size: 11.5px;
  }
}
