/* ==========================================================================
   REUSABLE UI COMPONENTS (Cards, Tables, Modals, Toasts, Badges, Controls)
   ========================================================================== */

/* Stat KPI Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: var(--transition-fast);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background-color: var(--accent-light);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.stat-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
}

.stat-trend-up {
  color: var(--color-success);
  font-weight: 600;
}

.stat-trend-down {
  color: var(--color-danger);
  font-weight: 600;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success { background: var(--bg-success-light); color: var(--color-success); }
.badge-warning { background: var(--bg-warning-light); color: var(--color-warning); }
.badge-danger { background: var(--bg-danger-light); color: var(--color-danger); }
.badge-info { background: var(--bg-info-light); color: var(--color-info); }
.badge-accent { background: var(--accent-light); color: var(--accent-primary); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background: var(--btn-gradient, var(--btn-primary-bg, var(--accent-primary)));
  color: var(--btn-primary-text, #fff);
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--bg-hover);
  color: var(--text-main);
  border-color: var(--border-color);
}
.btn-secondary:hover {
  background-color: var(--border-color);
}

.btn-danger {
  background-color: var(--color-danger);
  color: #fff;
}

/* Data Table Component */
.table-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 2rem;
}

.table-header-toolbar {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-color);
}

.table-search-input {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  outline: none;
  width: 260px;
}

.table-search-input:focus {
  border-color: var(--accent-primary);
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.custom-table th {
  background-color: var(--bg-hover);
  padding: 0.85rem 1.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.custom-table td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
  color: var(--text-main);
}

.custom-table tr:hover {
  background-color: var(--bg-hover);
}

/* Toast Container */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 280px;
  animation: slideIn 0.3s ease-out;
  transition: all 0.3s ease;
}

.toast-success { border-left: 4px solid var(--color-success); }
.toast-error { border-left: 4px solid var(--color-danger); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Glass Card & Stat Elevation Polish */
.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-border);
  box-shadow: var(--shadow-lg);
}

/* Form Controls & Labels */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.45rem;
}

.form-input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition-fast);
}

.form-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* Color Swatch Badges */
.color-swatch-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.color-swatch-item {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.75rem;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.color-swatch-item:hover {
  transform: scale(1.12);
}

.color-swatch-item.active {
  border-color: var(--text-main);
  transform: scale(1.15);
  box-shadow: var(--shadow-md);
}

/* Real-Time Live Preview Widget Mockup */
.preview-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: sticky;
  top: calc(var(--header-height) + 1.5rem);
  transition: var(--transition-smooth);
}

.preview-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.preview-body {
  padding: 1.5rem;
}

.preview-mini-navbar {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition-fast);
}

.preview-mini-sidebar {
  width: 140px;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.preview-mini-nav-item {
  height: 24px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  padding: 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
}

/* Public Website Navigation Links Styling */
.public-nav-item {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
}

.public-nav-item:hover {
  color: var(--accent-primary);
  background-color: var(--bg-hover);
}

.public-nav-item.active {
  color: var(--accent-primary);
  background-color: var(--accent-light);
  font-weight: 700;
}


