/* Dashboard styles for EasyCom platform */

:root {
  --primary: #4f46e5;
  --primary-light: #818cf8;
  --primary-dark: #4338ca;
  --secondary: #10b981;
  --secondary-light: #34d399;
  --secondary-dark: #059669;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10b981;
  --dark: #1f2937;
  --light: #f3f4f6;
  --gray: #6b7280;
  --gray-light: #d1d5db;
  --white: #ffffff;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Layout and structure */
.dashboard-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem;
}

.dashboard-card {
  background-color: var(--white);
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.dashboard-card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--gray-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dashboard-card-body {
  padding: 1.5rem;
}

.dashboard-card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-light);
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Typography */
.dashboard-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 1rem;
}

.dashboard-subtitle {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 0.75rem;
}

.dashboard-text {
  font-size: 0.875rem;
  color: var(--gray);
  line-height: 1.5;
}

/* Buttons */
.dashboard-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-weight: 500;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

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

.dashboard-btn-primary:hover {
  background-color: var(--primary-dark);
}

.dashboard-btn-secondary {
  background-color: var(--secondary);
  color: var(--white);
}

.dashboard-btn-secondary:hover {
  background-color: var(--secondary-dark);
}

.dashboard-btn-outline {
  border: 1px solid var(--gray-light);
  background-color: transparent;
  color: var(--gray);
}

.dashboard-btn-outline:hover {
  background-color: var(--light);
}

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

.dashboard-btn-danger:hover {
  background-color: #dc2626;
}

.dashboard-btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.dashboard-btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.dashboard-btn-icon {
  margin-right: 0.5rem;
}

/* Form elements */
.dashboard-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gray-light);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  transition: border-color 0.2s ease;
}

.dashboard-input:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.dashboard-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--dark);
  margin-bottom: 0.5rem;
}

.dashboard-select {
  width: 100%;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  border: 1px solid var(--gray-light);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  appearance: none;
}

.dashboard-select:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

/* Toggle switch */
.dashboard-toggle {
  position: relative;
  display: inline-block;
  width: 3rem;
  height: 1.5rem;
}

.dashboard-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.dashboard-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--gray-light);
  transition: .4s;
  border-radius: 1.5rem;
}

.dashboard-toggle-slider:before {
  position: absolute;
  content: "";
  height: 1.1rem;
  width: 1.1rem;
  left: 0.2rem;
  bottom: 0.2rem;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

.dashboard-toggle input:checked + .dashboard-toggle-slider {
  background-color: var(--primary);
}

.dashboard-toggle input:focus + .dashboard-toggle-slider {
  box-shadow: 0 0 1px var(--primary);
}

.dashboard-toggle input:checked + .dashboard-toggle-slider:before {
  transform: translateX(1.5rem);
}

/* Grid layout */
.dashboard-grid {
  display: grid;
  grid-gap: 1rem;
}

.dashboard-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.dashboard-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.dashboard-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* Smart Selection specific styles */
.ai-badge {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #4f46e5, #10b981);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

.ai-badge svg {
  width: 0.75rem;
  height: 0.75rem;
  margin-right: 0.25rem;
}

.courier-card {
  border: 1px solid var(--gray-light);
  border-radius: 0.375rem;
  padding: 0.75rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.courier-card:hover {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

.courier-card.selected {
  border-color: var(--primary);
  background-color: rgba(79, 70, 229, 0.05);
}

.courier-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.courier-name {
  font-weight: 600;
  font-size: 0.875rem;
}

.courier-metrics {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.metric {
  display: flex;
  align-items: center;
  font-size: 0.75rem;
  color: var(--gray);
}

.metric-value {
  font-weight: 600;
  margin-left: 0.25rem;
}

.metric-rating {
  color: var(--warning);
}

.metric-cost {
  color: var(--secondary);
}

.ai-recommend-badge {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--secondary);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}

.ai-recommend-badge svg {
  width: 0.75rem;
  height: 0.75rem;
  margin-right: 0.25rem;
}

.data-refresh-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  color: var(--primary);
  border: 1px solid var(--primary-light);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.data-refresh-button:hover {
  background-color: var(--primary);
  color: white;
}

.data-refresh-button svg {
  width: 0.75rem;
  height: 0.75rem;
  margin-right: 0.25rem;
}

.sort-buttons {
  display: flex;
  gap: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .dashboard-grid-2,
  .dashboard-grid-3,
  .dashboard-grid-4 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .dashboard-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .dashboard-card-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* Animation for loading states */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.loading-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.invisible {
  visibility: hidden;
}

.hidden {
  display: none;
}

/* Tooltip styles */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltip-text {
  visibility: hidden;
  width: 120px;
  background-color: var(--dark);
  color: var(--white);
  text-align: center;
  border-radius: 0.25rem;
  padding: 0.25rem 0.5rem;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -60px;
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 0.75rem;
}

.tooltip .tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--dark) transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
} 