/* ===================================
   🎨 ENHANCED COMPONENTS
   ===================================
   Inspirado em Casedrop + FBASE
   Com identidade FarmHub
   =================================== */

/* ===================================
   BREADCRUMBS
   =================================== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  font-size: var(--text-sm);
  color: #737373;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.breadcrumb-link {
  color: #737373;
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb-link:hover {
  color: var(--color-primary-500);
}

.breadcrumb-separator {
  color: #d4d4d4;
}

.breadcrumb-current {
  font-weight: 500;
}

/* ===================================
   NOTIFICATION BADGE (Casedrop style)
   =================================== */
.notification-bell {
  position: relative;
}

.notification-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: linear-gradient(135deg, var(--color-accent-500), var(--color-accent-400));
  color: white;
  font-size: 10px;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
  animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* ===================================
   NOTIFICATIONS PANEL (Casedrop inspired)
   =================================== */
.notifications-panel {
  position: fixed;
  top: 70px;
  right: 20px;
  width: 380px;
  max-height: 500px;
  background-color: white;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  z-index: var(--z-dropdown);
  overflow: hidden;
  animation: slideDown 0.2s ease-out;
}

.notifications-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg);
  border-bottom: 1px solid #f5f5f5;
  background-color: white;
  position: sticky;
  top: 0;
  z-index: 1;
}

.notifications-panel-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: #171717;
  margin: 0;
}

.notifications-panel-actions {
  display: flex;
  gap: var(--space-sm);
}

.notifications-panel-action {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-primary-500);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.notifications-panel-action:hover {
  background-color: #f0fdf4;
}

.notifications-panel-action.clear {
  color: #737373;
}

.notifications-panel-action.clear:hover {
  background-color: #fafafa;
}

.notifications-list {
  max-height: 400px;
  overflow-y: auto;
}

.notification-item {
  padding: var(--space-lg);
  border-bottom: 1px solid #f5f5f5;
  transition: background-color 0.2s ease;
  cursor: pointer;
}

.notification-item:hover {
  background-color: #fafafa;
}

.notification-item.unread {
  background-color: #f0fdf4;
}

.notification-item.unread::before {
  content: '';
  position: absolute;
  left: var(--space-lg);
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background-color: var(--color-primary-500);
  border-radius: var(--radius-full);
}

.notification-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}

.notification-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notification-icon.success {
  background-color: #dcfce7;
  color: var(--color-success);
}

.notification-icon.warning {
  background-color: #fef3c7;
  color: var(--color-warning);
}

.notification-icon.error {
  background-color: #fee2e2;
  color: var(--color-error);
}

.notification-icon.info {
  background-color: #dbeafe;
  color: var(--color-info);
}

.notification-content {
  flex: 1;
}

.notification-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: #171717;
  margin-bottom: var(--space-xs);
}

.notification-message {
  font-size: var(--text-sm);
  color: #737373;
  margin-bottom: var(--space-sm);
  line-height: 1.4;
}

.notification-time {
  font-size: var(--text-xs);
  color: #a3a3a3;
}

.notification-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.notification-action-btn {
  font-size: var(--text-xs);
  font-weight: 500;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.notification-action-btn.primary {
  background-color: var(--color-accent-500);
  color: white;
}

.notification-action-btn.primary:hover {
  background-color: var(--color-accent-600);
}

.notification-action-btn.secondary {
  background-color: #f5f5f5;
  color: #737373;
}

.notification-action-btn.secondary:hover {
  background-color: #e5e5e5;
}

.notifications-empty {
  padding: var(--space-3xl) var(--space-xl);
  text-align: center;
}

.notifications-empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-lg);
  opacity: 0.3;
}

.notifications-loading {
    padding: 24px;
    text-align: center;
}

.notifications-loading .spinner-enhanced {
    margin: 0 auto 12px;
}

.notifications-empty-text {
  font-size: var(--text-sm);
  color: #a3a3a3;
}

.notifications-error {
  padding: 48px 24px;
  text-align: center;
}

.notifications-error-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  opacity: 0.3;
  color: #a3a3a3;
}

.notifications-error-text {
  font-size: 14px;
  color: #a3a3a3;
  margin: 0;
}

.notifications-error-text small {
  font-size: 11px;
  opacity: 0.7;
  display: block;
  margin-top: 8px;
}

/* ===================================
   ENHANCED STATS CARDS
   =================================== */
.stats-card-enhanced {
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: var(--space-xl);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stats-card-enhanced::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary-500) 0%, var(--color-primary-400) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stats-card-enhanced:hover::before {
  opacity: 1;
}

.stats-card-enhanced:hover {
  border-color: var(--color-primary-200);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.1);
}

/* ===================================
   ENHANCED TABLE (Casedrop hover)
   =================================== */
.table-enhanced {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-sm);
}

.table-enhanced thead {
  background-color: #fafafa;
}

.table-enhanced th {
  padding: var(--space-md) var(--space-lg);
  text-align: left;
  font-weight: 600;
  color: #737373;
  text-transform: uppercase;
  font-size: var(--text-xs);
  letter-spacing: 0.05em;
  border-bottom: 2px solid #e5e5e5;
}

.table-enhanced tbody tr {
  transition: all 0.2s ease;
  border-bottom: 1px solid #f5f5f5;
}

.table-enhanced tbody tr:hover {
  background-color: #fafafa;
  transform: scale(1.001);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.table-enhanced td {
  padding: var(--space-lg);
  color: #171717;
  vertical-align: middle;
  border-bottom: 1px solid #f5f5f5;
}

.table-enhanced tbody tr:last-child td {
  border-bottom: none;
}

/* ===================================
   EMPTY STATE (Clean + Modern)
   =================================== */
.empty-state-modern {
  padding: var(--space-4xl) var(--space-2xl);
  text-align: center;
  background: linear-gradient(135deg, #fafafa 0%, white 100%);
  border: 2px dashed #e5e5e5;
  border-radius: var(--radius-xl);
}

.empty-state-icon-wrapper {
  width: 96px;
  height: 96px;
  margin: 0 auto var(--space-xl);
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-radius: var(--radius-2xl);
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state-icon-wrapper svg {
  width: 48px;
  height: 48px;
  color: var(--color-primary-500);
  opacity: 0.5;
}

.empty-state-title {
  font-size: var(--text-xl);
  font-weight: 600;
  color: #171717;
  margin-bottom: var(--space-sm);
}

.empty-state-description {
  font-size: var(--text-sm);
  color: #737373;
  margin-bottom: var(--space-xl);
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.empty-state-action {
  margin-top: var(--space-lg);
}

/* ===================================
   STATUS BADGE (Casedrop style)
   =================================== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 4px 10px;
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  animation: pulse-status 2s ease-in-out infinite;
}

.status-badge.online {
  background-color: #dcfce7;
  color: #166534;
}

.status-badge.online::before {
  background-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.status-badge.offline {
  background-color: #f5f5f5;
  color: #737373;
}

.status-badge.offline::before {
  background-color: #a3a3a3;
}

.status-badge.pending {
  background-color: #fef3c7;
  color: #92400e;
}

.status-badge.pending::before {
  background-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.3);
}

.status-badge.completed {
  background-color: #dbeafe;
  color: #1e40af;
}

.status-badge.completed::before {
  background-color: #3b82f6;
}

.status-badge.error {
  background-color: #fee2e2;
  color: #991b1b;
}

.status-badge.error::before {
  background-color: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3);
}

@keyframes pulse-status {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* ===================================
   ACTION BUTTON (Orange/Yellow CTA)
   =================================== */
.btn-cta {
  background: linear-gradient(135deg, var(--color-accent-500) 0%, var(--color-accent-400) 100%);
  color: white;
  font-weight: 600;
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.3);
}

.btn-cta:active {
  transform: translateY(0);
}

/* ===================================
   PAGE HEADER WITH ACTIONS
   =================================== */
.page-header-enhanced {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid #e5e5e5;
}

.page-header-left {
  flex: 1;
}

.page-title-large {
  font-size: var(--text-4xl);
  font-weight: 600;

  margin-bottom: var(--space-xs);
  letter-spacing: -0.02em;
}

.page-header-actions {
  display: flex;
  gap: var(--space-md);
  align-items: center;
}

/* ===================================
   SECTION HEADER WITH REFRESH
   =================================== */
.section-header-enhanced {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
}

.section-title-enhanced {
  font-size: var(--text-xl);
  font-weight: 600;
  color: #171717;
}

.section-actions {
  display: flex;
  gap: var(--space-sm);
}

.btn-refresh {
  padding: var(--space-sm);
  background: none;
  border: 1px solid #e5e5e5;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  color: #737373;
}

.btn-refresh:hover {
  background-color: #fafafa;
  border-color: #d4d4d4;
  color: #171717;
}

.btn-refresh:active svg {
  animation: spin 0.5s ease-in-out;
}

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

/* ===================================
   LOADING SPINNER (Enhanced)
   =================================== */
.spinner-enhanced {
  width: 40px;
  height: 40px;
  border: 3px solid #f5f5f5;
  border-top-color: var(--color-primary-500);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

.spinner-sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

/* ===================================
   RESPONSIVE
   =================================== */
@media (max-width: 768px) {
  .notifications-panel {
    left: 20px;
    right: 20px;
    width: auto;
  }

  .page-header-enhanced {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-lg);
  }

  .page-header-actions {
    width: 100%;
    flex-direction: column;
  }

  .page-header-actions .btn {
    width: 100%;
  }

  .section-header-enhanced {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }
}

