/* ========================================
   REUSABLE COMPONENTS - Inspektorat Kabupaten Ngada
   Standardized component classes for consistent UI
   ======================================== */

/* ===== SECTION HEADER COMPONENT ===== */
.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-badge {
  display: inline-block;
  padding: var(--space-2) var(--space-5);
  background: var(--gradient-primary);
  color: white;
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}

.section-title {
  font-size: clamp(var(--font-size-3xl), 4vw, var(--font-size-4xl));
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
  line-height: var(--line-height-tight);
}

.section-divider {
  width: 80px;
  height: 4px;
  background: var(--gradient-primary);
  border-radius: var(--radius-sm);
  margin: 0 auto var(--space-6);
}

.section-subtitle {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: var(--line-height-relaxed);
}

/* ===== CARD COMPONENTS ===== */
.card-custom {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  overflow: hidden;
}

.card-custom:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.card-custom .card-body {
  padding: var(--space-6);
}

.card-custom .card-header {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
}

/* Stat Card */
.stat-card-custom {
  background: var(--color-bg-surface);
  border-radius: var(--radius-2xl);
  padding: var(--space-6) var(--space-5);
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  height: 100%;
}

.stat-card-custom:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.stat-card-custom .stat-icon {
  width: var(--icon-xl);
  height: var(--icon-xl);
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-5);
  font-size: var(--icon-md);
  color: white;
}

.stat-card-custom .stat-number {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-extrabold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
}

.stat-card-custom .stat-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-medium);
}

/* News Card */
.news-card-custom {
  background: var(--color-bg-surface);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  height: 100%;
}

.news-card-custom:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.news-card-custom .news-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.news-card-custom .news-card-body {
  padding: var(--space-6);
}

.news-card-custom .news-card-body h5 {
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-2);
  color: var(--color-text-primary);
}

.news-card-custom .news-card-body p {
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-4);
}

/* Feature Card */
.feature-card-custom {
  background: var(--color-bg-surface);
  border-radius: var(--radius-2xl);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  height: 100%;
}

.feature-card-custom:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.feature-card-custom .feature-icon {
  width: var(--icon-2xl);
  height: var(--icon-2xl);
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-6);
  font-size: var(--icon-xl);
  color: white;
}

.feature-card-custom h4 {
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-4);
  color: var(--color-text-primary);
}

.feature-card-custom p {
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
}

/* ===== BUTTON COMPONENTS ===== */
.btn-primary-custom {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-8);
  background: var(--color-primary);
  color: white;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-full);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  transition: all var(--transition-base);
  cursor: pointer;
}

.btn-primary-custom:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: white;
}

.btn-secondary-custom {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-8);
  background: transparent;
  color: white;
  border: 2px solid white;
  border-radius: var(--radius-full);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  transition: all var(--transition-base);
  cursor: pointer;
}

.btn-secondary-custom:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  color: white;
}

.btn-outline-custom {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-8);
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-full);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  transition: all var(--transition-base);
  cursor: pointer;
}

.btn-outline-custom:hover {
  background: var(--color-primary);
  color: white;
  transform: translateY(-2px);
}

/* ===== ICON WRAPPER COMPONENT ===== */
.icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  color: white;
}

.icon-wrapper-sm {
  width: var(--icon-md);
  height: var(--icon-md);
  font-size: var(--icon-sm);
}

.icon-wrapper-md {
  width: var(--icon-lg);
  height: var(--icon-lg);
  font-size: var(--icon-md);
}

.icon-wrapper-lg {
  width: var(--icon-xl);
  height: var(--icon-xl);
  font-size: var(--icon-lg);
}

/* ===== GRADIENT UTILITIES ===== */
.bg-gradient-primary {
  background: var(--gradient-primary);
}

.bg-gradient-primary-dark {
  background: var(--gradient-primary-dark);
}

.bg-gradient-hero {
  background: var(--gradient-hero);
}

.bg-gradient-sidebar {
  background: var(--gradient-sidebar);
}

/* ===== SHADOW UTILITIES ===== */
.shadow-custom-sm {
  box-shadow: var(--shadow-sm);
}

.shadow-custom-md {
  box-shadow: var(--shadow-md);
}

.shadow-custom-lg {
  box-shadow: var(--shadow-lg);
}

.shadow-custom-xl {
  box-shadow: var(--shadow-xl);
}

/* ===== FOCUS STYLES (Accessibility) ===== */
*:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

.btn-primary-custom:focus-visible,
.btn-secondary-custom:focus-visible,
.btn-outline-custom:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
}

/* ===== SKIP NAVIGATION LINK ===== */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary);
  color: white;
  padding: var(--space-2) var(--space-4);
  z-index: var(--z-toast);
  transition: top var(--transition-fast);
  text-decoration: none;
  font-weight: var(--font-weight-semibold);
}

.skip-link:focus {
  top: 0;
}

/* ===== RESPONSIVE TABLE WRAPPER ===== */
.table-responsive-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ===== FORM COMPONENTS ===== */
.form-control-custom {
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  transition: all var(--transition-fast);
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
}

.form-control-custom:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(205, 28, 24, 0.15);
  outline: none;
}

.form-control-custom.is-invalid {
  border-color: var(--color-danger);
}

.form-control-custom.is-valid {
  border-color: var(--color-success);
}

/* ===== BADGE COMPONENT ===== */
.badge-custom {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
}

.badge-primary {
  background: var(--color-primary);
  color: white;
}

.badge-success {
  background: var(--color-success);
  color: white;
}

.badge-warning {
  background: var(--color-warning);
  color: var(--color-neutral-900);
}

.badge-danger {
  background: var(--color-danger);
  color: white;
}

.badge-info {
  background: var(--color-info);
  color: white;
}

/* ===== ALERT COMPONENT ===== */
.alert-custom {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  border-left: 4px solid;
  margin-bottom: var(--space-4);
}

.alert-success-custom {
  background: var(--color-success-light);
  border-color: var(--color-success);
  color: #155724;
}

.alert-warning-custom {
  background: var(--color-warning-light);
  border-color: var(--color-warning);
  color: #856404;
}

.alert-danger-custom {
  background: var(--color-danger-light);
  border-color: var(--color-danger);
  color: #721c24;
}

.alert-info-custom {
  background: var(--color-info-light);
  border-color: var(--color-info);
  color: #0c5460;
}
