/* ======================================================
   e-Learn TSM MUPA
   File        : components.css
   Version     : 2.0.0
   Description : UI Components
====================================================== */

/* ======================================================
   CARD
====================================================== */

.card {
  background: var(--card);

  border: 1px solid var(--border);

  border-radius: var(--radius);

  padding: 20px;

  box-shadow: var(--shadow);
}

.card-header {
  display: flex;

  justify-content: space-between;

  align-items: center;

  margin-bottom: 20px;
}

.card-title {
  font-size: 18px;

  font-weight: 600;
}

.card-body {
  display: block;
}

/* ======================================================
   GRID
====================================================== */

.grid {
  display: grid;

  gap: 20px;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ======================================================
   BUTTON
====================================================== */

.btn {
  border: none;

  border-radius: 10px;

  padding: 10px 18px;

  cursor: pointer;

  font-weight: 500;

  transition: var(--transition);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--primary);

  color: #fff;
}

.btn-secondary {
  background: var(--secondary);

  color: #fff;
}

.btn-success {
  background: var(--success);

  color: #fff;
}

.btn-warning {
  background: var(--warning);

  color: #fff;
}

.btn-danger {
  background: var(--danger);

  color: #fff;
}

.btn-info {
  background: var(--info);

  color: #fff;
}

.btn-outline {
  background: #fff;

  border: 1px solid var(--border);
}

/* ======================================================
   FORM
====================================================== */

.form-group {
  display: flex;

  flex-direction: column;

  margin-bottom: 18px;
}

.form-group label {
  margin-bottom: 8px;

  font-weight: 500;
}

.form-control {
  width: 100%;

  border: 1px solid var(--border);

  border-radius: 10px;

  padding: 10px 14px;

  background: #fff;
}

.form-control:focus {
  border-color: var(--primary);
}

/* ======================================================
   SEARCH BOX
====================================================== */

.search-box {
  position: relative;
}

.search-box i {
  position: absolute;

  left: 15px;

  top: 50%;

  transform: translateY(-50%);

  color: var(--subtext);
}

.search-box input {
  width: 100%;

  padding: 10px 15px 10px 42px;

  border: 1px solid var(--border);

  border-radius: 10px;
}

/* ======================================================
   TABLE
====================================================== */

.table {
  width: 100%;

  border-collapse: collapse;
}

.table th {
  background: #f8fafc;

  text-align: left;

  padding: 12px;

  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 12px;

  border-bottom: 1px solid var(--border);
}

.table tr:hover {
  background: #f9fafb;
}

/* ======================================================
   BADGE
====================================================== */

.badge {
  display: inline-flex;

  align-items: center;

  padding: 5px 10px;

  border-radius: 50px;

  font-size: 12px;

  font-weight: 600;
}

.badge-success {
  background: #dcfce7;

  color: #166534;
}

.badge-warning {
  background: #fef3c7;

  color: #92400e;
}

.badge-danger {
  background: #fee2e2;

  color: #991b1b;
}

.badge-info {
  background: #dbeafe;

  color: #1d4ed8;
}

/* ======================================================
   PROGRESS
====================================================== */

.progress {
  width: 100%;

  height: 10px;

  background: #e5e7eb;

  border-radius: 50px;

  overflow: hidden;
}

.progress-bar {
  height: 100%;

  background: var(--primary);
}

/* ======================================================
   STAT CARD
====================================================== */

.stat-card {
  display: flex;

  justify-content: space-between;

  align-items: center;
}

.stat-title {
  font-size: 14px;

  color: var(--subtext);
}

.stat-value {
  font-size: 30px;

  font-weight: 700;
}

.stat-icon {
  width: 60px;

  height: 60px;

  border-radius: 50%;

  display: flex;

  justify-content: center;

  align-items: center;

  background: #ecfeff;

  color: var(--primary);

  font-size: 24px;
}

/* ======================================================
   TOOLBAR
====================================================== */

.toolbar {
  display: flex;

  justify-content: space-between;

  align-items: center;

  gap: 15px;

  flex-wrap: wrap;
}

/* ======================================================
   AVATAR
====================================================== */

.avatar {
  width: 42px;

  height: 42px;

  border-radius: 50%;

  background: var(--primary);

  color: #fff;

  display: flex;

  justify-content: center;

  align-items: center;

  font-weight: 600;
}

/* ======================================================
   EMPTY STATE
====================================================== */

.empty {
  text-align: center;

  padding: 60px 20px;

  color: var(--subtext);
}

.empty i {
  font-size: 60px;

  margin-bottom: 20px;
}

/* ======================================================
   SKELETON
====================================================== */

.skeleton {
  width: 100%;

  height: 18px;

  border-radius: 6px;

  background: linear-gradient(90deg, #f1f5f9, #e2e8f0, #f1f5f9);

  background-size: 300%;

  animation: skeleton 1.2s infinite;
}

@keyframes skeleton {
  from {
    background-position: 100%;
  }

  to {
    background-position: -100%;
  }
}

/* ======================================================
   DIVIDER
====================================================== */

.divider {
  width: 100%;

  height: 1px;

  background: var(--border);

  margin: 20px 0;
}

/* ======================================================
   DASHBOARD WIDGET
====================================================== */

.widget {
  background: var(--card);

  border: 1px solid var(--border);

  border-radius: var(--radius);

  padding: 20px;

  box-shadow: var(--shadow);
}

.widget-header {
  display: flex;

  justify-content: space-between;

  align-items: center;

  margin-bottom: 20px;
}

.widget-title {
  font-size: 16px;

  font-weight: 600;
}

.widget-body {
  display: block;
}

/* ======================================================
   CHART CONTAINER
====================================================== */

.chart-box {
  width: 100%;

  min-height: 320px;

  background: #fff;

  border: 1px solid var(--border);

  border-radius: var(--radius);

  padding: 20px;
}

/* ======================================================
   FILTER BAR
====================================================== */

.filter-bar {
  display: flex;

  gap: 15px;

  align-items: center;

  flex-wrap: wrap;

  margin-bottom: 20px;
}

.filter-group {
  display: flex;

  align-items: center;

  gap: 10px;
}

/* ======================================================
   PAGINATION
====================================================== */

.pagination {
  display: flex;

  justify-content: flex-end;

  align-items: center;

  gap: 8px;

  margin-top: 20px;
}

.page-item {
  width: 38px;

  height: 38px;

  border-radius: 10px;

  border: 1px solid var(--border);

  background: #fff;

  display: flex;

  justify-content: center;

  align-items: center;

  cursor: pointer;

  transition: var(--transition);
}

.page-item:hover {
  background: var(--primary);

  color: #fff;
}

.page-item.active {
  background: var(--primary);

  color: #fff;
}

/* ======================================================
   SKELETON CARD
====================================================== */

.skeleton-card {
  background: #fff;

  border: 1px solid var(--border);

  border-radius: var(--radius);

  padding: 20px;

  overflow: hidden;

  position: relative;
}

.skeleton-card::before {
  content: "";

  position: absolute;

  inset: 0;

  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.6),
    transparent
  );

  animation: skeletonCard 1.2s infinite;
}

@keyframes skeletonCard {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(100%);
  }
}

.skeleton-title {
  width: 60%;

  height: 20px;

  background: #e5e7eb;

  border-radius: 6px;

  margin-bottom: 18px;
}

.skeleton-text {
  width: 100%;

  height: 14px;

  background: #e5e7eb;

  border-radius: 6px;

  margin-bottom: 12px;
}

.skeleton-text.short {
  width: 40%;
}

/* ======================================================
   DROPDOWN MENU
====================================================== */

.dropdown-menu-custom {
  background: #fff;

  border: 1px solid var(--border);

  border-radius: 12px;

  box-shadow: var(--shadow);

  padding: 8px;
}

.dropdown-item-custom {
  padding: 10px 14px;

  border-radius: 8px;

  cursor: pointer;

  transition: var(--transition);
}

.dropdown-item-custom:hover {
  background: #f8fafc;
}

/* ======================================================
   STATUS DOT
====================================================== */

.status-dot {
  width: 10px;

  height: 10px;

  border-radius: 50%;

  display: inline-block;

  margin-right: 6px;
}

.status-success {
  background: var(--success);
}

.status-warning {
  background: var(--warning);
}

.status-danger {
  background: var(--danger);
}

.status-info {
  background: var(--info);
}

/* ======================================================
   TIMELINE
====================================================== */

.timeline {
  position: relative;

  padding-left: 30px;
}

.timeline::before {
  content: "";

  position: absolute;

  left: 10px;

  top: 0;

  bottom: 0;

  width: 2px;

  background: var(--border);
}

.timeline-item {
  position: relative;

  margin-bottom: 25px;
}

.timeline-item::before {
  content: "";

  position: absolute;

  left: -24px;

  top: 6px;

  width: 12px;

  height: 12px;

  border-radius: 50%;

  background: var(--primary);
}

.timeline-title {
  font-weight: 600;
}

.timeline-time {
  color: var(--subtext);

  font-size: 13px;
}

/* ======================================================
   NOTIFICATION BADGE
====================================================== */

.notify {
  position: absolute;

  top: -6px;

  right: -6px;

  min-width: 18px;

  height: 18px;

  border-radius: 50px;

  background: var(--danger);

  color: #fff;

  display: flex;

  justify-content: center;

  align-items: center;

  font-size: 11px;

  font-weight: 600;

  padding: 0 5px;
}

/* ======================================================
   ALERT SMALL
====================================================== */

.alert-sm {
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  margin-bottom: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
