/* ==========================================================================
   DIALLO HRMS — UI COMPONENTS
   Cards, Module Grid, Buttons, Dropdowns, Tabs, Empty States
   ========================================================================== */

/* ----------------------------------------------------
   BUTTONS
   ---------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}
.btn-sm svg {
  width: 14px;
  height: 14px;
}

.btn-lg {
  padding: 10px 20px;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
}

/* Primary Button: Blue background + white text */
.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
  border: 1px solid var(--primary);
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}
.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}
.btn-primary:active {
  transform: translateY(1px);
}

/* Secondary Button: White/light surface + border */
.btn-secondary {
  background-color: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-main);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
  background-color: var(--bg-hover);
  border-color: var(--border-dark);
}

/* Danger Button */
.btn-danger {
  background-color: var(--danger);
  color: #ffffff;
  border: 1px solid var(--danger);
}
.btn-danger:hover {
  background-color: #b91c1c;
}

/* Ghost Button */
.btn-ghost {
  background-color: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}
.btn-ghost:hover {
  background-color: var(--bg-hover);
  color: var(--text-main);
}

/* Soft Primary */
.btn-soft {
  background-color: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
}
.btn-soft:hover {
  background-color: rgba(37, 99, 235, 0.15);
}

/* ----------------------------------------------------
   STANDARD CARDS
   border-radius: 10px-14px, subtle border & shadow
   ---------------------------------------------------- */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-speed);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.card-body {
  padding: 20px;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-main);
  background-color: var(--bg-table-header);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ----------------------------------------------------
   MODULE LANDING PAGE CARDS (Enterprise Navigation Grid)
   ---------------------------------------------------- */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.module-nav-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  text-decoration: none;
  overflow: hidden;
}

.module-nav-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  background-color: var(--bg-card-hover);
}

.module-nav-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.module-card-icon-box {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary-light);
  color: var(--primary);
  transition: all 0.2s ease;
}
.module-nav-card:hover .module-card-icon-box {
  background-color: var(--primary);
  color: #ffffff;
}

.module-card-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background-color: var(--bg-hover);
  color: var(--text-secondary);
}

.module-card-content h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.module-card-content p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 16px;
}

.module-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--primary);
}

.module-card-footer .arrow-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}
.module-nav-card:hover .module-card-footer .arrow-icon {
  transform: translateX(4px);
}

/* ----------------------------------------------------
   DROPDOWNS
   ---------------------------------------------------- */
.dropdown-menu-wrapper {
  position: relative;
  display: inline-block;
}

.dropdown-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  max-width: calc(100vw - 20px);
  background-color: var(--bg-dropdown);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 50;
  display: none;
  animation: fadeIn 0.15s ease;
}

.dropdown-popover.active {
  display: block;
}

.dropdown-header {
  padding: 8px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--text-primary);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.12s ease;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
}

.dropdown-item:hover {
  background-color: var(--bg-hover);
  color: var(--text-main);
}
.dropdown-item.active {
  background-color: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}
.dropdown-divider {
  height: 1px;
  background-color: var(--border-main);
  margin: 4px 0;
}

/* Notification Drawer / Panel */
.notification-popover {
  width: 360px;
}
.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color 0.15s;
}
.notification-item:hover {
  background-color: var(--bg-hover);
}
.notification-item.unread {
  background-color: var(--primary-soft);
}
.notif-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.notif-content {
  flex: 1;
  min-width: 0;
}
.notif-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}
.notif-time {
  font-size: 0.725rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ----------------------------------------------------
   TABS & SUBNAVS
   ---------------------------------------------------- */
.tab-list,
.tabs-nav,
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border-main);
  margin-bottom: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
  scrollbar-width: thin;
  scrollbar-color: var(--border-focus, #cbd5e1) transparent;
  width: 100%;
  padding-bottom: 2px;
}
.tab-list::-webkit-scrollbar,
.tabs-nav::-webkit-scrollbar,
.nav-tabs::-webkit-scrollbar {
  height: 5px;
  display: block;
}
.tab-list::-webkit-scrollbar-track,
.tabs-nav::-webkit-scrollbar-track,
.nav-tabs::-webkit-scrollbar-track {
  background: transparent;
}
.tab-list::-webkit-scrollbar-thumb,
.tabs-nav::-webkit-scrollbar-thumb,
.nav-tabs::-webkit-scrollbar-thumb {
  background: var(--border-focus, #cbd5e1);
  border-radius: 4px;
}
.tab-list::-webkit-scrollbar-thumb:hover,
.tabs-nav::-webkit-scrollbar-thumb:hover,
.nav-tabs::-webkit-scrollbar-thumb:hover {
  background: var(--primary, #0284c7);
}

.tab-btn {
  flex-shrink: 0 !important;
  padding: 10px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  user-select: none;
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.tabs-scroll-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  margin-bottom: 20px;
}
.tab-scroll-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border-main);
  background: var(--bg-surface);
  color: var(--text-main);
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: all 0.15s ease;
}
.tab-scroll-arrow:hover {
  background: var(--primary-light, #e0f2fe);
  color: var(--primary, #0284c7);
  border-color: var(--primary, #0284c7);
}

/* ----------------------------------------------------
   EMPTY STATES (Modern Circular Icon Card Pattern)
   ---------------------------------------------------- */
.empty-state {
  text-align: center;
  padding: 56px 20px;
  background-color: var(--bg-card);
  border: 1px dashed var(--border-main);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.card .empty-state,
.card-body .empty-state,
.table-card .empty-state {
  border: none;
  background-color: transparent;
  padding: 56px 20px;
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--primary-light, #eff6ff);
  color: var(--primary, #2563eb);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.empty-state-icon svg {
  width: 24px;
  height: 24px;
}

.empty-state-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.empty-state-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  max-width: 460px;
  margin: 0 auto 20px auto;
  line-height: 1.5;
}

.empty-state-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

/* ----------------------------------------------------
   LOADING SKELETONS
   ---------------------------------------------------- */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-hover) 25%,
    var(--border-light) 50%,
    var(--bg-hover) 75%
  );
  background-size: 200% 100%;
  animation: skeletonLoading 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeletonLoading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
