/*
 * Additional Modern Enhancements
 * Specific improvements for CRM interface elements
 */

/* ========================================
   LIST VIEWS & DATA TABLES
   ======================================== */
.listViewEntriesDiv, .listViewContentDiv {
  background: white;
  border-radius: var(--radius-lg);
  padding: 0;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.listViewHeaders {
  background: var(--gray-50);
  border-bottom: 2px solid var(--gray-200);
}

.listViewHeaderValues {
  background: var(--primary-600);
  color: white;
  padding: var(--space-3);
  font-weight: 600;
}

/* ========================================
   DETAIL VIEW IMPROVEMENTS
   ======================================== */
.detailViewContainer {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin-bottom: var(--space-8);
}

.detailViewHeader {
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
  color: white;
  padding: var(--space-8);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.detailViewInfo {
  padding: var(--space-6);
}

.fieldLabel {
  font-weight: 600;
  color: var(--gray-700);
  font-size: var(--text-sm);
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.fieldValue {
  color: var(--gray-900);
  font-size: var(--text-base);
  padding: var(--space-3);
  background: var(--gray-50);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
}

/* ========================================
   DASHBOARD WIDGETS
   ======================================== */
.dashboardWidget {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  transition: all var(--transition-base);
  border: 1px solid var(--gray-200);
}

.dashboardWidget:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-2px);
}

.dashboardWidgetHeader {
  padding-bottom: var(--space-4);
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: var(--space-4);
}

.dashboardWidgetTitle {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--gray-900);
}

/* ========================================
   QUICK CREATE FORM
   ======================================== */
.quickCreateContent {
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-xl);
}

.quickCreateContent .form-control {
  border: 2px solid var(--gray-200);
}

.quickCreateContent .form-control:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* ========================================
   SEARCH BAR
   ======================================== */
.search-form, .searchField {
  position: relative;
}

.search-form input[type="text"], 
.searchField input {
  padding-left: var(--space-10);
  border-radius: var(--radius-full);
  border: 2px solid var(--gray-300);
  transition: all var(--transition-base);
}

.search-form input:focus,
.searchField input:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
  outline: none;
}

.search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
}

/* ========================================
   MODULE ICONS
   ======================================== */
.app-icon, .module-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  background: var(--primary-50);
  color: var(--primary-600);
  font-size: var(--text-lg);
  margin-right: var(--space-3);
  transition: all var(--transition-base);
}

.app-icon:hover, .module-icon:hover {
  background: var(--primary-600);
  color: white;
  transform: scale(1.1);
}

/* ========================================
   FILTER PANEL
   ======================================== */
.filterPanel {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--space-6);
}

.filterPanel .select2-container {
  border-radius: var(--radius-md);
}

/* ========================================
   STATUS INDICATORS
   ======================================== */
.status-indicator {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  gap: var(--space-2);
}

.status-indicator.active,
.status-indicator.open {
  background: var(--success-50);
  color: var(--success-700);
}

.status-indicator.inactive,
.status-indicator.closed {
  background: var(--gray-100);
  color: var(--gray-700);
}

.status-indicator.pending {
  background: var(--warning-50);
  color: var(--warning-600);
}

.status-indicator::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: currentColor;
}

/* ========================================
   TIMELINE / ACTIVITY STREAM
   ======================================== */
.timeline {
  position: relative;
  padding-left: var(--space-8);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gray-200);
}

.timeline-item {
  position: relative;
  margin-bottom: var(--space-6);
  padding-left: var(--space-6);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  background: var(--primary-600);
  border: 3px solid white;
  box-shadow: 0 0 0 2px var(--gray-200);
  z-index: 1;
}

.timeline-content {
  background: white;
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border-left: 3px solid var(--primary-600);
}

/* ========================================
   KANBAN BOARD
   ======================================== */
.kanban-board {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  padding: var(--space-4);
}

.kanban-column {
  flex: 0 0 300px;
  background: var(--gray-100);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.kanban-column-header {
  font-weight: 700;
  padding: var(--space-3);
  background: white;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kanban-card {
  background: white;
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  box-shadow: var(--shadow-sm);
  cursor: move;
  transition: all var(--transition-base);
}

.kanban-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* ========================================
   CALENDAR VIEW
   ======================================== */
.calendar-view {
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-lg);
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4);
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: var(--space-4);
}

.calendar-day {
  border: 1px solid var(--gray-200);
  padding: var(--space-3);
  min-height: 100px;
  transition: all var(--transition-fast);
}

.calendar-day:hover {
  background: var(--gray-50);
  border-color: var(--primary-300);
}

.calendar-event {
  background: var(--primary-50);
  color: var(--primary-700);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  margin-bottom: var(--space-1);
  border-left: 3px solid var(--primary-600);
}

/* ========================================
   FILE UPLOAD & ATTACHMENTS
   ======================================== */
.file-upload-area {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  text-align: center;
  transition: all var(--transition-base);
  cursor: pointer;
}

.file-upload-area:hover {
  border-color: var(--primary-500);
  background: var(--primary-50);
}

.file-upload-area.dragover {
  border-color: var(--primary-600);
  background: var(--primary-100);
}

.attachment-item {
  display: flex;
  align-items: center;
  padding: var(--space-3);
  background: var(--gray-50);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
  transition: all var(--transition-fast);
}

.attachment-item:hover {
  background: var(--gray-100);
}

/* ========================================
   PROGRESS BARS
   ======================================== */
.progress {
  height: 8px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-500), var(--primary-600));
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.progress-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: var(--space-2);
}

/* ========================================
   EMPTY STATES
   ======================================== */
.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-8);
}

.empty-state-icon {
  font-size: 4rem;
  color: var(--gray-300);
  margin-bottom: var(--space-6);
}

.empty-state-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: var(--space-4);
}

.empty-state-description {
  font-size: var(--text-base);
  color: var(--gray-600);
  max-width: 400px;
  margin: 0 auto var(--space-6);
}

/* ========================================
   TOOLTIPS
   ======================================== */
.tooltip {
  background: var(--gray-900);
  color: white;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  box-shadow: var(--shadow-lg);
}

.tooltip::after {
  border-color: var(--gray-900) transparent transparent transparent;
}

/* ========================================
   CONTEXT MENU
   ======================================== */
.context-menu {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2xl);
  border: 1px solid var(--gray-200);
  min-width: 200px;
  padding: var(--space-2);
}

.context-menu-item {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.context-menu-item:hover {
  background: var(--gray-100);
}

.context-menu-divider {
  height: 1px;
  background: var(--gray-200);
  margin: var(--space-2) 0;
}

/* ========================================
   BREADCRUMBS
   ======================================== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  background: white;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-6);
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  color: var(--gray-600);
  font-size: var(--text-sm);
}

.breadcrumb-item a {
  color: var(--gray-600);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumb-item a:hover {
  color: var(--primary-600);
}

.breadcrumb-item.active {
  color: var(--gray-900);
  font-weight: 600;
}

.breadcrumb-separator {
  color: var(--gray-400);
  margin: 0 var(--space-2);
}

/* ========================================
   STATS CARDS
   ======================================== */
.stats-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
  border-left: 4px solid var(--primary-600);
  transition: all var(--transition-base);
}

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

.stats-value {
  font-size: var(--text-4xl);
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: var(--space-2);
}

.stats-label {
  font-size: var(--text-sm);
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.stats-change {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  margin-top: var(--space-2);
}

.stats-change.positive {
  background: var(--success-50);
  color: var(--success-700);
}

.stats-change.negative {
  background: var(--error-50);
  color: var(--error-700);
}

/* ========================================
   LOADING SPINNER
   ======================================== */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--gray-200);
  border-top-color: var(--primary-600);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
