.badge-card {
  background: var(--card-bg, #ffffff);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  
  &:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
  }

  // Sizes
  &--small {
    padding: 16px;
    min-height: 120px;
    
    .badge-card__title {
      font-size: 0.875rem;
      margin-bottom: 8px;
    }
    
    .value-main {
      font-size: 1.5rem;
    }
  }

  &--medium {
    padding: 20px;
    min-height: 140px;
    
    .badge-card__title {
      font-size: 1rem;
      margin-bottom: 12px;
    }
    
    .value-main {
      font-size: 2rem;
    }
  }

  &--large {
    padding: 24px;
    min-height: 180px;
    
    .badge-card__title {
      font-size: 1.125rem;
      margin-bottom: 16px;
    }
    
    .value-main {
      font-size: 2.5rem;
    }
  }

  // Color themes
  &.badge-success {
    border-left: 4px solid #10b981;
    
    .badge-card__icon {
      background: rgba(16, 185, 129, 0.1);
      color: #10b981;
    }
    
    .value-main {
      color: #10b981;
    }
  }

  &.badge-primary {
    border-left: 4px solid #3b82f6;
    
    .badge-card__icon {
      background: rgba(59, 130, 246, 0.1);
      color: #3b82f6;
    }
    
    .value-main {
      color: #3b82f6;
    }
  }

  &.badge-warning {
    border-left: 4px solid #f59e0b;
    
    .badge-card__icon {
      background: rgba(245, 158, 11, 0.1);
      color: #f59e0b;
    }
    
    .value-main {
      color: #f59e0b;
    }
  }

  &.badge-danger {
    border-left: 4px solid #ef4444;
    
    .badge-card__icon {
      background: rgba(239, 68, 68, 0.1);
      color: #ef4444;
    }
    
    .value-main {
      color: #ef4444;
    }
  }

  &.badge-info {
    border-left: 4px solid #06b6d4;
    
    .badge-card__icon {
      background: rgba(6, 182, 212, 0.1);
      color: #06b6d4;
    }
    
    .value-main {
      color: #06b6d4;
    }
  }
}

.badge-card__content {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.badge-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.badge-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.badge-card__source {
  display: flex;
  align-items: center;
  
  .source-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
  }
  
  &.source-healthy .source-dot {
    background: #10b981;
  }
  
  &.source-local .source-dot {
    background: #6b7280;
  }
  
  &.source-error .source-dot {
    background: #ef4444;
  }
}

.badge-card__title {
  font-weight: 600;
  color: var(--text-primary, #111827);
  margin: 0;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.badge-card__value {
  margin-bottom: auto;
  
  .value-main {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    display: block;
    
    &.value-error {
      color: #ef4444 !important;
    }
  }
}

.badge-card__updated {
  margin-top: 8px;
  color: var(--text-secondary, #6b7280);
  
  small {
    font-size: 0.75rem;
  }
}

.badge-card__description {
  color: var(--text-secondary, #6b7280);
  font-size: 0.875rem;
  line-height: 1.4;
  margin: 8px 0 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.badge-card__error {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #ef4444;
  font-size: 0.75rem;
  margin-top: 8px;
  
  i {
    font-size: 14px;
  }
}

.badge-card__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-secondary, #6b7280);
  
  .loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-left-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
  }
  
  .loading-text {
    font-size: 0.875rem;
  }
}

.badge-card__error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #ef4444;
  font-size: 0.875rem;
  
  i {
    font-size: 24px;
    margin-bottom: 8px;
  }
}

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

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

// Dark mode support
@media (prefers-color-scheme: dark) {
  .badge-card {
    --card-bg: #1f2937;
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    
    background: var(--card-bg);
    
    .badge-card__loading {
      .loading-spinner {
        border-color: rgba(255, 255, 255, 0.1);
        border-left-color: #60a5fa;
      }
    }
  }
}

// Responsive
@media (max-width: 768px) {
  .badge-card {
    &--large,
    &--medium {
      padding: 16px;
      min-height: 120px;
      
      .badge-card__title {
        font-size: 0.875rem;
      }
      
      .value-main {
        font-size: 1.5rem;
      }
    }
    
    .badge-card__icon {
      width: 40px;
      height: 40px;
      font-size: 20px;
    }
  }
}