/**
 * Kompas Ilmu - Global Utilities & Widgets Styles (utilities.css)
 * Meliputi: Text Truncate, Button & Badge Variants, Keyframe Animations, WhatsApp Widget, Utility Classes.
 */

/* Utilities */
.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.text-truncate-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bg-brand-primary {
  background-color: var(--color-primary) !important;
}

.text-brand-primary {
  color: var(--color-primary) !important;
}

.btn-brand-primary {
  background-color: var(--color-primary) !important;
  color: #ffffff !important;
  border: none;
  font-weight: 600;
  border-radius: 8px;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.btn-brand-primary:hover {
  background-color: var(--color-primary-dark) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(0, 143, 215, 0.25);
}

.btn-outline-brand-primary {
  border: 1.5px solid var(--color-primary) !important;
  color: var(--color-primary) !important;
  background-color: transparent;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.btn-outline-brand-primary:hover {
  background-color: var(--color-primary) !important;
  color: #ffffff !important;
}

.badge-brand-primary {
  background-color: var(--color-primary) !important;
  color: #ffffff !important;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 50rem;
}

.badge-amber-gradient {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%) !important;
  color: #ffffff !important;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 50rem;
}

.timeout-icon-pulse {
  animation: pulseTimeout 1.8s infinite;
}

@keyframes pulseTimeout {
  0% {
    transform: scale(0.96);
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.35);
  }
  70% {
    transform: scale(1.04);
    box-shadow: 0 0 0 10px rgba(220, 38, 38, 0);
  }
  100% {
    transform: scale(0.96);
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
  }
}

/* Floating WhatsApp Widget with 'Chat Admin' Label */
.wa-widget-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1040;
}

.wa-floating-btn-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.wa-floating-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: #FFFFFF !important;
  text-decoration: none !important;
  padding: 10px 18px 10px 14px;
  border-radius: 50px;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
  font-weight: 600;
  font-size: 0.92rem;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
  position: relative;
}

.wa-floating-btn:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 10px 26px rgba(37, 211, 102, 0.55);
  color: #FFFFFF !important;
}

.wa-floating-btn .wa-icon-main {
  font-size: 1.45rem;
  line-height: 1;
  color: #FFFFFF !important;
}

.wa-floating-label {
  letter-spacing: 0.01em;
  white-space: nowrap;
}

@media (max-width: 576px) {
  .wa-widget-container {
    bottom: 16px;
    right: 16px;
  }
  .wa-floating-btn {
    padding: 8px 14px 8px 12px;
    font-size: 0.85rem;
  }
  .wa-floating-btn .wa-icon-main {
    font-size: 1.3rem;
  }
}

/* ==========================================================
 * UTILITY CLASSES (Pemisahan Style Inline ke CSS Eksternal)
 * ========================================================== */
.breadcrumb-nav-text {
  font-size: 0.9rem;
}

.breadcrumb-truncate-lg {
  max-width: 300px;
}

.breadcrumb-truncate-md {
  max-width: 250px;
}

.article-featured-img {
  max-height: 420px;
  object-fit: cover;
}

.card-max-w-680 {
  max-width: 680px;
}

.card-max-w-540 {
  max-width: 540px;
}

.card-max-w-480 {
  max-width: 480px;
}

.user-name-truncate {
  max-width: 140px;
}

.user-fullname-truncate {
  max-width: 200px;
  font-size: 0.9rem;
}

.btn-search-input {
  background: none;
  padding: 0 8px;
}

.product-price-danger {
  font-size: 1.85rem;
  font-weight: 700;
  color: #DC2626;
}

.product-price-normal {
  font-size: 1.85rem;
  font-weight: 700;
  color: #0F172A;
}

.product-description-wrap {
  font-size: 0.93rem;
  line-height: 1.8;
  text-align: justify;
}

.card-img-cover-180 {
  height: 180px;
  object-fit: cover;
}

.question-media-img {
  max-height: 260px;
}

.badge-custom-badge {
  font-size: 0.78rem;
}

.badge-brand-xs {
  background-color: var(--color-primary);
  font-size: 0.74rem;
}

.badge-accent-gradient {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  font-size: 0.72rem;
}

.text-desc-line {
  font-size: 0.88rem;
  line-height: 1.5;
}

.modal-terms-dialog {
  z-index: 1060;
}

.modal-terms-body {
  font-size: 0.925rem;
  line-height: 1.6;
}

.form-terms-label {
  line-height: 1.45;
}

.empty-state-icon {
  font-size: 3.5rem;
}

.small-label-xs {
  font-size: 0.75rem;
}

.step-number-badge {
  width: 26px;
  height: 26px;
  font-size: 0.85rem;
}

.step-guide-text {
  font-size: 0.93rem;
  line-height: 1.5;
}

.hero-simulasi-header {
  background: linear-gradient(135deg, #0077b3 0%, #008FD7 100%);
}

.hero-simulasi-title {
  font-size: 1.75rem;
  letter-spacing: -0.02em;
}

.breadcrumb-truncate-sm {
  max-width: 280px;
}

.guide-step-row {
  font-size: 0.85rem;
}
